djencks     2005/03/15 00:32:40

  Modified:    modules/itests/src/java/org/openejb/test/interop/slsb
                        Interop.java InteropBean.java
  Log:

  Make transaction policy mapping more generic and implement the 
no-distributed-transactions corba tx propagation polices.  CORBA operation name 
to method signature mapping is not yet really implemented
  
  Revision  Changes    Path
  1.3       +8 -7      
openejb/modules/itests/src/java/org/openejb/test/interop/slsb/Interop.java
  
  Index: Interop.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/itests/src/java/org/openejb/test/interop/slsb/Interop.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Interop.java      14 Mar 2005 02:12:46 -0000      1.2
  +++ Interop.java      15 Mar 2005 05:32:40 -0000      1.3
  @@ -53,14 +53,15 @@
    */
   public interface Interop extends EJBObject {
   
  -    public String callNoAccess(String argument1) throws RemoteException;
  +    String callNoAccess(String argument1) throws RemoteException;
   
  -    public String callLowAccess(String argument1) throws RemoteException;
  +    String callLowAccess(String argument1) throws RemoteException;
   
  -    public String callMedAccess(String argument1) throws RemoteException;
  +    String callMedAccess(String argument1) throws RemoteException;
   
  -    public String callHighAccess(String argument1) throws RemoteException;
  +    String callHighAccess(String argument1) throws RemoteException;
   
  -    public String callAllAccess(String argument1) throws RemoteException;
  +    String callAllAccess(String argument1) throws RemoteException;
   
  +    String callAllAccessTx(String argument1) throws RemoteException;
   }
  
  
  
  1.6       +37 -2     
openejb/modules/itests/src/java/org/openejb/test/interop/slsb/InteropBean.java
  
  Index: InteropBean.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/itests/src/java/org/openejb/test/interop/slsb/InteropBean.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- InteropBean.java  14 Mar 2005 02:12:46 -0000      1.5
  +++ InteropBean.java  15 Mar 2005 05:32:40 -0000      1.6
  @@ -138,10 +138,45 @@
   
               return bean.allAccessMethod(argument1);
           } catch (NamingException e) {
  +            e.printStackTrace();
               throw new RemoteException("Unable to lookup 
java:comp/env/ejb/interop/InteropBean", e);
           } catch (CreateException e) {
  +            e.printStackTrace();
               throw new RemoteException("Unable to create BasicStateless EJB", 
e);
  +        } catch (Throwable t) {
  +            t.printStackTrace();
  +            throw new RemoteException("Throwable", t);
           }
  +
  +    }
  +
  +     public String callAllAccessTx(String argument1) throws RemoteException {
  +        try {
  +            InitialContext ic = new InitialContext();
  +            Object ref = ic.lookup("java:comp/env/ejb/interop/InteropBean");
  +
  +            BasicStatelessHome home = (BasicStatelessHome) 
PortableRemoteObject.narrow(ref, BasicStatelessHome.class);
  +            BasicStateless bean = home.create();
  +
  +            bean.allAccessMethod(argument1);
  +
  +        } catch (NamingException e) {
  +            e.printStackTrace();
  +            throw new RemoteException("Unable to lookup 
java:comp/env/ejb/interop/InteropBean", e);
  +        } catch (CreateException e) {
  +            e.printStackTrace();
  +            throw new RemoteException("Unable to create BasicStateless EJB", 
e);
  +        } catch (RemoteException e) {
  +            //expected
  +            System.out.println("SUCCESS, got RemoteException: ");
  +            e.printStackTrace();
  +            return "SUCCESS";
  +        } catch (Throwable t) {
  +            t.printStackTrace();
  +            throw new RemoteException("Throwable", t);
  +        }
  +         throw new RemoteException("NO EXCEPTION THROWN");
  +
       }
   
       public boolean isInRole(String roleName) {
  
  
  

Reply via email to