|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.NotificationBroadcasterSupport org.objectweb.jonas.management.ReconfigDispatcher org.objectweb.jonas.service.AbsServiceImpl org.objectweb.jonas.mail.MailServiceImpl
public class MailServiceImpl
This class provides an implementation of the javaMail service.
Field Summary | |
---|---|
static java.lang.String |
CLASS
Mail service configuration parameters (class) |
protected java.lang.String |
domainName
|
static java.lang.String |
FACTORIES
Mail service configuration parameters (factories) |
static java.lang.String |
MIMEPART_PROPERTY_TYPE
|
static java.lang.String |
PROPERTY_NAME
JOnAS-specific properties (name) |
static java.lang.String |
PROPERTY_TYPE
JOnAS-specific properties (type) |
protected java.lang.String |
serverName
|
static java.lang.String |
SESSION_PROPERTY_TYPE
|
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher |
---|
RECONFIG_TYPE, SAVE_RECONFIG_TYPE |
Constructor Summary | |
---|---|
MailServiceImpl()
|
Method Summary | |
---|---|
void |
createMailFactory(java.lang.String factoryName,
java.util.Properties props)
Create a mail factory with the specified properties and register it into the registry. |
void |
createMailFactoryMBean(java.lang.String name,
java.util.Properties props,
java.lang.Boolean loadFromFile)
Create a mail factory with the specified properties and register it into the registry. |
protected void |
doInit(javax.naming.Context ctx)
Init the Mail service. |
protected void |
doStart()
Start the Mail Service. |
protected void |
doStop()
Stop the Mail service. |
java.lang.Integer |
getCurrentNumberOfMailFactories()
Gets the total number of mail factories available in JOnAS |
java.lang.Integer |
getCurrentNumberOfMimeMailFactories()
Gets the integer Number of internet |
java.lang.Integer |
getCurrentNumberOfSessionMailFactories()
Gets the number of Session mail factories available in JOnAS |
java.lang.String |
getFactoryName(java.lang.String jndiName)
Gets the factory name given the jndi name. |
java.util.Properties |
getMailFactoryPropertiesFile(java.lang.String configFile)
Gets the mail factory configuration properties from a local file |
java.util.List |
getMailFactoryPropertiesFiles()
MBean method: |
java.util.List |
getMimePartMailFactoryPropertiesFiles()
MBean method: |
java.util.List |
getSessionMailFactoryPropertiesFiles()
MBean method: |
void |
recreateJavaMailFactory(JavaMail factory)
This method is used when a Mail Factory configuration is modified via jonasAdmin. |
void |
renameJavaMailFactory(java.lang.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 and in JMX Server. |
void |
unbindMailFactoryMBean(java.lang.String factoryName)
Unregister the factory with the given name. |
Methods inherited from class org.objectweb.jonas.service.AbsServiceImpl |
---|
getDomainName, getJonasServerName, getName, init, isStarted, setName, start, stop |
Methods inherited from class org.objectweb.jonas.management.ReconfigDispatcher |
---|
addNotificationListener, getFilter, getHandback, getListener, getNotificationInfo, initLogger, removeNotificationListener, sendReconfigNotification, sendSaveNotification |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
---|
handleNotification, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.jonas.service.Service |
---|
getName, init, isStarted, setName, start, stop |
Field Detail |
---|
protected java.lang.String serverName
protected java.lang.String domainName
public static final java.lang.String PROPERTY_NAME
public static final java.lang.String PROPERTY_TYPE
public static final java.lang.String SESSION_PROPERTY_TYPE
public static final java.lang.String MIMEPART_PROPERTY_TYPE
public static final java.lang.String FACTORIES
public static final java.lang.String CLASS
Constructor Detail |
---|
public MailServiceImpl()
Method Detail |
---|
protected void doInit(javax.naming.Context ctx) throws ServiceException
doInit
in class AbsServiceImpl
ctx
- the configuration of the Ear service.
ServiceException
- if the initialization failed.protected void doStart() throws ServiceException
doStart
in class AbsServiceImpl
ServiceException
- if the initialization failed.protected void doStop() throws ServiceException
doStop
in class AbsServiceImpl
ServiceException
- if the stop failed.public void recreateJavaMailFactory(JavaMail factory) throws MailServiceException
recreateJavaMailFactory
in interface MailService
factory
- the factory
MailServiceException
- if the recreation of
the factory failed.public void renameJavaMailFactory(java.lang.String oldName, JavaMail factory) throws MailServiceException
renameJavaMailFactory
in interface MailService
oldName
- old name of the factoryfactory
- the new factory
MailServiceException
- if the rename of the
the factory failed.public void createMailFactory(java.lang.String factoryName, java.util.Properties props) throws MailServiceException
createMailFactory
in interface MailService
factoryName
- name of the factory to createprops
- the properties used to configure the mail factory.
MailServiceException
- if the creation or the registration of
the factory failed.public void createMailFactoryMBean(java.lang.String name, java.util.Properties props, java.lang.Boolean loadFromFile) throws MailServiceException
createMailFactoryMBean
in interface MailServiceImplMBean
name
- the mail factory nameprops
- the properties used to configure the mail factory.loadFromFile
- true if the mail factory is loaded from a .properties file
MailServiceException
- if the creation or the registration of
the factory failed.
MailServiceException
public void unbindMailFactories() throws MailServiceException
unbindMailFactories
in interface MailService
MailServiceException
- if the unregistration of the factories
failed.public void unbindMailFactoryMBean(java.lang.String factoryName) throws MailServiceException
unbindMailFactoryMBean
in interface MailServiceImplMBean
factoryName
- the name of the factory to unbind.
MailServiceException
- if the unregistration of the factory
failed.public java.lang.String getFactoryName(java.lang.String jndiName)
jndiName
- the jndi name
public java.lang.Integer getCurrentNumberOfMailFactories()
getCurrentNumberOfMailFactories
in interface MailServiceImplMBean
public java.lang.Integer getCurrentNumberOfSessionMailFactories()
getCurrentNumberOfSessionMailFactories
in interface MailServiceImplMBean
public java.lang.Integer getCurrentNumberOfMimeMailFactories()
getCurrentNumberOfMimeMailFactories
in interface MailServiceImplMBean
public java.util.Properties getMailFactoryPropertiesFile(java.lang.String configFile) throws java.lang.Exception
getMailFactoryPropertiesFile
in interface MailServiceImplMBean
configFile
- configuration to use
java.lang.Exception
- if it failspublic java.util.List getMailFactoryPropertiesFiles() throws java.lang.Exception
getMailFactoryPropertiesFiles
in interface MailServiceImplMBean
java.lang.Exception
- if the list can't be returnedpublic java.util.List getMimePartMailFactoryPropertiesFiles() throws java.lang.Exception
getMimePartMailFactoryPropertiesFiles
in interface MailServiceImplMBean
java.lang.Exception
- if the list can't be returnedpublic java.util.List getSessionMailFactoryPropertiesFiles() throws java.lang.Exception
getSessionMailFactoryPropertiesFiles
in interface MailServiceImplMBean
java.lang.Exception
- if the list can't be returned
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |