dblevins    2004/04/12 04:31:41

  Modified:    modules/core/src/java/org/openejb ContainerIndex.java
                        EJBContainer.java GenericEJBContainer.java
  Log:

  Still quite a few failures, but minimal remote server functionality is working.
  
  Test results are:
  Tests run: 112,  Failures: 27,  Errors: 6
  
  Couple things causing problems:
   - DatabaseBean can't get a datasource, so no BMP tests run.
   - BeanPolicy$2.invoke throwing "Not yet implemented" is preventing
     nearly all the SFSB tests from running.
   - Still having classloader issues on outbound proxy replacements,
     so many RMI-IIOP tests are failing.
  
  All in all the test suite is doing it's job.
  
  Revision  Changes    Path
  1.6       +4 -2      openejb/modules/core/src/java/org/openejb/ContainerIndex.java
  
  Index: ContainerIndex.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/ContainerIndex.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ContainerIndex.java       9 Apr 2004 19:04:00 -0000       1.5
  +++ ContainerIndex.java       12 Apr 2004 08:31:40 -0000      1.6
  @@ -106,6 +106,7 @@
           Iterator iterator = ejbContainers.iterator();
           for (int i = 1; i < containers.length && iterator.hasNext(); i++) {
               EJBContainer container = (EJBContainer) iterator.next();
  +            container = container.getUnmanagedReference();
               containers[i] = container;
               containerIdToIndex.put(container.getContainerID(), new Integer(i));
               addJNDINames(container, i);
  @@ -135,6 +136,7 @@
       }
   
       public synchronized void addContainer(EJBContainer container) {
  +        container = container.getUnmanagedReference();
           Object containerID = container.getContainerID();
           if(containerIdToIndex.containsKey(containerID)) {
               return;
  @@ -222,7 +224,7 @@
           infoFactory.addOperation("getContainer", new Class[]{Integer.class});
           infoFactory.addOperation("getContainer", new Class[]{Integer.TYPE});
           infoFactory.addOperation("getContainerByJndiName", new 
Class[]{String.class});
  -
  +        
           infoFactory.addReference("EJBContainers", EJBContainer.class);
   
           GBEAN_INFO = infoFactory.getBeanInfo();
  
  
  
  1.4       +4 -1      openejb/modules/core/src/java/org/openejb/EJBContainer.java
  
  Index: EJBContainer.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/EJBContainer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EJBContainer.java 9 Apr 2004 19:04:00 -0000       1.3
  +++ EJBContainer.java 12 Apr 2004 08:31:40 -0000      1.4
  @@ -128,4 +128,7 @@
       EJBProxyFactory getProxyFactory();
   
       ClassLoader getClassLoader();
  +
  +    EJBContainer getUnmanagedReference();
  +    
   }
  
  
  
  1.7       +8 -31     
openejb/modules/core/src/java/org/openejb/GenericEJBContainer.java
  
  Index: GenericEJBContainer.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/GenericEJBContainer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- GenericEJBContainer.java  9 Apr 2004 19:04:00 -0000       1.6
  +++ GenericEJBContainer.java  12 Apr 2004 08:31:40 -0000      1.7
  @@ -85,8 +85,6 @@
       private final Interceptor interceptor;
       private final EJBProxyFactory proxyFactory;
   
  -    private final Map legacyMethodMap;
  -
       private final String[] jndiNames;
       private final String[] localJndiNames;
   
  @@ -129,15 +127,6 @@
           interceptorBuilder.setInstancePool(pool);
           interceptor = interceptorBuilder.buildInterceptorChain();
   
  -        // build the legacy map
  -        Map map = new HashMap();
  -        ProxyInfo proxyInfo = proxyFactory.getProxyInfo();
  -        addLegacyMethods(map, proxyInfo.getHomeInterface(), signatures);
  -        addLegacyMethods(map, proxyInfo.getRemoteInterface(), signatures);
  -        addLegacyMethods(map, proxyInfo.getLocalHomeInterface(), signatures);
  -        addLegacyMethods(map, proxyInfo.getLocalInterface(), signatures);
  -        legacyMethodMap = Collections.unmodifiableMap(map);
  -
           // initialize the user transaction
           if (userTransaction != null) {
               userTransaction.setUp(transactionManager, trackedConnectionAssociator);
  @@ -150,10 +139,7 @@
   
       public Object invoke(Method method, Object[] args, Object primKey) throws 
Throwable {
           EJBInterfaceType invocationType = null;
  -        Integer index = (Integer) legacyMethodMap.get(method);
  -        if (index == null) {
  -            index = new Integer(-1);
  -        }
  +        int index = proxyFactory.getMethodIndex(method);
   
           Class clazz = method.getDeclaringClass();
           if (EJBHome.class.isAssignableFrom(clazz)) {
  @@ -175,7 +161,7 @@
               }
           }
   
  -        EJBInvocationImpl invocation = new EJBInvocationImpl(invocationType, 
primKey, index.intValue(), args);
  +        EJBInvocationImpl invocation = new EJBInvocationImpl(invocationType, 
primKey, index, args);
   
           InvocationResult result = null;
           try {
  @@ -237,20 +223,10 @@
           return proxyFactory;
       }
   
  -    private static void addLegacyMethods(Map legacyMethodMap, Class clazz, 
InterfaceMethodSignature[] signatures) {
  -        if (clazz == null) {
  -            return;
  -        }
  -
  -        for (int i = 0; i < signatures.length; i++) {
  -            InterfaceMethodSignature signature = signatures[i];
  -            Method method = signature.getMethod(clazz);
  -            if (method != null) {
  -                legacyMethodMap.put(method, new Integer(i));
  -            }
  -        }
  +    public EJBContainer getUnmanagedReference(){
  +        return this;
       }
  -
  +    
       private static String[] copyNames(String[] names) {
           if(names == null) {
               return null;
  @@ -284,7 +260,8 @@
   
           infoFactory.addAttribute("EJBHome", false);
           infoFactory.addAttribute("EJBLocalHome", false);
  -
  +        infoFactory.addAttribute("UnmanagedReference", false);
  +        
           GBEAN_INFO = infoFactory.getBeanInfo();
       }
   
  
  
  

Reply via email to