org.ow2.jonas.mail
Interface MailService

All Superinterfaces:
Service
All Known Implementing Classes:
JOnASMailService

public interface MailService
extends Service

This interface provides a description of the JavaMail service.

Author:
Ludovic Bert, Florent Benoit

Field Summary
static String MIMEPART_PROPERTY_TYPE
          MimePart DataSource marker.
static String PROPERTY_NAME
          JOnAS-specific properties (name).
static String PROPERTY_TYPE
          JOnAS-specific properties (type).
static String SESSION_PROPERTY_TYPE
          Session marker.
 
Method Summary
 void createMailFactory(String name, Properties props)
          Create a mail factory with the specified properties and register it into the registry.
 void recreateJavaMailFactory(JavaMail factory)
          This method is used when a Mail Factory configuration is modified via jonasAdmin.
 void renameJavaMailFactory(String oldName, JavaMail factory)
          This method is used when a particular Mail Factory configuration operation is done via jonasAdmin : when the JNDI name of this resource is modified.
 void unbindMailFactories()
          Unregister all the binding factories on the server.
 
Methods inherited from interface org.ow2.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Field Detail

SESSION_PROPERTY_TYPE

static final String SESSION_PROPERTY_TYPE
Session marker.

See Also:
Constant Field Values

MIMEPART_PROPERTY_TYPE

static final String MIMEPART_PROPERTY_TYPE
MimePart DataSource marker.

See Also:
Constant Field Values

PROPERTY_NAME

static final String PROPERTY_NAME
JOnAS-specific properties (name).

See Also:
Constant Field Values

PROPERTY_TYPE

static final String PROPERTY_TYPE
JOnAS-specific properties (type).

See Also:
Constant Field Values
Method Detail

createMailFactory

void createMailFactory(String name,
                       Properties props)
                       throws MailServiceException
Create a mail factory with the specified properties and register it into the registry. The created object is an instance of one of the 2 classes : JavaMailSession or JavaMailMimePartDS.

Parameters:
name - the mail factory name
props - the properties used to configure the mail factory.
Throws:
MailServiceException - if the creation or the registration of the factory failed.

recreateJavaMailFactory

void recreateJavaMailFactory(JavaMail factory)
                             throws MailServiceException
This method is used when a Mail Factory configuration is modified via jonasAdmin. In this case, the updated JavaMail object (JavaMailSession or JavaMailMimePartDS object) must be rebound in JNDI

Parameters:
factory - the factory
Throws:
MailServiceException - if the recreation of the factory failed.

renameJavaMailFactory

void renameJavaMailFactory(String oldName,
                           JavaMail factory)
                           throws MailServiceException
This method is used when a particular Mail Factory configuration operation is done via jonasAdmin : when the JNDI name of this resource is modified. In this case, the initial JavaMail object (JavaMailSession or JavaMailMimePartDS object) must be unbound and the updated JavaMail object must be reloaded. Also, the Mail Service private data structures must be updated.

Parameters:
oldName - old name of the factory
factory - the new factory
Throws:
MailServiceException - if the rename of the the factory failed.

unbindMailFactories

void unbindMailFactories()
                         throws MailServiceException
Unregister all the binding factories on the server.

Throws:
MailServiceException - if the unregistration of the factories failed.


Copyright © 2010 OW2 Consortium. All Rights Reserved.