Class MailSessionReference

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, javax.naming.spi.ObjectFactory

    public class MailSessionReference
    extends javax.naming.Reference
    implements javax.naming.spi.ObjectFactory
    MailSessionReference This is a subclass of javax.mail.Reference and an ObjectFactory for javax.mail.Session objects. The subclassing of Reference allows all of the setup for a javax.mail.Session to be captured without necessitating first instantiating a Session object. The reference is bound into JNDI and it is only when the reference is looked up that this object factory will create an instance of javax.mail.Session using the information captured in the Reference.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class javax.naming.Reference

        addrs, classFactory, classFactoryLocation, className
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getObjectInstance​(java.lang.Object ref, javax.naming.Name arg1, javax.naming.Context arg2, java.util.Hashtable arg3)
      Create a javax.mail.Session instance based on the information passed in the Reference
      void setPassword​(java.lang.String password)  
      void setProperties​(java.util.Properties properties)  
      void setUser​(java.lang.String user)  
      • Methods inherited from class javax.naming.Reference

        add, add, clear, clone, equals, get, get, getAll, getClassName, getFactoryClassLocation, getFactoryClassName, hashCode, remove, size, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MailSessionReference

        public MailSessionReference()
    • Method Detail

      • getObjectInstance

        public java.lang.Object getObjectInstance​(java.lang.Object ref,
                                                  javax.naming.Name arg1,
                                                  javax.naming.Context arg2,
                                                  java.util.Hashtable arg3)
                                           throws java.lang.Exception
        Create a javax.mail.Session instance based on the information passed in the Reference
        Specified by:
        getObjectInstance in interface javax.naming.spi.ObjectFactory
        Parameters:
        ref - the Reference
        arg1 - not used
        arg2 - not used
        arg3 - not used
        Returns:
        the object found
        Throws:
        java.lang.Exception - if unable to get object instance
        See Also:
        ObjectFactory.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable)
      • setUser

        public void setUser​(java.lang.String user)
      • setPassword

        public void setPassword​(java.lang.String password)
      • setProperties

        public void setProperties​(java.util.Properties properties)