org.apache.geronimo.mail
Class ProtocolGBean

java.lang.Object
  extended by org.apache.geronimo.mail.ProtocolGBean
All Implemented Interfaces:
GBeanLifecycle
Direct Known Subclasses:
IMAPStoreGBean, NNTPStoreGBean, NNTPTransportGBean, POP3StoreGBean, SMTPSTransportGBean, SMTPTransportGBean

public class ProtocolGBean
extends Object
implements GBeanLifecycle

A generic GBean that provides for the configuration of a JavaMail protocol.

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


Field Summary
static String GBEAN_ADD_OVERRIDES
           
static String GBEAN_AUTH
           
static String GBEAN_CONNECTION_TIMEOUT
           
static String GBEAN_FACTORY_CLASS
           
static String GBEAN_FACTORY_FALLBACK
           
static String GBEAN_FACTORY_PORT
           
static String GBEAN_FROM
           
static String GBEAN_HOST
           
static GBeanInfo GBEAN_INFO
           
static String GBEAN_LOCALADDRESS
           
static String GBEAN_LOCALHOST
           
static String GBEAN_LOCALPORT
           
static String GBEAN_OBJECTNAME
           
static String GBEAN_PORT
           
static String GBEAN_PROPERTIES
           
static String GBEAN_PROTOCOL
           
static String GBEAN_QUITWAIT
           
static String GBEAN_REALM
           
static String GBEAN_TIMEOUT
           
static String GBEAN_USER
           
 
Constructor Summary
ProtocolGBean()
          Construct an instance of ProtocolGBean
ProtocolGBean(String objectName, String protocol, Properties properties, String host, String user)
          Construct an instance of ProtocolGBean

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
 void addOverrides(Properties props)
          Add the overrides from the member variables to the properties file.
 void doFail()
          Fails the GBean.
 void doStart()
          Starts the GBean.
 void doStop()
          Stops the target.
static GBeanInfo getGBeanInfo()
           
 String getHost()
          Returns the host the protocol connects to.
 String getObjectName()
          Returns the object name of this protocol GBean
 Properties getProperties()
          Returns the set of default properties for the protocol.
 String getProtocol()
          Returns the name of the protocol
 String getUser()
          Returns the default user name for the protocol.
 void setHost(String host)
          Set the host the protocol connects to.
 void setProperties(Properties properties)
          Sets the set of default properties for the protocol.
 void setUser(String user)
          Sets the default user name for the protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_OBJECTNAME

public static final String GBEAN_OBJECTNAME
See Also:
Constant Field Values

GBEAN_PROTOCOL

public static final String GBEAN_PROTOCOL
See Also:
Constant Field Values

GBEAN_PROPERTIES

public static final String GBEAN_PROPERTIES
See Also:
Constant Field Values

GBEAN_HOST

public static final String GBEAN_HOST
See Also:
Constant Field Values

GBEAN_USER

public static final String GBEAN_USER
See Also:
Constant Field Values

GBEAN_ADD_OVERRIDES

public static final String GBEAN_ADD_OVERRIDES
See Also:
Constant Field Values

GBEAN_PORT

public static final String GBEAN_PORT
See Also:
Constant Field Values

GBEAN_CONNECTION_TIMEOUT

public static final String GBEAN_CONNECTION_TIMEOUT
See Also:
Constant Field Values

GBEAN_TIMEOUT

public static final String GBEAN_TIMEOUT
See Also:
Constant Field Values

GBEAN_FROM

public static final String GBEAN_FROM
See Also:
Constant Field Values

GBEAN_AUTH

public static final String GBEAN_AUTH
See Also:
Constant Field Values

GBEAN_REALM

public static final String GBEAN_REALM
See Also:
Constant Field Values

GBEAN_QUITWAIT

public static final String GBEAN_QUITWAIT
See Also:
Constant Field Values

GBEAN_FACTORY_CLASS

public static final String GBEAN_FACTORY_CLASS
See Also:
Constant Field Values

GBEAN_FACTORY_FALLBACK

public static final String GBEAN_FACTORY_FALLBACK
See Also:
Constant Field Values

GBEAN_FACTORY_PORT

public static final String GBEAN_FACTORY_PORT
See Also:
Constant Field Values

GBEAN_LOCALHOST

public static final String GBEAN_LOCALHOST
See Also:
Constant Field Values

GBEAN_LOCALADDRESS

public static final String GBEAN_LOCALADDRESS
See Also:
Constant Field Values

GBEAN_LOCALPORT

public static final String GBEAN_LOCALPORT
See Also:
Constant Field Values

GBEAN_INFO

public static final GBeanInfo GBEAN_INFO
Constructor Detail

ProtocolGBean

public ProtocolGBean()
Construct an instance of ProtocolGBean


ProtocolGBean

public ProtocolGBean(String objectName,
                     String protocol,
                     Properties properties,
                     String host,
                     String user)
Construct an instance of ProtocolGBean

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:
objectName - the object name of the protocol
protocol - the name of the protocol
properties - the set of default properties for the protocol
host - the host the protocol connects to
user - the default name for the protocol
Method Detail

getObjectName

public String getObjectName()
Returns the object name of this protocol GBean


getProperties

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

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


setProperties

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

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:
properties - set of default properties for the protocol

getProtocol

public String getProtocol()
Returns the name of the protocol


getHost

public String getHost()
Returns the host the protocol connects to.


setHost

public void setHost(String host)
Set the host the protocol connects to.

Parameters:
host - the host the protocol connects to

getUser

public String getUser()
Returns the default user name for the protocol.


setUser

public void setUser(String user)
Sets the default user name for the protocol.

Parameters:
user - the default user name for the protocol

addOverrides

public void addOverrides(Properties props)
Add the overrides from the member variables to the properties file.


doStart

public void doStart()
             throws Exception
Description copied from interface: GBeanLifecycle
Starts the GBean. This informs the GBean that it is about to transition to the running state.

Specified by:
doStart in interface GBeanLifecycle
Throws:
Exception - if the target failed to start; this will cause a transition to the failed state

doStop

public void doStop()
            throws Exception
Description copied from interface: GBeanLifecycle
Stops the target. This informs the GBean that it is about to transition to the stopped state.

Specified by:
doStop in interface GBeanLifecycle
Throws:
Exception - if the target failed to stop; this will cause a transition to the failed state

doFail

public void doFail()
Description copied from interface: GBeanLifecycle
Fails the GBean. This informs the GBean that it is about to transition to the failed state.

Specified by:
doFail in interface GBeanLifecycle

getGBeanInfo

public static GBeanInfo getGBeanInfo()


Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.