1 7 package org.ejtools.jndi.browser.model.mail; 8 9 import java.util.Properties ; 10 11 import javax.mail.Provider ; 12 import javax.mail.Session ; 13 import javax.naming.Context ; 14 import javax.rmi.PortableRemoteObject ; 15 16 import org.ejtools.jndi.browser.model.JNDIContext; 17 18 45 public class SessionProxy extends JNDIContext 46 { 47 48 protected Session session; 49 50 51 58 public SessionProxy(Context context, String jndiName) 59 throws Exception  60 { 61 Object o = context.lookup(jndiName); 63 session = (Session ) PortableRemoteObject.narrow(o, Session .class); 64 65 this.setName(jndiName); 66 this.setClassName(session.getClass().getName()); 67 } 68 69 70 75 public Properties getProperties() 76 { 77 return session.getProperties(); 78 } 79 80 81 86 public Provider [] getProviders() 87 { 88 return session.getProviders(); 89 } 90 } 91 | Popular Tags |