org.jboss.mail
Class MailService

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.mail.MailService
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class MailService
extends ServiceMBeanSupport (src)

MBean that gives support for JavaMail. Object of class javax.mail.Session will be bound in JNDI with the name provided with method setJNDIName(java.lang.String).


Field Summary
static java.lang.String JNDI_NAME
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
MailService()
           
 
Method Summary
 org.w3c.dom.Element getConfiguration()
          Configuration for the mail service.
 java.lang.String getDefaultSender()
           
 java.lang.String getJNDIName()
           
protected  ObjectName (src) getObjectName(MBeanServer (src)  server, ObjectName (src)  name)
          Sub-classes should override this method if they only need to set their object name during MBean pre-registration.
protected  java.lang.String getPassword()
          Password is write only.
 java.lang.String getPOP3ServerHost()
           
protected  java.util.Properties getProperties()
           
 java.lang.String getSMTPServerHost()
           
 java.lang.String getStoreProtocol()
           
 java.lang.String getTransportProtocol()
           
 java.lang.String getUser()
           
 void setConfiguration(org.w3c.dom.Element element)
          Configuration for the mail service.
 void setJNDIName(java.lang.String name)
          The JNDI name under which javax.mail.Session objects are bound.
 void setPassword(java.lang.String password)
          Password used to connect to a mail server
 void setUser(java.lang.String user)
          User id used to connect to a mail server
protected  void startService()
          Sub-classes should override this method to provide custum 'start' logic.
protected  void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JNDI_NAME

public static final java.lang.String JNDI_NAME
See Also:
Constant Field Values (src)
Constructor Detail

MailService

public MailService()
Method Detail

setUser

public void setUser(java.lang.String user)
User id used to connect to a mail server

See Also:
setPassword(java.lang.String)

getUser

public java.lang.String getUser()

setPassword

public void setPassword(java.lang.String password)
Password used to connect to a mail server

See Also:
setUser(java.lang.String)

getPassword

protected java.lang.String getPassword()
Password is write only.


getConfiguration

public org.w3c.dom.Element getConfiguration()
Configuration for the mail service.


setConfiguration

public void setConfiguration(org.w3c.dom.Element element)
Configuration for the mail service.


setJNDIName

public void setJNDIName(java.lang.String name)
The JNDI name under which javax.mail.Session objects are bound.


getJNDIName

public java.lang.String getJNDIName()

getStoreProtocol

public java.lang.String getStoreProtocol()

getTransportProtocol

public java.lang.String getTransportProtocol()

getDefaultSender

public java.lang.String getDefaultSender()

getSMTPServerHost

public java.lang.String getSMTPServerHost()

getPOP3ServerHost

public java.lang.String getPOP3ServerHost()

getObjectName

protected ObjectName (src)  getObjectName(MBeanServer (src)  server,
                                   ObjectName (src)  name)
                            throws MalformedObjectNameException (src) 
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration.

Overrides:
getObjectName in class ServiceMBeanSupport (src)
Throws:
MalformedObjectNameException (src)

startService

protected void startService()
                     throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'start' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

getProperties

protected java.util.Properties getProperties()
                                      throws java.lang.Exception
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception