Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/mail
In directory usw-pr-cvs1:/tmp/cvs-serv17918/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/mail
Added Files:
SessionProxy.java
Log Message:
Add support for BeanInfo generation bby XDoclet
--- NEW FILE: SessionProxy.java ---
/*
* EJTools, the Enterprise Java Tools
*
* Distributable under LGPL license.
* See terms of license at www.gnu.org.
*/
package net.sourceforge.ejtools.jndibrowser.model.mail;
import java.util.Properties;
import javax.mail.Provider;
import javax.mail.Session;
import javax.naming.Context;
import javax.rmi.PortableRemoteObject;
import net.sourceforge.ejtools.jndibrowser.model.JNDIContext;
/**
* Describe a mail session.
*
* @author letiemble
* @created 13 décembre 2001
* @version $Revision: 1.3 $
* @todo Javadoc to complete
* @javabean:class displayName="Mail Session" shortDescription="Mail Session"
* @javabean:icons color16="/toolbarButtonGraphics/general/File16.gif"
* @javabean:property name="name" class="java.lang.String" displayName="Name" shortDescription="Name of the entry"
* @javabean:property name="className" class="java.lang.String" displayName="Class" shortDescription="Class of the entry"
* @javabean:property name="path" class="java.lang.String" displayName="Full Path" shortDescription="Absolute path of the context"
* @javabean:property name="properties" class="java.util.Properties" displayName="Properties" shortDescription="Properties of the session"
* @javabean:property name="providers" class="javax.mail.Provider" displayName="Providers" shortDescription="Providers of the session"
*/
public class SessionProxy extends JNDIContext
{
/** Description of the Field */
protected Session session;
/**
* Constructor for the SessionProxy object
*
* @param context Description of the Parameter
* @param jndiName Description of the Parameter
* @exception Exception Description of the Exception
*/
public SessionProxy(Context context, String jndiName) throws Exception
{
// Try to narrow to an EJBHome class
Object o = context.lookup(jndiName);
session = (Session) PortableRemoteObject.narrow(o, Session.class);
setName(jndiName);
setClassName(session.getClass().getName());
}
/**
* Gets the properties attribute of the SessionProxy object
*
* @return The properties value
*/
public Properties getProperties()
{
return session.getProperties();
}
/**
* Gets the providers attribute of the SessionProxy object
*
* @return The providers value
*/
public Provider[] getProviders()
{
return session.getProviders();
}
}
|