User: reverbel
  Date: 01/10/31 13:33:10

  Modified:    iiop/src/main/org/jboss/ejb/plugins/iiop/server
                        IIOPContainerInvoker.java
  Log:
  Added inner class HomeFactory that allows binding non-serializable IIOP stubs
  (such as the IBM ones) in the JNDI context.
  
  Revision  Changes    Path
  1.8       +29 -2     
contrib/iiop/src/main/org/jboss/ejb/plugins/iiop/server/IIOPContainerInvoker.java
  
  Index: IIOPContainerInvoker.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/iiop/src/main/org/jboss/ejb/plugins/iiop/server/IIOPContainerInvoker.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- IIOPContainerInvoker.java 2001/10/30 22:02:40     1.7
  +++ IIOPContainerInvoker.java 2001/10/31 21:33:09     1.8
  @@ -19,6 +19,7 @@
   import java.util.ArrayList;
   import java.util.Collection;
   import java.util.HashMap;
  +import java.util.Hashtable;
   import java.util.Iterator;
   import java.util.Map;
   
  @@ -32,6 +33,7 @@
   import javax.naming.NamingException;
   import javax.naming.StringRefAddr;
   import javax.naming.Reference;
  +import javax.naming.spi.ObjectFactory;
   import javax.rmi.PortableRemoteObject;
   
   import org.omg.CORBA.Any;
  @@ -110,7 +112,7 @@
    * CORBA reference for the corresponding <code>EJBObject</code>.
    *
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Francisco Reverbel</a>
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public class IIOPContainerInvoker
         extends Servant
  @@ -451,7 +453,9 @@
                        "javax.ejb.EJBHome", 
                        new StringRefAddr("IOR", 
                                          orb.object_to_string(
  -                                             (org.omg.CORBA.Object)ejbHome))));
  +                                               (org.omg.CORBA.Object)ejbHome)),
  +                     HomeFactory.class.getName(),
  +                     null));
            System.err.println("Bound " + container.getBeanMetaData().getEjbName()
                               + " to " + jndiName);
         } 
  @@ -895,6 +899,29 @@
            finally {
               Thread.currentThread().setContextClassLoader(oldCl);
            }
  +      }
  +   }
  +
  +   // Inner class HomeFactory -------------------------------------------------
  +
  +   public static 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