org.ow2.easybeans.component.mail.factory
Class AbsJavaMailFactory

java.lang.Object
  extended by org.ow2.easybeans.component.mail.factory.AbsJavaMailFactory
All Implemented Interfaces:
javax.naming.spi.ObjectFactory
Direct Known Subclasses:
JavaMailMimePartDataSourceFactory, JavaMailSessionFactory

public abstract class AbsJavaMailFactory
extends java.lang.Object
implements javax.naming.spi.ObjectFactory

Abstract JNDI factory for Mail factories.

Author:
Florent BENOIT

Field Summary
static java.lang.String AUTHENTICATION_PASSWORD
          Password for authentication.
static java.lang.String AUTHENTICATION_USERNAME
          User name for authentication.
static java.lang.String MAIL_PROPERTIES
          Properties used for mail factory.
 
Constructor Summary
AbsJavaMailFactory()
           
 
Method Summary
protected  Authenticator getAuthenticator(javax.naming.Reference reference)
          Gets an authenticator for the given reference.
<T> T
getObject(javax.naming.Reference reference, java.lang.String propertyName)
          Load a given object for the given property name.
 java.util.Properties getSessionProperties(javax.naming.Reference reference)
          Gets the session properties.
 java.lang.String getString(javax.naming.Reference reference, java.lang.String propertyName)
          Get the given string from the reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.naming.spi.ObjectFactory
getObjectInstance
 

Field Detail

AUTHENTICATION_USERNAME

public static final java.lang.String AUTHENTICATION_USERNAME
User name for authentication.

See Also:
Constant Field Values

AUTHENTICATION_PASSWORD

public static final java.lang.String AUTHENTICATION_PASSWORD
Password for authentication.

See Also:
Constant Field Values

MAIL_PROPERTIES

public static final java.lang.String MAIL_PROPERTIES
Properties used for mail factory.

See Also:
Constant Field Values
Constructor Detail

AbsJavaMailFactory

public AbsJavaMailFactory()
Method Detail

getAuthenticator

protected Authenticator getAuthenticator(javax.naming.Reference reference)
Gets an authenticator for the given reference.

Parameters:
reference - the given reference
Returns:
an authenticator or null if there is none.

getSessionProperties

public java.util.Properties getSessionProperties(javax.naming.Reference reference)
                                          throws javax.naming.NamingException
Gets the session properties.

Parameters:
reference - the given reference
Returns:
session properties
Throws:
javax.naming.NamingException - if object is not read.

getString

public java.lang.String getString(javax.naming.Reference reference,
                                  java.lang.String propertyName)
Get the given string from the reference.

Parameters:
reference - the given reference
propertyName - the given property
Returns:
the given string

getObject

public <T> T getObject(javax.naming.Reference reference,
                       java.lang.String propertyName)
            throws javax.naming.NamingException
Load a given object for the given property name.

Type Parameters:
T - the type of the object to load
Parameters:
reference - the given reference
propertyName - the given property
Returns:
the loaded object
Throws:
javax.naming.NamingException - if object is not read.


Copyright © 2006-2009 OW2 Consortium. All Rights Reserved.