|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.NotificationBroadcasterSupport org.ow2.jonas.lib.reconfig.ReconfigEmitter org.ow2.jonas.lib.service.AbsServiceImpl org.ow2.jonas.mail.internal.JOnASMailService
public class JOnASMailService
This class provides an implementation of the javaMail service.
Field Summary | |
---|---|
static String |
CLASS
Mail service configuration parameters (class). |
static String |
FACTORIES
Mail service configuration parameters (factories). |
Fields inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter |
---|
RECONFIG_TYPE, SAVE_RECONFIG_TYPE |
Fields inherited from interface org.ow2.jonas.mail.MailService |
---|
MIMEPART_PROPERTY_TYPE, PROPERTY_NAME, PROPERTY_TYPE, SESSION_PROPERTY_TYPE |
Constructor Summary | |
---|---|
JOnASMailService()
|
Method Summary | |
---|---|
void |
createMailFactory(String factoryName,
Properties props)
Create a mail factory with the specified properties and register it into the registry. |
void |
createMailFactoryMBean(String name,
Properties props,
Boolean loadFromFile)
Create a mail factory with the specified properties and register it into the registry. |
protected void |
doStart()
Start the Mail Service. |
protected void |
doStop()
Stop the Mail service. |
Integer |
getCurrentNumberOfMailFactories()
Gets the total number of mail factories available in JOnAS. |
Integer |
getCurrentNumberOfMimeMailFactories()
Gets the integer Number of internet. |
Integer |
getCurrentNumberOfSessionMailFactories()
Gets the number of Session mail factories available in JOnAS. |
String |
getFactoryName(String jndiName)
Gets the factory name given the jndi name. |
Properties |
getMailFactoryPropertiesFile(String configFile)
Gets the mail factory configuration properties from a local file. |
List<String> |
getMailFactoryPropertiesFiles()
MBean method. |
List<String> |
getMimePartMailFactoryPropertiesFiles()
MBean method. |
List<String> |
getSessionMailFactoryPropertiesFiles()
MBean method. |
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 |
setFactories(String factories)
|
void |
setJmxService(JmxService jmxService)
|
void |
setRegistryService(RegistryService registry)
|
void |
unbindMailFactories()
Unregister all the binding factories on the server and in JMX Server. |
void |
unbindMailFactoryMBean(String factoryName)
Unregister the factory with the given name. |
Methods inherited from class org.ow2.jonas.lib.service.AbsServiceImpl |
---|
convertToList, doInit, getDomainName, getJonasServerName, getName, getServerProperties, init, isStarted, setName, setServerProperties, start, stop, throwRequirementException, toString |
Methods inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter |
---|
initLogger, sendReconfigNotification, sendSaveNotification |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.ow2.jonas.service.Service |
---|
getName, init, isStarted, setName, start, stop |
Field Detail |
---|
public static final String FACTORIES
public static final String CLASS
Constructor Detail |
---|
public JOnASMailService()
Method Detail |
---|
public void setFactories(String factories)
factories
- initial (comma separated list) of mail factories.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(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(String factoryName, 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(String name, Properties props, Boolean loadFromFile) throws MailServiceException
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(String factoryName) throws MailServiceException
factoryName
- the name of the factory to unbind.
MailServiceException
- if the unregistration of the factory
failed.public String getFactoryName(String jndiName)
jndiName
- the jndi name
public Integer getCurrentNumberOfMailFactories()
public Integer getCurrentNumberOfSessionMailFactories()
public Integer getCurrentNumberOfMimeMailFactories()
public Properties getMailFactoryPropertiesFile(String configFile) throws Exception
configFile
- configuration to use
Exception
- if it failspublic List<String> getMailFactoryPropertiesFiles() throws Exception
Exception
public List<String> getMimePartMailFactoryPropertiesFiles() throws Exception
Exception
public List<String> getSessionMailFactoryPropertiesFiles() throws Exception
Exception
public void setJmxService(JmxService jmxService)
jmxService
- the jmxService to setpublic void setRegistryService(RegistryService registry)
registry
- the registry service to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |