org.apache.geronimo.mail
Class MailGBean

java.lang.Object
  extended by org.apache.geronimo.mail.MailGBean
All Implemented Interfaces:
org.apache.geronimo.gbean.GBeanLifecycle, org.apache.geronimo.management.J2EEManagedObject, org.apache.geronimo.management.J2EEResource, org.apache.geronimo.management.JavaMailResource

public class MailGBean
extends Object
implements org.apache.geronimo.gbean.GBeanLifecycle, org.apache.geronimo.management.JavaMailResource

GBean that provides access to JavaMail Sessions.

This GBean is used to generate JavaMail Sessions. JavaMail properties that are common to all JavaMail Sessions are provided via member variables of this class.

See Also:
ProtocolGBean, SMTPTransportGBean, POP3StoreGBean, IMAPStoreGBean

Field Summary
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
 
Constructor Summary
MailGBean(String objectName, Collection protocols, Boolean useDefault, Properties properties, Authenticator authenticator, String storeProtocol, String transportProtocol, String host, String user, Boolean debug)
          Construct an instance of MailGBean

Values that are set in the individual member variables will override any of the corresponding values that have been set in the properties set.

 
Method Summary
 Object $getResource()
           
 void doFail()
           
 void doStart()
           
 void doStop()
           
 Authenticator getAuthenticator()
          Returns the authenticator object.
 Boolean getDebug()
          Returns the debug setting for Sessions created from this GBean.
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 String getHost()
          Returns the default Mail server.
 String getObjectName()
          Returns the GBean name of this Mail GBean
 Properties getProperties()
          Returns the set of default properties for the protocols.
 Collection getProtocols()
          Returns the set of protocol GBeans that contain protocol specific configurations.
 String getStoreProtocol()
          Returns the store protocol that Sessions created from this GBean will return.
 String getTransportProtocol()
          Returns the transport protocol that Sessions created from this GBean will return.
 Boolean getUseDefault()
          Returns whether this GBean will return default Sessions or not.
 String getUser()
          Returns the username to provide when connecting to a Mail server.
 boolean isEventProvider()
           
 boolean isStateManageable()
           
 boolean isStatisticsProvider()
           
 void setAuthenticator(Authenticator authenticator)
          Sets the authenticator object.
 void setDebug(Boolean debug)
          Sets the debug setting for Sessions created from this GBean.
 void setHost(String host)
          Sets the default Mail server.
 void setProperties(Properties properties)
          Sets the set of default properties for the protocols.
 void setStoreProtocol(String storeProtocol)
          Sets the store protocol that Sessions created from this GBean will return.
 void setTransportProtocol(String transportProtocol)
          Sets the transport protocol that Sessions created from this GBean will return.
 void setUseDefault(Boolean useDefault)
          Sets whether this GBean will return default Sessions or not,
 void setUser(String user)
          Sets the username to provide when connecting to a Mail server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

MailGBean

public MailGBean(String objectName,
                 Collection protocols,
                 Boolean useDefault,
                 Properties properties,
                 Authenticator authenticator,
                 String storeProtocol,
                 String transportProtocol,
                 String host,
                 String user,
                 Boolean debug)
Construct an instance of MailGBean

Values that are set in the individual member variables will override any of the corresponding values that have been set in the properties set.

Parameters:
protocols - the set of protocol GBeans that contain protocol specific configurations
useDefault - whether this GBean will return default Sessions or not
properties - the set of default properties for the protocols
authenticator - the authenticator object
storeProtocol - the store protocol that Sessions created from this GBean will return
transportProtocol - the transport protocol that Sessions created from this GBean will return
host - the default Mail server
user - the username to provide when connecting to a Mail server
debug - the debug setting for Sessions created from this GBean
Method Detail

getProtocols

public Collection getProtocols()
Returns the set of protocol GBeans that contain protocol specific configurations.


getUseDefault

public Boolean getUseDefault()
Returns whether this GBean will return default Sessions or not.


setUseDefault

public void setUseDefault(Boolean useDefault)
Sets whether this GBean will return default Sessions or not,

Parameters:
useDefault - whether this GBean will return default Sessions or not

getProperties

public Properties getProperties()
Returns the set of default properties for the protocols.

