maguro      2005/01/18 16:50:39

  Modified:    modules/core/src/java/org/openejb/corba Adapter.java
                        AdapterEntity.java AdapterStateful.java
                        AdapterStateless.java AdapterWrapper.java
  Log:

  A few CORBA fixes.
  
  Revision  Changes    Path
  1.3       +5 -6      
openejb/modules/core/src/java/org/openejb/corba/Adapter.java
  
  Index: Adapter.java
  ===================================================================
  RCS file: 
/scm/openejb/openejb/modules/core/src/java/org/openejb/corba/Adapter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Adapter.java      13 Jan 2005 17:00:22 -0000      1.2
  +++ Adapter.java      18 Jan 2005 21:50:39 -0000      1.3
  @@ -53,6 +53,7 @@
   import org.omg.CosNaming.NamingContextExtHelper;
   import org.omg.CosNaming.NamingContextHelper;
   import org.omg.CosNaming.NamingContextPackage.NotEmpty;
  +import org.omg.CosNaming.NamingContextPackage.NotFound;
   import org.omg.PortableServer.POA;
   import org.omg.PortableServer.Servant;
   
  @@ -100,13 +101,12 @@
                       nc[0] = nameComponent[j];
                       try {
                           currentContext = 
NamingContextHelper.narrow(currentContext.resolve(nc));
  -                    } catch (org.omg.CosNaming.NamingContextPackage.NotFound 
nf) {
  +                    } catch (NotFound nf) {
                           currentContext = currentContext.bind_new_context(nc);
                       }
                   }
                   nc[0] = nameComponent[lastComponent];
                   currentContext.rebind(nc, homeReference);
  -                initialContext.resolve(nameComponent);
               }
           } catch (Exception e) {
               throw new CORBAException(e);
  @@ -141,9 +141,8 @@
                       System.arraycopy(nameComponent, 0, nc, 0, j);
                       NamingContext currentContext = 
NamingContextHelper.narrow(initialContext.resolve(nc));
                       try {
  -                        initialContext.unbind(nc);
                           currentContext.destroy();
  -                    } catch (NotEmpty nf) {
  +                    } catch (NotEmpty ne) {
                           break;
                       }
                   }
  
  
  
  1.2       +4 -8      
openejb/modules/core/src/java/org/openejb/corba/AdapterEntity.java
  
  Index: AdapterEntity.java
  ===================================================================
  RCS file: 
/scm/openejb/openejb/modules/core/src/java/org/openejb/corba/AdapterEntity.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AdapterEntity.java        13 Jan 2005 17:00:22 -0000      1.1
  +++ AdapterEntity.java        18 Jan 2005 21:50:39 -0000      1.2
  @@ -61,7 +61,6 @@
   import org.omg.PortableServer.ImplicitActivationPolicyValue;
   import org.omg.PortableServer.LifespanPolicyValue;
   import org.omg.PortableServer.POA;
  -import org.omg.PortableServer.POAManagerPackage.AdapterInactive;
   import org.omg.PortableServer.RequestProcessingPolicyValue;
   import org.omg.PortableServer.Servant;
   import org.omg.PortableServer.ServantLocator;
  @@ -111,11 +110,8 @@
       }
   
       public void stop() throws CORBAException {
  -        try {
  -            poa.the_POAManager().deactivate(true, true);
  -        } catch (AdapterInactive e) {
  -            throw new CORBAException(e);
  -        }
  +        super.stop();
  +        poa.destroy(true, true);
       }
   
       public org.omg.CORBA.Object genObjectReference(ProxyInfo proxyInfo) 
