User: reverbel
  Date: 01/08/17 07:52:15

  Modified:    iiop/src/main/org/jboss/ejb/plugins/iiop/server
                        IIOPContainerInvoker.java
  Log:
  WrongPolicy exception thrown by create_reference_with_id is now catched.
  
  Revision  Changes    Path
  1.2       +45 -20    
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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- IIOPContainerInvoker.java 2001/08/14 21:25:41     1.1
  +++ IIOPContainerInvoker.java 2001/08/17 14:52:15     1.2
  @@ -43,6 +43,7 @@
   //import org.omg.PortableServer.CurrentHelper; // not available in jdk1.4
   import org.omg.PortableServer.POA;
   import org.omg.PortableServer.POAManager;
  +import org.omg.PortableServer.POAPackage.WrongPolicy;
   import org.omg.PortableServer.Servant;
   import org.omg.PortableServer.IdAssignmentPolicyValue;
   import org.omg.PortableServer.LifespanPolicyValue;
  @@ -102,7 +103,7 @@
    * CORBA reference for the corresponding <code>EJBObject</code>.
    *
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Francisco Reverbel</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class IIOPContainerInvoker
         extends Servant
  @@ -476,41 +477,65 @@
      public EJBObject getStatelessSessionEJBObject()
            throws RemoteException 
      {
  -      return (EJBObject)PortableRemoteObject.narrow(
  -            poa.create_reference_with_id(nullId, beanRepositoryIds[0]),
  -            EJBObject.class);
  +      try {
  +         return (EJBObject)PortableRemoteObject.narrow(
  +               poa.create_reference_with_id(nullId, beanRepositoryIds[0]),
  +               EJBObject.class);
  +      }
  +      catch (WrongPolicy wrongPolicy) {
  +         throw new ServerException("Wrong POA policy in IIOPContainerInvoker", 
  +                                   wrongPolicy);
  +      }
      }
   
      public EJBObject getStatefulSessionEJBObject(Object id)
            throws RemoteException 
      {
  -      return (EJBObject)PortableRemoteObject.narrow(
  -            poa.create_reference_with_id(toByteArray(id), 
  -                                         beanRepositoryIds[0]),
  -            EJBObject.class);
  +      try {
  +         return (EJBObject)PortableRemoteObject.narrow(
  +               poa.create_reference_with_id(toByteArray(id), 
  +                                            beanRepositoryIds[0]),
  +               EJBObject.class);
  +      }
  +      catch (WrongPolicy wrongPolicy) {
  +         throw new ServerException("Wrong POA policy in IIOPContainerInvoker", 
  +                                   wrongPolicy);
  +      }
      }
   
      public EJBObject getEntityEJBObject(Object id)
            throws RemoteException 
      {
  -      return (EJBObject)PortableRemoteObject.narrow(
  -            poa.create_reference_with_id(toByteArray(id), 
  -                                         beanRepositoryIds[0]),
  -            EJBObject.class);
  +      try {
  +         return (EJBObject)PortableRemoteObject.narrow(
  +               poa.create_reference_with_id(toByteArray(id), 
  +                                            beanRepositoryIds[0]),
  +               EJBObject.class);
  +      }
  +      catch (WrongPolicy wrongPolicy) {
  +         throw new ServerException("Wrong POA policy in IIOPContainerInvoker",
  +                                   wrongPolicy);
  +      }
      }
      
      public Collection getEntityCollection(Collection ids)
            throws RemoteException 
      {
  -      ArrayList list = new ArrayList(ids.size());
  -      Iterator idEnum = ids.iterator();
  -      while(idEnum.hasNext()) {
  -         list.add((EJBObject)PortableRemoteObject.narrow(
  -               poa.create_reference_with_id(toByteArray(idEnum.next()), 
  -                                            beanRepositoryIds[0]),
  -               EJBObject.class));
  +      try {
  +         ArrayList list = new ArrayList(ids.size());
  +         Iterator idEnum = ids.iterator();
  +         while(idEnum.hasNext()) {
  +            list.add((EJBObject)PortableRemoteObject.narrow(
  +                  poa.create_reference_with_id(toByteArray(idEnum.next()), 
  +                                               beanRepositoryIds[0]),
  +                  EJBObject.class));
  +         }
  +         return list;
  +      }
  +      catch (WrongPolicy wrongPolicy) {
  +         throw new ServerException("Wrong POA policy in IIOPContainerInvoker",
  +                                   wrongPolicy);
         }
  -      return list;
      }
   
      // Implementation of the interface InvokeHandler ---------------------------
  
  
  

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

Reply via email to