Note: Proerties that are set here will override the properties that are set in the protocol GBeans.


setProperties

public void setProperties(Properties properties)
Sets the set of default properties for the protocols.

Note: Proerties that are set here will override the properties that are set in the protocol GBeans.

Parameters:
properties - the set of default properties for the protocols

getAuthenticator

public Authenticator getAuthenticator()
Returns the authenticator object.

Used only if a new Session object is created. Otherwise, it must match the Authenticator used to create the Session.


setAuthenticator

public void setAuthenticator(Authenticator authenticator)
Sets the authenticator object.

Used only if a new Session object is created. Otherwise, it must match the Authenticator used to create the Session.

Parameters:
authenticator - the authenticator object

getStoreProtocol

public String getStoreProtocol()
Returns the store protocol that Sessions created from this GBean will return.

Specifies the default Message Access Protocol. The Session.getStore() method returns a Store object that implements this protocol. The client can override this property and explicitly specify the protocol with the Session.getStore(String protocol) method.


setStoreProtocol

public void setStoreProtocol(String storeProtocol)
Sets the store protocol that Sessions created from this GBean will return.

Specifies the default Message Access Protocol. The Session.getStore() method returns a Store object that implements this protocol. The client can override this property and explicitly specify the protocol with the Session.getStore(String protocol) method.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
storeProtocol - the store protocol that Sessions created from this GBean will return

getTransportProtocol

public String getTransportProtocol()
Returns the transport protocol that Sessions created from this GBean will return.

Specifies the default Transport Protocol. The Session.getTransport() method returns a Transport object that implements this protocol. The client can override this property and explicitly specify the protocol by using Session.getTransport(String protocol) method.


setTransportProtocol

public void setTransportProtocol(String transportProtocol)
Sets the transport protocol that Sessions created from this GBean will return.

Specifies the default Transport Protocol. The Session.getTransport() method returns a Transport object that implements this protocol. The client can override this property and explicitly specify the protocol by using Session.getTransport(String protocol) method.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
transportProtocol - the transport protocol that Sessions created from this GBean will return

getHost

public String getHost()
Returns the default Mail server.

Specifies the default Mail server. The Store and Transport object’s connect methods use this property, if the protocolspecific host property is absent, to locate the target host.


setHost

public void setHost(String host)
Sets the default Mail server.

Specifies the default Mail server. The Store and Transport object’s connect methods use this property, if the protocolspecific host property is absent, to locate the target host.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
host - the default Mail server

getUser

public String getUser()
Returns the username to provide when connecting to a Mail server.

Specifies the username to provide when connecting to a Mail server. The Store and Transport object’s connect methods use this property, if the protocolspecific username property is absent, to obtain the username.


setUser

public void setUser(String user)
Sets the username to provide when connecting to a Mail server.

Specifies the username to provide when connecting to a Mail server. The Store and Transport object’s connect methods use this property, if the protocolspecific username property is absent, to obtain the username.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
user - the username to provide when connecting to a Mail server

getDebug

public Boolean getDebug()
Returns the debug setting for Sessions created from this GBean.


setDebug

public void setDebug(Boolean debug)
Sets the debug setting for Sessions created from this GBean.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
debug - the debug setting for Sessions created from this GBean

$getResource

public Object $getResource()

doStart

public void doStart()
             throws Exception
Specified by:
doStart in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
Exception

doStop

public void doStop()
            throws Exception
Specified by:
doStop in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
Exception

doFail

public void doFail()
Specified by:
doFail in interface org.apache.geronimo.gbean.GBeanLifecycle

getObjectName

public String getObjectName()
Returns the GBean name of this Mail GBean

Specified by:
getObjectName in interface org.apache.geronimo.management.J2EEManagedObject

isStateManageable

public boolean isStateManageable()
Specified by:
isStateManageable in interface org.apache.geronimo.management.J2EEManagedObject

isStatisticsProvider

public boolean isStatisticsProvider()
Specified by:
isStatisticsProvider in interface org.apache.geronimo.management.J2EEManagedObject

isEventProvider

public boolean isEventProvider()
Specified by:
isEventProvider in interface org.apache.geronimo.management.J2EEManagedObject

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()


Copyright © 2006 Apache Software Foundation. All Rights Reserved.