throws CORBAException {
  
  
  
  1.2       +4 -8      
openejb/modules/core/src/java/org/openejb/corba/AdapterStateful.java
  
  Index: AdapterStateful.java
  ===================================================================
  RCS file: 
/scm/openejb/openejb/modules/core/src/java/org/openejb/corba/AdapterStateful.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AdapterStateful.java      13 Jan 2005 17:00:22 -0000      1.1
  +++ AdapterStateful.java      18 Jan 2005 21:50:39 -0000      1.2
  @@ -61,7 +61,6 @@
   import org.omg.PortableServer.ImplicitActivationPolicyValue;
   import org.omg.PortableServer.LifespanPolicyValue;
   import org.omg.PortableServer.POA;
  -import org.omg.PortableServer.POAManagerPackage.AdapterInactive;
   import org.omg.PortableServer.RequestProcessingPolicyValue;
   import org.omg.PortableServer.Servant;
   import org.omg.PortableServer.ServantLocator;
  @@ -111,11 +110,8 @@
       }
   
       public void stop() throws CORBAException {
  -        try {
  -            poa.the_POAManager().deactivate(true, true);
  -        } catch (AdapterInactive e) {
  -            throw new CORBAException(e);
  -        }
  +        super.stop();
  +        poa.destroy(true, true);
       }
   
       public org.omg.CORBA.Object genObjectReference(ProxyInfo proxyInfo) 
throws CORBAException {
  
  
  
  1.2       +14 -8     
openejb/modules/core/src/java/org/openejb/corba/AdapterStateless.java
  
  Index: AdapterStateless.java
  ===================================================================
  RCS file: 
/scm/openejb/openejb/modules/core/src/java/org/openejb/corba/AdapterStateless.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AdapterStateless.java     13 Jan 2005 17:00:22 -0000      1.1
  +++ AdapterStateless.java     18 Jan 2005 21:50:39 -0000      1.2
  @@ -53,7 +53,8 @@
   import org.omg.PortableServer.ImplicitActivationPolicyValue;
   import org.omg.PortableServer.LifespanPolicyValue;
   import org.omg.PortableServer.POA;
  -import org.omg.PortableServer.POAManagerPackage.AdapterInactive;
  +import org.omg.PortableServer.POAPackage.ObjectNotActive;
  +import org.omg.PortableServer.POAPackage.WrongPolicy;
   import org.omg.PortableServer.RequestProcessingPolicyValue;
   import org.omg.PortableServer.Servant;
   import org.omg.PortableServer.ServantRetentionPolicyValue;
  @@ -68,8 +69,9 @@
    */
   public final class AdapterStateless extends Adapter {
   
  -    private POA poa;
  -    private org.omg.CORBA.Object objectReference;
  +    private final POA poa;
  +    private final byte[] object_id;
  +    private final org.omg.CORBA.Object objectReference;
   
       public AdapterStateless(EJBContainer container, ORB orb, POA parentPOA, 
TieLoader tieLoader) throws CORBAException {
           super(container, orb, parentPOA, tieLoader);
  @@ -92,7 +94,7 @@
                   ((Tie) servant).setTarget(obj);
               }
   
  -            
poa.activate_object_with_id(container.getContainerID().toString().getBytes(), 
servant);
  +            poa.activate_object_with_id(object_id = 
container.getContainerID().toString().getBytes(), servant);
               objectReference = poa.servant_to_reference(servant);
           } catch (Exception e) {
               throw new CORBAException(e);
  @@ -101,8 +103,12 @@
   
       public void stop() throws CORBAException {
           try {
  -            poa.the_POAManager().deactivate(true, true);
  -        } catch (AdapterInactive e) {
  +            super.stop();
  +            poa.deactivate_object(object_id);
  +            poa.destroy(true, true);
  +        } catch (ObjectNotActive e) {
  +            throw new CORBAException(e);
  +        } catch (WrongPolicy e) {
               throw new CORBAException(e);
           }
       }
  
  
  
  1.2       +2 -3      
openejb/modules/core/src/java/org/openejb/corba/AdapterWrapper.java
  
  Index: AdapterWrapper.java
  ===================================================================
  RCS file: 
/scm/openejb/openejb/modules/core/src/java/org/openejb/corba/AdapterWrapper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AdapterWrapper.java       13 Jan 2005 17:00:22 -0000      1.1
  +++ AdapterWrapper.java       18 Jan 2005 21:50:39 -0000      1.2
  @@ -94,7 +94,6 @@
       public void stop() throws CORBAException {
           generator.stop();
           adapters.remove(container.getContainerID());
  -
       }
   
       public static RefGenerator getRefGenerator(String containerId) {
  
  
  

Reply via email to