dain        2006/02/01 06:50:04

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

  Major refactor
  Split container into an object to represent a deployed ejb and a set of 
shared containers which process invocations
  Introduced interface between CMP container and CMP engine
  
  Revision  Changes    Path
  1.14      +14 -14    
openejb/modules/core/src/java/org/openejb/corba/Adapter.java
  
  Index: Adapter.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/Adapter.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Adapter.java      5 Dec 2005 21:31:12 -0000       1.13
  +++ Adapter.java      1 Feb 2006 11:50:03 -0000       1.14
  @@ -59,7 +59,7 @@
   import org.omg.PortableServer.POA;
   import org.omg.PortableServer.RequestProcessingPolicyValue;
   import org.omg.PortableServer.ServantRetentionPolicyValue;
  -import org.openejb.EJBContainer;
  +import org.openejb.RpcEjbDeployment;
   import org.openejb.EJBInterfaceType;
   import org.openejb.corba.transaction.ServerTransactionPolicyFactory;
   import org.openejb.proxy.ProxyInfo;
  @@ -68,20 +68,20 @@
    * @version $Revision$ $Date$
    */
   public abstract class Adapter implements RefGenerator {
  -    private final EJBContainer container;
  +    private final RpcEjbDeployment deployment;
       protected final POA homePOA;
       protected final ORB orb;
       private final NamingContextExt initialContext;
       private final byte[] home_id;
       private final org.omg.CORBA.Object homeReference;
   
  -    protected Adapter(EJBContainer container, ORB orb, POA parentPOA, Policy 
securityPolicy) throws CORBAException {
  -        this.container = container;
  -        this.home_id = container.getContainerID().toString().getBytes();
  +    protected Adapter(RpcEjbDeployment deployment, ORB orb, POA parentPOA, 
Policy securityPolicy) throws CORBAException {
  +        this.deployment = deployment;
  +        this.home_id = deployment.getContainerId().toString().getBytes();
           this.orb = orb;
   
           Any any = orb.create_any();
  -        any.insert_Value(container.getHomeTxPolicyConfig());
  +        any.insert_Value(deployment.getHomeTxPolicyConfig());
   
           try {
               Policy[] policies = new Policy[]{
  @@ -93,18 +93,18 @@
                   
parentPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID),
                   
parentPOA.create_implicit_activation_policy(ImplicitActivationPolicyValue.NO_IMPLICIT_ACTIVATION),
               };
  -            homePOA = 
parentPOA.create_POA(container.getContainerID().toString(), 
parentPOA.the_POAManager(), policies);
  +            homePOA = 
parentPOA.create_POA(deployment.getContainerId().toString(), 
parentPOA.the_POAManager(), policies);
   
               homePOA.the_POAManager().activate();
   
  -            StandardServant servant = new StandardServant(orb, 
EJBInterfaceType.HOME, container);
  +            StandardServant servant = new StandardServant(orb, 
EJBInterfaceType.HOME, deployment);
   
               homePOA.activate_object_with_id(home_id, servant);
               homeReference = homePOA.servant_to_reference(servant);
   
               org.omg.CORBA.Object obj = 
orb.resolve_initial_references("NameService");
               initialContext = NamingContextExtHelper.narrow(obj);
  -            String[] names = container.getJndiNames();
  +            String[] names = deployment.getJndiNames();
               for (int i = 0; i < names.length; i++) {
                   NameComponent[] nameComponent = 
initialContext.to_name(names[i]);
                   NamingContext currentContext = initialContext;
  @@ -127,8 +127,8 @@
   
       }
   
  -    public EJBContainer getContainer() {
  -        return container;
  +    public RpcEjbDeployment getDeployment() {
  +        return deployment;
       }
   
       public NamingContextExt getInitialContext() {
  @@ -145,7 +145,7 @@
   
       public void stop() throws CORBAException {
           try {
  -            String[] names = container.getJndiNames();
  +            String[] names = deployment.getJndiNames();
               for (int i = 0; i < names.length; i++) {
                   NameComponent[] nameComponent = 
initialContext.to_name(names[i]);
                   initialContext.unbind(nameComponent);
  
  
  
  1.14      +10 -10    
openejb/modules/core/src/java/org/openejb/corba/AdapterEntity.java
  
  Index: AdapterEntity.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/AdapterEntity.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AdapterEntity.java        5 Dec 2005 21:31:12 -0000       1.13
  +++ AdapterEntity.java        1 Feb 2006 11:50:03 -0000       1.14
  @@ -65,7 +65,7 @@
   import org.omg.PortableServer.ServantLocator;
   import org.omg.PortableServer.ServantLocatorPackage.CookieHolder;
   import org.omg.PortableServer.ServantRetentionPolicyValue;
  -import org.openejb.EJBContainer;
  +import org.openejb.RpcEjbDeployment;
   import org.openejb.EJBInterfaceType;
   import org.openejb.corba.transaction.ServerTransactionPolicyFactory;
   import org.openejb.proxy.ProxyInfo;
  @@ -80,11 +80,11 @@
       private final POA poa;
       private final String referenceInterface;
   
  -    public AdapterEntity(EJBContainer container, ORB orb, POA parentPOA, 
Policy securityPolicy) throws CORBAException {
  -        super(container, orb, parentPOA, securityPolicy);
  +    public AdapterEntity(RpcEjbDeployment deployment, ORB orb, POA 
parentPOA, Policy securityPolicy) throws CORBAException {
  +        super(deployment, orb, parentPOA, securityPolicy);
   
           Any any = orb.create_any();
  -        any.insert_Value(container.getRemoteTxPolicyConfig());
  +        any.insert_Value(deployment.getRemoteTxPolicyConfig());
   
           try {
               Policy[] policies = new Policy[]{
  @@ -96,12 +96,12 @@
                   
homePOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID),
                   
homePOA.create_implicit_activation_policy(ImplicitActivationPolicyValue.NO_IMPLICIT_ACTIVATION),
               };
  -            poa = homePOA.create_POA(container.getContainerID().toString(), 
homePOA.the_POAManager(), policies);
  +            poa = homePOA.create_POA(deployment.getContainerId().toString(), 
homePOA.the_POAManager(), policies);
               poa.set_servant_manager(new ObjectActivator());
   
               poa.the_POAManager().activate();
   
  -            StandardServant servant = new StandardServant(orb, 
EJBInterfaceType.REMOTE, container);
  +            StandardServant servant = new StandardServant(orb, 
EJBInterfaceType.REMOTE, deployment);
               referenceInterface = servant._all_interfaces(null, null)[0];
           } catch (Exception e) {
               throw new CORBAException(e);
  @@ -146,8 +146,8 @@
                   pk = is.readObject();
                   is.close();
   
  -                EJBContainer container = getContainer();
  -                StandardServant servant = new StandardServant(getOrb(), 
EJBInterfaceType.REMOTE, container, pk);
  +                RpcEjbDeployment deployment = getDeployment();
  +                StandardServant servant = new StandardServant(getOrb(), 
EJBInterfaceType.REMOTE, deployment, pk);
                   return servant;
               } catch (IOException e) {
                   // if we can't deserialize, then this object can't exist in 
this process
  
  
  
  1.14      +10 -10    
openejb/modules/core/src/java/org/openejb/corba/AdapterStateful.java
  
  Index: AdapterStateful.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/AdapterStateful.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AdapterStateful.java      5 Dec 2005 21:31:12 -0000       1.13
  +++ AdapterStateful.java      1 Feb 2006 11:50:03 -0000       1.14
  @@ -66,7 +66,7 @@
   import org.omg.PortableServer.ServantLocator;
   import org.omg.PortableServer.ServantLocatorPackage.CookieHolder;
   import org.omg.PortableServer.ServantRetentionPolicyValue;
  -import org.openejb.EJBContainer;
  +import org.openejb.RpcEjbDeployment;
   import org.openejb.EJBInterfaceType;
   import org.openejb.corba.transaction.ServerTransactionPolicyFactory;
   import org.openejb.proxy.ProxyInfo;
  @@ -80,11 +80,11 @@
       private final POA poa;
       private final String referenceInterface;
   
  -    public AdapterStateful(EJBContainer container, ORB orb, POA parentPOA, 
Policy securityPolicy) throws CORBAException {
  -        super(container, orb, parentPOA, securityPolicy);
  +    public AdapterStateful(RpcEjbDeployment deployment, ORB orb, POA 
parentPOA, Policy securityPolicy) throws CORBAException {
  +        super(deployment, orb, parentPOA, securityPolicy);
   
           Any any = orb.create_any();
  -        any.insert_Value(container.getRemoteTxPolicyConfig());
  +        any.insert_Value(deployment.getRemoteTxPolicyConfig());
   
           try {
               Policy[] policies = new Policy[]{
  @@ -96,12 +96,12 @@
                   
homePOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID),
                   
homePOA.create_implicit_activation_policy(ImplicitActivationPolicyValue.NO_IMPLICIT_ACTIVATION),
               };
  -            poa = homePOA.create_POA(container.getContainerID().toString(), 
homePOA.the_POAManager(), policies);
  +            poa = homePOA.create_POA(deployment.getContainerId().toString(), 
homePOA.the_POAManager(), policies);
               poa.set_servant_manager(new ObjectActivator());
   
               poa.the_POAManager().activate();
   
  -            StandardServant servant = new StandardServant(orb, 
EJBInterfaceType.REMOTE, container);
  +            StandardServant servant = new StandardServant(orb, 
EJBInterfaceType.REMOTE, deployment);
               referenceInterface = servant._all_interfaces(null, null)[0];
           } catch (Exception e) {
               throw new CORBAException(e);
  @@ -146,8 +146,8 @@
                   pk = is.readObject();
                   is.close();
   
  -                EJBContainer container = getContainer();
  -                StandardServant servant = new StandardServant(getOrb(), 
EJBInterfaceType.REMOTE, container, pk);
  +                RpcEjbDeployment deployment = getDeployment();
  +                StandardServant servant = new StandardServant(getOrb(), 
EJBInterfaceType.REMOTE, deployment, pk);
                   return servant;
               } catch (IOException e) {
                   // if we can't deserialize, then this object can't exist in 
this process
  
  
  
  1.14      +9 -9      
openejb/modules/core/src/java/org/openejb/corba/AdapterStateless.java
  
  Index: AdapterStateless.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/AdapterStateless.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AdapterStateless.java     5 Dec 2005 21:31:12 -0000       1.13
  +++ AdapterStateless.java     1 Feb 2006 11:50:03 -0000       1.14
  @@ -54,7 +54,7 @@
   import org.omg.PortableServer.POAPackage.WrongPolicy;
   import org.omg.PortableServer.RequestProcessingPolicyValue;
   import org.omg.PortableServer.ServantRetentionPolicyValue;
  -import org.openejb.EJBContainer;
  +import org.openejb.RpcEjbDeployment;
   import org.openejb.EJBInterfaceType;
   import org.openejb.corba.transaction.ServerTransactionPolicyFactory;
   import org.openejb.proxy.ProxyInfo;
  @@ -67,10 +67,10 @@
       private final byte[] object_id;
       private final org.omg.CORBA.Object objectReference;
   
  -    public AdapterStateless(EJBContainer container, ORB orb, POA parentPOA, 
Policy securityPolicy) throws CORBAException {
  -        super(container, orb, parentPOA, securityPolicy);
  +    public AdapterStateless(RpcEjbDeployment deployment, ORB orb, POA 
parentPOA, Policy securityPolicy) throws CORBAException {
  +        super(deployment, orb, parentPOA, securityPolicy);
           Any any = orb.create_any();
  -        any.insert_Value(container.getRemoteTxPolicyConfig());
  +        any.insert_Value(deployment.getRemoteTxPolicyConfig());
   
           try {
               Policy[] policies = new Policy[]{
  @@ -82,13 +82,13 @@
                   
homePOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID),
                   
homePOA.create_implicit_activation_policy(ImplicitActivationPolicyValue.NO_IMPLICIT_ACTIVATION),
               };
  -            poa = homePOA.create_POA(container.getContainerID().toString(), 
homePOA.the_POAManager(), policies);
  +            poa = homePOA.create_POA(deployment.getContainerId().toString(), 
homePOA.the_POAManager(), policies);
   
               poa.the_POAManager().activate();
   
  -            StandardServant servant = new StandardServant(orb, 
EJBInterfaceType.REMOTE, container);
  +            StandardServant servant = new StandardServant(orb, 
EJBInterfaceType.REMOTE, deployment);
   
  -            poa.activate_object_with_id(object_id = 
container.getContainerID().toString().getBytes(), servant);
  +            poa.activate_object_with_id(object_id = 
deployment.getContainerId().toString().getBytes(), servant);
               objectReference = poa.servant_to_reference(servant);
           } catch (Exception e) {
               e.printStackTrace();
  
  
  
  1.5       +15 -15    
openejb/modules/core/src/java/org/openejb/corba/AdapterWrapper.java
  
  Index: AdapterWrapper.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/AdapterWrapper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AdapterWrapper.java       13 Jul 2005 20:49:28 -0000      1.4
  +++ AdapterWrapper.java       1 Feb 2006 11:50:03 -0000       1.5
  @@ -51,48 +51,48 @@
   import org.omg.CORBA.Policy;
   import org.omg.CosNaming.NamingContextExt;
   import org.omg.PortableServer.POA;
  -
   import org.openejb.EJBComponentType;
  -import org.openejb.EJBContainer;
  +import org.openejb.EjbDeployment;
  +import org.openejb.RpcEjbDeployment;
   
   /**
    * @version $Revision$ $Date$
    */
   public final class AdapterWrapper {
       private final static Map adapters = new HashMap();
  -    private final EJBContainer container;
  +    private final RpcEjbDeployment deployment;
       private Adapter generator;
   
  -    public AdapterWrapper(EJBContainer container) {
  -        this.container = container;
  +    public AdapterWrapper(RpcEjbDeployment deployment) {
  +        this.deployment = deployment;
   
       }
   
  -    public EJBContainer getContainer() {
  -        return container;
  +    public EjbDeployment getDeployment() {
  +        return deployment;
       }
   
       public void start(ORB orb, POA poa, NamingContextExt initialContext, 
Policy securityPolicy) throws CORBAException {
  -        switch (container.getProxyInfo().getComponentType()) {
  +        switch (deployment.getProxyInfo().getComponentType()) {
               case EJBComponentType.STATELESS:
  -                generator = new AdapterStateless(container, orb, poa, 
securityPolicy);
  +                generator = new AdapterStateless(deployment, orb, poa, 
securityPolicy);
                   break;
               case EJBComponentType.STATEFUL:
  -                generator = new AdapterStateful(container, orb, poa, 
securityPolicy);
  +                generator = new AdapterStateful(deployment, orb, poa, 
securityPolicy);
                   break;
               case EJBComponentType.BMP_ENTITY:
               case EJBComponentType.CMP_ENTITY:
  -                generator = new AdapterEntity(container, orb, poa, 
securityPolicy);
  +                generator = new AdapterEntity(deployment, orb, poa, 
securityPolicy);
                   break;
               default:
                   throw new CORBAException("CORBA Adapter does not handle MDB 
containers");
           }
  -        adapters.put(container.getContainerID(), generator);
  +        adapters.put(deployment.getContainerId(), generator);
       }
   
       public void stop() throws CORBAException {
           generator.stop();
  -        adapters.remove(container.getContainerID());
  +        adapters.remove(deployment.getContainerId());
       }
   
       public static RefGenerator getRefGenerator(String containerId) {
  
  
  
  1.14      +31 -31    
openejb/modules/core/src/java/org/openejb/corba/StandardServant.java
  
  Index: StandardServant.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/StandardServant.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- StandardServant.java      5 Dec 2005 21:31:12 -0000       1.13
  +++ StandardServant.java      1 Feb 2006 11:50:03 -0000       1.14
  @@ -82,10 +82,10 @@
   import org.omg.CORBA.portable.ResponseHandler;
   import org.omg.CORBA.portable.UnknownException;
   import org.omg.PortableServer.Servant;
  -import org.openejb.EJBContainer;
  +import org.openejb.RpcEjbDeployment;
   import org.openejb.EJBInterfaceType;
  -import org.openejb.EJBInvocation;
  -import org.openejb.EJBInvocationImpl;
  +import org.openejb.EjbInvocation;
  +import org.openejb.EjbInvocationImpl;
   import org.openejb.corba.util.Util;
   
   /**
  @@ -106,27 +106,27 @@
   
   
       private final EJBInterfaceType ejbInterfaceType;
  -    private final EJBContainer ejbContainer;
  +    private final RpcEjbDeployment ejbDeploymentContext;
       private final Object primaryKey;
       private final String[] typeIds;
       private final Map operations;
       private final Context enc;
   
  -    public StandardServant(ORB orb, EJBInterfaceType ejbInterfaceType, 
EJBContainer ejbContainer) {
  -        this(orb, ejbInterfaceType, ejbContainer, null);
  +    public StandardServant(ORB orb, EJBInterfaceType ejbInterfaceType, 
RpcEjbDeployment ejbDeploymentContext) {
  +        this(orb, ejbInterfaceType, ejbDeploymentContext, null);
       }
   
  -    public StandardServant(ORB orb, EJBInterfaceType ejbInterfaceType, 
EJBContainer ejbContainer, Object primaryKey) {
  +    public StandardServant(ORB orb, EJBInterfaceType ejbInterfaceType, 
RpcEjbDeployment ejbDeploymentContext, Object primaryKey) {
           this.ejbInterfaceType = ejbInterfaceType;
  -        this.ejbContainer = ejbContainer;
  +        this.ejbDeploymentContext = ejbDeploymentContext;
           this.primaryKey = primaryKey;
   
           // get the interface class
           Class type;
           if (EJBInterfaceType.HOME == ejbInterfaceType) {
  -            type = ejbContainer.getProxyInfo().getHomeInterface();
  +            type = ejbDeploymentContext.getProxyInfo().getHomeInterface();
           } else if (EJBInterfaceType.REMOTE == ejbInterfaceType) {
  -            type = ejbContainer.getProxyInfo().getRemoteInterface();
  +            type = ejbDeploymentContext.getProxyInfo().getRemoteInterface();
           } else {
               throw new IllegalArgumentException("Only home and remote 
interfaces are supported in this servant: " + ejbInterfaceType);
           }
  @@ -152,8 +152,8 @@
           return ejbInterfaceType;
       }
   
  -    public EJBContainer getEjbContainer() {
  -        return ejbContainer;
  +    public RpcEjbDeployment getEjbContainer() {
  +        return ejbDeploymentContext;
       }
   
       public Object getPrimaryKey() {
  @@ -167,7 +167,7 @@
       public OutputStream _invoke(String operationName, InputStream _in, 
ResponseHandler reply) throws SystemException {
           // get the method object
           Method method = (Method) operations.get(operationName);
  -        int index = ejbContainer.getMethodIndex(method);
  +        int index = ejbDeploymentContext.getMethodIndex(method);
           if (index < 0 &&
                   method.getDeclaringClass() != javax.ejb.EJBObject.class &&
                   method.getDeclaringClass() != javax.ejb.EJBHome.class) {
  @@ -179,7 +179,7 @@
           ClassLoader oldClassLoader = 
Thread.currentThread().getContextClassLoader();
           Context oldContext = RootContext.getComponentContext();
           try {
  -            
Thread.currentThread().setContextClassLoader(ejbContainer.getClassLoader());
  +            
Thread.currentThread().setContextClassLoader(ejbDeploymentContext.getClassLoader());
               RootContext.setComponentContext(enc);
   
               // read in all of the arguments
  @@ -198,18 +198,18 @@
   
                   if (method.getDeclaringClass() == javax.ejb.EJBObject.class) 
{
                       if (method.equals(GETHANDLE)) {
  -                        result = 
ejbContainer.getEjbObject(primaryKey).getHandle();
  +                        result = 
ejbDeploymentContext.getEjbObject(primaryKey).getHandle();
                       } else if (method.equals(GETPRIMARYKEY)) {
  -                        result = 
ejbContainer.getEjbObject(primaryKey).getPrimaryKey();
  +                        result = 
ejbDeploymentContext.getEjbObject(primaryKey).getPrimaryKey();
                       } else if (method.equals(ISIDENTICAL)) {
                           org.omg.CORBA.Object thisObject = 
this._this_object();
                           org.omg.CORBA.Object otherObject = 
(org.omg.CORBA.Object)arguments[0];
                           result = new 
Boolean(thisObject._is_equivalent(otherObject));
                       } else if (method.equals(GETEJBHOME)) {
  -                        result = ejbContainer.getEjbHome();
  +                        result = ejbDeploymentContext.getEjbHome();
                       } else if (method.equals(REMOVE)) {
                           try {
  -                            ejbContainer.getEjbObject(primaryKey).remove();
  +                            
ejbDeploymentContext.getEjbObject(primaryKey).remove();
                               result = null;
                           } catch (RemoveException e) {
                               return Util.writeUserException(method, reply, e);
  @@ -219,26 +219,26 @@
                       }
                   } else if (method.getDeclaringClass() == 
javax.ejb.EJBHome.class) {
                      if (method.equals(GETEJBMETADATA)) {
  -                        result = ejbContainer.getEjbHome().getEJBMetaData();
  +                        result = 
ejbDeploymentContext.getEjbHome().getEJBMetaData();
                       } else if (method.equals(GETHOMEHANDLE)) {
  -                        result = ejbContainer.getEjbHome().getHomeHandle();
  +                        result = 
ejbDeploymentContext.getEjbHome().getHomeHandle();
                       } else if (method.equals(REMOVE_W_HAND)) {
                           CORBAHandle handle = (CORBAHandle) arguments[0];
                           try {
  -                            if 
(ejbContainer.getProxyInfo().isStatelessSessionBean()) {
  +                            if 
(ejbDeploymentContext.getProxyInfo().isStatelessSessionBean()) {
                                   if (handle == null) {
                                       throw new RemoveException("Handle is 
null");
                                   }
  -                                Class remoteInterface = 
ejbContainer.getProxyInfo().getRemoteInterface();
  +                                Class remoteInterface = 
ejbDeploymentContext.getProxyInfo().getRemoteInterface();
                                   if 
(!remoteInterface.isInstance(handle.getEJBObject())) {
                                       throw new RemoteException("Handle does 
not hold a " + remoteInterface.getName());
                                   }
                               } else {
                                   // create the invocation object
  -                                EJBInvocation invocation = new 
EJBInvocationImpl(ejbInterfaceType, handle.getPrimaryKey(), index, arguments);
  +                                EjbInvocation invocation = new 
EjbInvocationImpl(ejbInterfaceType, handle.getPrimaryKey(), index, arguments);
   
                                   // invoke the container
  -                                InvocationResult invocationResult = 
ejbContainer.invoke(invocation);
  +                                InvocationResult invocationResult = 
ejbDeploymentContext.invoke(invocation);
   
                                   // process the result
                                   if (invocationResult.isException()) {
  @@ -258,7 +258,7 @@
                           result = null;
                       } else if (method.equals(REMOVE_W_KEY)) {
                           try {
  -                            ejbContainer.getEjbHome().remove(arguments[0]);
  +                            
ejbDeploymentContext.getEjbHome().remove(arguments[0]);
                               result = null;
                           } catch (RemoveException e) {
                               return Util.writeUserException(method, reply, e);
  @@ -268,10 +268,10 @@
                       }
                   } else {
                       // create the invocation object
  -                    EJBInvocation invocation = new 
EJBInvocationImpl(ejbInterfaceType, primaryKey, index, arguments);
  +                    EjbInvocation invocation = new 
EjbInvocationImpl(ejbInterfaceType, primaryKey, index, arguments);
   
                       // invoke the container
  -                    InvocationResult invocationResult = 
ejbContainer.invoke(invocation);
  +                    InvocationResult invocationResult = 
ejbDeploymentContext.invoke(invocation);
   
                       // process the result
                       if (invocationResult.isException()) {
  @@ -305,11 +305,11 @@
                   throw new UnknownException(e);
               } catch (RuntimeException e) {
                   log.debug("RuntimeException", e);
  -                RemoteException remoteException = new 
RemoteException(e.getClass().getName() + " thrown from " + 
ejbContainer.getContainerID() + ": " + e.getMessage());
  +                RemoteException remoteException = new 
RemoteException(e.getClass().getName() + " thrown from " + 
ejbDeploymentContext.getContainerId() + ": " + e.getMessage());
                   throw new UnknownException(remoteException);
               } catch (Error e) {
                   log.debug("Error", e);
  -                RemoteException remoteException = new 
RemoteException(e.getClass().getName() + " thrown from " + 
ejbContainer.getContainerID() + ": " + e.getMessage());
  +                RemoteException remoteException = new 
RemoteException(e.getClass().getName() + " thrown from " + 
ejbDeploymentContext.getContainerId() + ": " + e.getMessage());
                   throw new UnknownException(remoteException);
               } catch (Throwable e) {
                   log.warn("Unexpected throwable", e);
  
  
  
  1.15      +12 -12    
openejb/modules/core/src/java/org/openejb/corba/TSSBean.java
  
  Index: TSSBean.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/TSSBean.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TSSBean.java      4 Dec 2005 02:37:53 -0000       1.14
  +++ TSSBean.java      1 Feb 2006 11:50:03 -0000       1.15
  @@ -65,7 +65,7 @@
   import org.omg.PortableServer.POAManagerPackage.AdapterInactive;
   import org.omg.PortableServer.RequestProcessingPolicyValue;
   import org.omg.PortableServer.ServantRetentionPolicyValue;
  -import org.openejb.EJBContainer;
  +import org.openejb.RpcEjbDeployment;
   import org.openejb.corba.security.ServerPolicy;
   import org.openejb.corba.security.ServerPolicyFactory;
   import org.openejb.corba.security.config.tss.TSSConfig;
  @@ -193,23 +193,23 @@
           return config;
       }
   
  -    public void registerContainer(EJBContainer container) throws 
CORBAException {
  +    public void registerContainer(RpcEjbDeployment container) throws 
CORBAException {
           AdapterWrapper adapterWrapper = new AdapterWrapper(container);
   
           adapterWrapper.start(server.getORB(), localPOA, initialContext, 
securityPolicy);
  -        adapters.put(container.getContainerID(), adapterWrapper);
  +        adapters.put(container.getContainerId(), adapterWrapper);
   
  -        log.debug(POAName + " - Linked container " + 
container.getContainerID());
  +        log.debug(POAName + " - Linked container " + 
container.getContainerId());
       }
   
  -    public void unregisterContainer(EJBContainer container) {
  -        AdapterWrapper adapterWrapper = (AdapterWrapper) 
adapters.remove(container.getContainerID());
  +    public void unregisterContainer(RpcEjbDeployment container) {
  +        AdapterWrapper adapterWrapper = (AdapterWrapper) 
adapters.remove(container.getContainerId());
           if (adapterWrapper != null) {
               try {
                   adapterWrapper.stop();
  -                log.debug(POAName + " - Unlinked container " + 
container.getContainerID());
  +                log.debug(POAName + " - Unlinked container " + 
container.getContainerId());
               } catch (CORBAException e) {
  -                log.error(POAName + " - Error unlinking container " + 
container.getContainerID(), e);
  +                log.error(POAName + " - Error unlinking container " + 
container.getContainerId(), e);
               }
           }
       }
  @@ -223,8 +223,8 @@
           infoFactory.addAttribute("POAName", String.class, true);
           infoFactory.addReference("Server", CORBABean.class, 
NameFactory.CORBA_SERVICE);
           infoFactory.addAttribute("tssConfig", TSSConfig.class, true);
  -        infoFactory.addOperation("registerContainer", new Class[] 
{EJBContainer.class});
  -        infoFactory.addOperation("unregisterContainer", new Class[] 
{EJBContainer.class});
  +        infoFactory.addOperation("registerContainer", new Class[] 
{RpcEjbDeployment.class});
  +        infoFactory.addOperation("unregisterContainer", new Class[] 
{RpcEjbDeployment.class});
           infoFactory.setConstructor(new String[]{"classLoader", "POAName", 
"Server"});
   
           GBEAN_INFO = infoFactory.getBeanInfo();
  
  
  

Reply via email to