User: reverbel
  Date: 02/03/30 12:48:30

  Added:       iiop/src/main/org/jboss/ejb/plugins/iiop HomeFactory.java
  Log:
  HomeFactory is not an static nested class within IIOPContainerInvoker
  anymore. Rationale: clients need the HomeFactory class.
  
  Revision  Changes    Path
  1.1                  
contrib/iiop/src/main/org/jboss/ejb/plugins/iiop/HomeFactory.java
  
  Index: HomeFactory.java
  ===================================================================
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.ejb.plugins.iiop;
  
  import java.util.Hashtable;
  import javax.ejb.EJBHome;
  import javax.naming.Context;
  import javax.naming.Name;
  import javax.naming.Reference;
  import javax.naming.spi.ObjectFactory;
  import javax.rmi.PortableRemoteObject;
  import org.omg.CORBA.ORB;
  
  /**
   * An <code>ObjectFactory</code> implementation that translates
   * <code>Reference</code>s to <code>EJBHome</code>s back into CORBA
   * object references. The IIOP container invoker binds these 
   * <code>Reference</code>s in the JRMP/JNDI namespace.
   *
   * @author  <a href="mailto:[EMAIL PROTECTED]";>Francisco Reverbel</a>
   * @version $Revision: 1.1 $
   */
  public class HomeFactory implements ObjectFactory 
  {
  
     private static ORB orb = ORB.init(new String[0], System.getProperties());
     
     public HomeFactory()
     {
     }
     
     // Implementation of the interface ObjectFactory ------------------------
     
     public Object getObjectInstance(Object obj, Name name,
                                     Context nameCtx, Hashtable environment)
        throws Exception
     {
        return (EJBHome)PortableRemoteObject.narrow(
                    orb.string_to_object(
                          (String)((Reference)obj).get("IOR").getContent()),
                    EJBHome.class);
     }
  }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to