geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r442665 [2/4] - in /geronimo/server/branches/sachin: ./ applications/magicGball/magicGball-ear/src/main/plan/ assemblies/geronimo-boilerplate-minimal/ configs/axis-deployer/src/plan/ configs/client-deployer/src/plan/ configs/client/ configs...
Date Tue, 12 Sep 2006 18:15:29 GMT
Modified: geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Tue Sep 12 11:15:24 2006
@@ -78,7 +78,7 @@
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
-import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
+import org.apache.geronimo.j2ee.deployment.ActivationSpecInfoLocator;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
@@ -119,7 +119,7 @@
 /**
  * @version $Rev:385659 $ $Date$
  */
-public class ConnectorModuleBuilder implements ModuleBuilder, ResourceReferenceBuilder {
+public class ConnectorModuleBuilder implements ModuleBuilder, ActivationSpecInfoLocator {
     private static QName CONNECTOR_QNAME = GerConnectorDocument.type.getDocumentElementName();
     static final String GERCONNECTOR_NAMESPACE = CONNECTOR_QNAME.getNamespaceURI();
 
@@ -416,7 +416,7 @@
                 resourceAdapterInstanceGBeanData.setReferencePattern("WorkManager", workManagerName);
 
                 // set the xa terminator name which is the same as our transaction manager
-                resourceAdapterInstanceGBeanData.setReferencePattern("XATerminator", earContext.getTransactionManagerObjectName());
+                resourceAdapterInstanceGBeanData.setReferencePattern("XATerminator", earContext.getTransactionManagerName());
 
                 String resourceAdapterName = geronimoResourceAdapter.getResourceadapterInstance().getResourceadapterName();
                 resourceAdapterAbstractName = earContext.getNaming().createChildName(jcaResourceName, resourceAdapterName, NameFactory.JCA_RESOURCE_ADAPTER);
@@ -724,9 +724,9 @@
         try {
             connectionManagerGBean.setAttribute("transactionSupport", transactionSupport);
             connectionManagerGBean.setAttribute("pooling", pooling);
-            connectionManagerGBean.setReferencePattern("ConnectionTracker", earContext.getConnectionTrackerObjectName());
+            connectionManagerGBean.setReferencePattern("ConnectionTracker", earContext.getConnectionTrackerName());
             connectionManagerGBean.setAttribute("containerManagedSecurity", Boolean.valueOf(connectionManager.isSetContainerManagedSecurity()));
-            connectionManagerGBean.setReferencePattern("TransactionManager", earContext.getTransactionManagerObjectName());
+            connectionManagerGBean.setReferencePattern("TransactionManager", earContext.getTransactionManagerName());
         } catch (Exception e) {
             throw new DeploymentException("Problem setting up ConnectionManager named " + connectionfactoryInstance.getName().trim(), e);
         }
@@ -786,7 +786,7 @@
         }
     }
 
-    //ResourceReferenceBuilder implementation
+    //ResourceRefBuilder implementation
     public Reference createResourceRef(AbstractNameQuery containerId, Class iface, Configuration configuration) throws DeploymentException {
         try {
             configuration.findGBean(containerId);
@@ -875,7 +875,7 @@
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
 
         infoBuilder.addInterface(ModuleBuilder.class);
-        infoBuilder.addInterface(ResourceReferenceBuilder.class);
+        infoBuilder.addInterface(ActivationSpecInfoLocator.class);
 
         infoBuilder.setConstructor(new String[]{"defaultEnvironment",
                 "defaultMaxSize",

Modified: geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Tue Sep 12 11:15:24 2006
@@ -20,7 +20,6 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
-import java.net.URI;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.sql.Connection;
@@ -36,9 +35,6 @@
 
 import javax.naming.Reference;
 import javax.sql.DataSource;
-import javax.xml.namespace.QName;
-
-import org.apache.geronimo.testsupport.TestSupport;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
@@ -52,14 +48,11 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.deployment.ActivationSpecInfoLocator;
 import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
 import org.apache.geronimo.j2ee.deployment.EARContext;
-import org.apache.geronimo.j2ee.deployment.EJBReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
-import org.apache.geronimo.j2ee.deployment.RefContext;
-import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
-import org.apache.geronimo.j2ee.deployment.ServiceReferenceBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
 import org.apache.geronimo.kernel.Jsr77Naming;
@@ -85,6 +78,7 @@
 import org.apache.geronimo.kernel.repository.ImportType;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
+import org.apache.geronimo.testsupport.TestSupport;
 import org.apache.geronimo.transaction.manager.GeronimoTransactionManagerGBean;
 import org.tranql.sql.jdbc.JDBCUtil;
 
@@ -115,24 +109,7 @@
         }
     };
 
-    private EJBReferenceBuilder ejbReferenceBuilder = new EJBReferenceBuilder() {
-
-
-        public Reference createCORBAReference(Configuration configuration, AbstractNameQuery containerNameQuery, URI nsCorbaloc, String objectName, String home) {
-            return null;
-        }
-
-        public Reference createEJBRemoteRef(String refName, Configuration configuration, String name, String requiredModule, String optionalModule, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String home, String remote) {
-            return null;
-        }
-
-        public Reference createEJBLocalRef(String refName, Configuration configuration, String name, String requiredModule, String optionalModule, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String localHome, String local) {
-            return null;
-        }
-
-    };
-
-    private ResourceReferenceBuilder resourceReferenceBuilder = new ResourceReferenceBuilder() {
+    private ActivationSpecInfoLocator activationSpecInfoLocator = new ActivationSpecInfoLocator() {
 
         public Reference createResourceRef(AbstractNameQuery containerId, Class iface, Configuration configuration) {
             return null;
@@ -147,13 +124,6 @@
         }
     };
 
-    private ServiceReferenceBuilder serviceReferenceBuilder = new ServiceReferenceBuilder() {
-        //it could return a Service or a Reference, we don't care
-        public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext deploymentContext, Module module, ClassLoader classLoader) {
-            return null;
-        }
-    };
-
     private Kernel kernel;
     private EditableConfigurationManager configurationManager;
     private static final Naming naming = new Jsr77Naming();
@@ -180,12 +150,10 @@
                     new AbstractNameQuery(serverName, J2EEServerImpl.GBEAN_INFO.getInterfaces()),
                     null,
                     null,
-                    ejbReferenceBuilder,
                     null,
                     new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, Collections.singleton(serviceBuilder)),
-                    resourceReferenceBuilder,
+                    activationSpecInfoLocator,
                     null,
-                    serviceReferenceBuilder,
                     null,
                     serviceBuilder,
                     kernel.getNaming());
@@ -395,8 +363,8 @@
                         connectionTrackerName,
                         null,
                         null,
-                        null,
-                        new RefContext(ejbReferenceBuilder, moduleBuilder, serviceReferenceBuilder));
+                        null
+                );
 
                 action.install(moduleBuilder, earContext, module, configurationStore);
                 earContext.getClassLoader();

Modified: geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/PlanParsingTest.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/PlanParsingTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/PlanParsingTest.java Tue Sep 12 11:15:24 2006
@@ -1,17 +1,15 @@
 package org.apache.geronimo.connector.deployment;
 
-import java.io.File;
 import java.net.URL;
 
 import javax.xml.namespace.QName;
 
-import org.apache.geronimo.testsupport.TestSupport;
-
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.testsupport.TestSupport;
 import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
 import org.apache.geronimo.xbeans.geronimo.GerConnectorType;
 import org.apache.geronimo.xbeans.j2ee.ConnectorDocument;
-import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java Tue Sep 12 11:15:24 2006
@@ -20,16 +20,18 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Timer;
+
 import javax.resource.spi.ManagedConnectionFactory;
 import javax.resource.spi.ConnectionRequestInfo;
 import javax.resource.ResourceException;
 import javax.security.auth.Subject;
 
-import EDU.oswego.cs.dl.util.concurrent.FIFOSemaphore;
-import EDU.oswego.cs.dl.util.concurrent.ReadWriteLock;
-import EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import edu.emory.mathcs.backport.java.util.concurrent.locks.ReadWriteLock;
+import edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantReadWriteLock;
+import edu.emory.mathcs.backport.java.util.concurrent.Semaphore;
+import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
 
 /**
  * @version $Rev$ $Date$
@@ -37,8 +39,8 @@
 public abstract class AbstractSinglePoolConnectionInterceptor implements ConnectionInterceptor, PoolingAttributes {
     protected static Log log = LogFactory.getLog(SinglePoolConnectionInterceptor.class.getName());
     protected final ConnectionInterceptor next;
-    private final ReadWriteLock resizeLock = new WriterPreferenceReadWriteLock();
-    protected FIFOSemaphore permits;
+    private final ReadWriteLock resizeLock = new ReentrantReadWriteLock();
+    protected Semaphore permits;
     protected int blockingTimeoutMilliseconds;
     protected int connectionCount = 0;
     private long idleTimeoutMilliseconds;
@@ -59,7 +61,7 @@
         this.minSize = minSize;
         this.blockingTimeoutMilliseconds = blockingTimeoutMilliseconds;
         setIdleTimeoutMinutes(idleTimeoutMinutes);
-        permits = new FIFOSemaphore(maxSize);
+        permits = new Semaphore(maxSize, true);
     }
 
     public void getConnection(ConnectionInfo connectionInfo) throws ResourceException {
@@ -67,9 +69,9 @@
             return;
         }
         try {
-            resizeLock.readLock().acquire();
+            resizeLock.readLock().lock();
             try {
-                if (permits.attempt(blockingTimeoutMilliseconds)) {
+                if (permits.tryAcquire(blockingTimeoutMilliseconds, TimeUnit.MILLISECONDS)) {
                     internalGetConnection(connectionInfo);
                 } else {
                     throw new ResourceException("No ManagedConnections available "
@@ -79,7 +81,7 @@
 
                 }
             } finally {
-                resizeLock.readLock().release();
+                resizeLock.readLock().unlock();
             }
 
         } catch (InterruptedException ie) {
@@ -100,16 +102,12 @@
             try {
                 connectionInfo.getManagedConnectionInfo().getManagedConnection().destroy();
             } catch (ResourceException re) {
+                // empty
             }
             return;
         }
 
-        try {
-            resizeLock.readLock().acquire();
-        } catch (InterruptedException e) {
-            //TODO figure out something better to do here!!!
-            throw new RuntimeException("Interrupted before returning connection! Pool is now in an invalid state!");
-        }
+        resizeLock.readLock().lock();
         try {
             ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo();
             if (connectionReturnAction == ConnectionReturnAction.RETURN_HANDLE && mci.hasConnectionHandles()) {
@@ -122,7 +120,7 @@
                 permits.release();
             }
         } finally {
-            resizeLock.readLock().release();
+            resizeLock.readLock().unlock();
         }
     }
 
@@ -150,12 +148,12 @@
             throw new IllegalArgumentException("Max size must be positive, not " + newMaxSize);
         }
         if (newMaxSize != getPartitionMaxSize()) {
-            resizeLock.writeLock().acquire();
+            resizeLock.writeLock().lock();
             try {
-                ResizeInfo resizeInfo = new ResizeInfo(this.minSize, (int)permits.permits(), connectionCount, newMaxSize);
+                ResizeInfo resizeInfo = new ResizeInfo(this.minSize, permits.availablePermits(), connectionCount, newMaxSize);
                 this.shrinkLater = resizeInfo.getShrinkLater();
 
-                permits = new FIFOSemaphore(newMaxSize);
+                permits = new Semaphore(newMaxSize, true);
                 //pre-acquire permits for the existing checked out connections that will not be closed when they are returned.
                 for (int i = 0; i < resizeInfo.getTransferCheckedOut(); i++) {
                     permits.acquire();
@@ -164,7 +162,7 @@
                 transferConnections(newMaxSize, resizeInfo.getShrinkNow());
                 this.minSize = resizeInfo.getNewMinSize();
             } finally {
-                resizeLock.writeLock().release();
+                resizeLock.writeLock().unlock();
             }
         }
     }
@@ -288,11 +286,8 @@
             AbstractSinglePoolConnectionInterceptor interceptor = parent;
             if (interceptor == null)
                 return;
-            try {
-                interceptor.resizeLock.readLock().acquire();
-            } catch (InterruptedException e) {
-                return;
-            }
+
+            interceptor.resizeLock.readLock().lock();
             try {
                 long threshold = System.currentTimeMillis() - interceptor.idleTimeoutMilliseconds;
                 ArrayList killList = new ArrayList(interceptor.getPartitionMaxSize());
@@ -304,7 +299,7 @@
                 }
                 interceptor.permits.release(killList.size());
             } finally {
-                interceptor.resizeLock.readLock().release();
+                interceptor.resizeLock.readLock().unlock();
             }
         }
 
@@ -324,11 +319,7 @@
         }
 
         public void run() {
-            try {
-                resizeLock.readLock().acquire();
-            } catch (InterruptedException e) {
-                return;
-            }
+            resizeLock.readLock().lock();
             try {
                 while (connectionCount < minSize) {
                     ManagedConnectionInfo mci = new ManagedConnectionInfo(managedConnectionFactory, cri);
@@ -339,15 +330,14 @@
                     } catch (ResourceException e) {
                         return;
                     }
-                    boolean added = false;
-                    added = addToPool(mci);
+                    boolean added = addToPool(mci);
                     if (!added) {
                         internalReturn(ci, ConnectionReturnAction.DESTROY);
                         return;
                     }
                 }
             } finally {
-                resizeLock.readLock().release();
+                resizeLock.readLock().unlock();
             }
         }
 

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java Tue Sep 12 11:15:24 2006
@@ -17,8 +17,6 @@
 
 package org.apache.geronimo.connector.outbound;
 
-//import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
-
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Iterator;

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java Tue Sep 12 11:15:24 2006
@@ -24,7 +24,8 @@
 import javax.resource.spi.work.WorkListener;
 import javax.resource.spi.work.WorkManager;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+
 import org.apache.geronimo.connector.work.pool.ScheduleWorkExecutor;
 import org.apache.geronimo.connector.work.pool.StartWorkExecutor;
 import org.apache.geronimo.connector.work.pool.SyncWorkExecutor;

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java Tue Sep 12 11:15:24 2006
@@ -22,7 +22,8 @@
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.transaction.manager.XAWork;
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
 
 /**
  * 

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java Tue Sep 12 11:15:24 2006
@@ -30,11 +30,12 @@
 import javax.transaction.InvalidTransactionException;
 import javax.transaction.SystemException;
 
-import EDU.oswego.cs.dl.util.concurrent.Latch;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+
 import org.apache.geronimo.transaction.manager.ImportedTransactionActiveException;
 import org.apache.geronimo.transaction.manager.XAWork;
+import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
 
 /**
  * Work wrapper providing an execution context to a Work instance.
@@ -111,12 +112,12 @@
     /**
      * A latch, which is released when the work is started.
      */
-    private Latch startLatch = new Latch();
+    private CountDownLatch startLatch = new CountDownLatch(1);
 
     /**
      * A latch, which is released when the work is completed.
      */
-    private Latch endLatch = new Latch();
+    private CountDownLatch endLatch = new CountDownLatch(1);
 
     /**
      * Create a WorkWrapper.
@@ -142,10 +143,10 @@
      *                      Work processing events (work accepted, work rejected, work started,
      */
     public WorkerContext(Work aWork,
-            long aStartTimeout,
-            ExecutionContext execContext,
-            XAWork xaWork,
-            WorkListener workListener) {
+                         long aStartTimeout,
+                         ExecutionContext execContext,
+                         XAWork xaWork,
+                         WorkListener workListener) {
         adaptee = aWork;
         startTimeOut = aStartTimeout;
         executionContext = execContext;
@@ -273,15 +274,15 @@
         if (isTimedOut()) {
             // In case of a time out, one releases the start and end latches
             // to prevent a dead-lock.
-            startLatch.release();
-            endLatch.release();
+            startLatch.countDown();
+            endLatch.countDown();
             return;
         }
         // Implementation note: the work listener is notified prior to release
         // the start lock. This behavior is intentional and seems to be the
         // more conservative.
         workListener.workStarted(new WorkEvent(this, WorkEvent.WORK_STARTED, adaptee, null));
-        startLatch.release();
+        startLatch.countDown();
         //Implementation note: we assume this is being called without an interesting TransactionContext,
         //and ignore/replace whatever is associated with the current thread.
         try {
@@ -314,7 +315,7 @@
             workListener.workCompleted(new WorkEvent(this, WorkEvent.WORK_REJECTED, adaptee,
                     workException));
         } finally {
-            endLatch.release();
+            endLatch.countDown();
         }
     }
 
@@ -325,7 +326,7 @@
      * @return Latch that a caller can acquire to wait for the start of a
      *         work execution.
      */
-    public synchronized Latch provideStartLatch() {
+    public synchronized CountDownLatch provideStartLatch() {
         return startLatch;
     }
 
@@ -336,7 +337,7 @@
      * @return Latch that a caller can acquire to wait for the end of a
      *         work execution.
      */
-    public synchronized Latch provideEndLatch() {
+    public synchronized CountDownLatch provideEndLatch() {
         return endLatch;
     }
 

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/NullWorkExecutorPool.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/NullWorkExecutorPool.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/NullWorkExecutorPool.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/NullWorkExecutorPool.java Tue Sep 12 11:15:24 2006
@@ -51,7 +51,7 @@
         return this;
     }
 
-    public void execute(Runnable command) throws InterruptedException {
+    public void execute(Runnable command) {
         throw new IllegalStateException("Stopped");
     }
 }

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java Tue Sep 12 11:15:24 2006
@@ -19,8 +19,9 @@
 
 import javax.resource.spi.work.WorkException;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
 import org.apache.geronimo.connector.work.WorkerContext;
+
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
 
 /**
  *

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java Tue Sep 12 11:15:24 2006
@@ -18,10 +18,11 @@
 package org.apache.geronimo.connector.work.pool;
 
 import javax.resource.spi.work.WorkException;
-import EDU.oswego.cs.dl.util.concurrent.Latch;
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+
 import org.apache.geronimo.connector.work.WorkerContext;
-import org.apache.geronimo.pool.GeronimoExecutor;
+
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
 
 /**
  *
@@ -33,8 +34,8 @@
 
     public void doExecute(WorkerContext work, Executor executor)
             throws WorkException, InterruptedException {
-        Latch latch = work.provideStartLatch();
+        CountDownLatch latch = work.provideStartLatch();
         executor.execute(new NamedRunnable("A J2EE Connector", work));
-        latch.acquire();
+        latch.await();
     }
 }

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java Tue Sep 12 11:15:24 2006
@@ -18,10 +18,11 @@
 package org.apache.geronimo.connector.work.pool;
 
 import javax.resource.spi.work.WorkException;
-import EDU.oswego.cs.dl.util.concurrent.Latch;
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+
 import org.apache.geronimo.connector.work.WorkerContext;
-import org.apache.geronimo.pool.GeronimoExecutor;
+
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
 
 /**
  *
@@ -33,9 +34,9 @@
 
     public void doExecute(WorkerContext work, Executor executor)
             throws WorkException, InterruptedException {
-        Latch latch = work.provideEndLatch();
+        CountDownLatch latch = work.provideEndLatch();
         executor.execute(new NamedRunnable("A J2EE Connector", work));
-        latch.acquire();
+        latch.await();
     }
 
 }

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java Tue Sep 12 11:15:24 2006
@@ -2,7 +2,8 @@
 
 import javax.resource.spi.work.WorkException;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+
 import org.apache.geronimo.connector.work.WorkerContext;
 
 /**

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPool.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPool.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPool.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPool.java Tue Sep 12 11:15:24 2006
@@ -17,10 +17,7 @@
 
 package org.apache.geronimo.connector.work.pool;
 
-import javax.resource.spi.work.WorkException;
-
-import org.apache.geronimo.connector.work.WorkerContext;
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
 
 /**
  * Defines the operations that a pool in charge of the execution of Work

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java Tue Sep 12 11:15:24 2006
@@ -17,13 +17,9 @@
 
 package org.apache.geronimo.connector.work.pool;
 
-import javax.resource.spi.work.WorkCompletedException;
-import javax.resource.spi.work.WorkException;
-
-import EDU.oswego.cs.dl.util.concurrent.Channel;
-import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
-import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
-import org.apache.geronimo.connector.work.WorkerContext;
+import edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
+import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
+import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
 
 /**
  * Based class for WorkExecutorPool. Sub-classes define the synchronization
@@ -37,7 +33,7 @@
     /**
      * A timed out pooled executor.
      */
-    private PooledExecutor pooledExecutor;
+    private ThreadPoolExecutor pooledExecutor;
 
     /**
      * Creates a pool with the specified minimum and maximum sizes. The Channel
@@ -47,35 +43,20 @@
      * @param maxSize Maximum size of the work executor pool.
      */
     public WorkExecutorPoolImpl(int maxSize) {
-        pooledExecutor = new PooledExecutor(new LinkedQueue(), maxSize);
-        pooledExecutor.setMinimumPoolSize(maxSize);
-        pooledExecutor.waitWhenBlocked();
-    }
+        pooledExecutor = new ThreadPoolExecutor(1, maxSize, 1, TimeUnit.MINUTES, new LinkedBlockingQueue());
+        /*
 
-    /**
-     * Creates a pool with the specified minimum and maximum sizes and using the
-     * specified Channel to enqueue the submitted Work instances.
-     *
-     * @param channel Queue to be used as the queueing facility of this pool.
-     * @param maxSize Maximum size of the work executor pool.
-     */
-    public WorkExecutorPoolImpl(
-            Channel channel,
-            int maxSize) {
-        pooledExecutor = new PooledExecutor(channel, maxSize);
-        pooledExecutor.setMinimumPoolSize(maxSize);
+        FIXME: How to do this with concurrent.util ?
         pooledExecutor.waitWhenBlocked();
+        */
     }
-
+    
     /**
      * Execute the specified Work.
      *
      * @param work Work to be executed.
-     *
-     * @exception InterruptedException Indicates that the Work execution has been
-     * unsuccessful.
      */
-    public void execute(Runnable work) throws InterruptedException {
+    public void execute(Runnable work) {
         pooledExecutor.execute(work);
     }
 
@@ -111,7 +92,7 @@
      */
     public WorkExecutorPool stop() {
         int maxSize = getMaximumPoolSize();
-        pooledExecutor.shutdownAfterProcessingCurrentlyQueuedTasks();
+        pooledExecutor.shutdown();
         return new NullWorkExecutorPool(maxSize);
     }
 

Modified: geronimo/server/branches/sachin/modules/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java Tue Sep 12 11:15:24 2006
@@ -42,9 +42,11 @@
 
     protected void setUp() throws Exception {
         super.setUp();
+        
         XAWork xaWork = new GeronimoTransactionManager();
         ThreadPool pool = new ThreadPool(1, "Connector Test", 30000, ThreadPool.class.getClassLoader(), "foo:test=bar");
         pool.setWaitWhenBlocked(true);
+        
         workManager = new GeronimoWorkManager(pool, pool, pool, xaWork);
         workManager.doStart();
     }

Modified: geronimo/server/branches/sachin/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/GeronimoExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/GeronimoExecutor.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/GeronimoExecutor.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/GeronimoExecutor.java Tue Sep 12 11:15:24 2006
@@ -16,7 +16,7 @@
  */
 package org.apache.geronimo.pool;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
 
 /**
  * A Geronimo-specific extension that contributes a little extra manageability

Modified: geronimo/server/branches/sachin/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java Tue Sep 12 11:15:24 2006
@@ -21,16 +21,24 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.management.j2ee.statistics.BoundedRangeStatistic;
 import javax.management.j2ee.statistics.CountStatistic;
 import javax.management.j2ee.statistics.Stats;
-import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
-import EDU.oswego.cs.dl.util.concurrent.ThreadFactory;
+
+import edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
+import edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionHandler;
+import edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionException;
+import edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory;
+import edu.emory.mathcs.backport.java.util.concurrent.SynchronousQueue;
+import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
+
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+
 import org.apache.geronimo.management.J2EEManagedObject;
 import org.apache.geronimo.management.StatisticsProvider;
 import org.apache.geronimo.management.geronimo.stats.ThreadPoolStats;
@@ -42,23 +50,26 @@
  * @version $Rev$ $Date$
  */
 public class ThreadPool implements GeronimoExecutor, GBeanLifecycle, J2EEManagedObject, StatisticsProvider {
-    private PooledExecutor executor;
+    private ThreadPoolExecutor executor;
     private ClassLoader classLoader;
     private ObjectName objectName;
     private boolean waitWhenBlocked;
-
+    
     // Statistics-related fields follow
     private boolean statsActive = true;
     private PoolStatsImpl stats = new PoolStatsImpl();
     private Map clients = new HashMap();
 
-
     public ThreadPool(int poolSize, String poolName, long keepAliveTime, ClassLoader classLoader, String objectName) {
-        PooledExecutor p = new PooledExecutor(poolSize);
-        p.abortWhenBlocked();
-        p.setKeepAliveTime(keepAliveTime);
-        p.setMinimumPoolSize(poolSize);
+        ThreadPoolExecutor p = new ThreadPoolExecutor(
+            poolSize, // core size
+            poolSize, // max size
+            keepAliveTime, TimeUnit.MILLISECONDS,
+            new SynchronousQueue());
+
+        p.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
         p.setThreadFactory(new ThreadPoolThreadFactory(poolName, classLoader));
+        
         try {
             this.objectName = ObjectName.getInstance(objectName);
         } catch (MalformedObjectNameException e) {
@@ -158,11 +169,11 @@
         return executor.getMaximumPoolSize();
     }
 
-    public void execute(Runnable command) throws InterruptedException {
+    public void execute(Runnable command) {
         execute("Unknown", command);
     }
 
-    public void execute(final String consumerName, final Runnable runnable) throws InterruptedException {
+    public void execute(final String consumerName, final Runnable runnable) {
         Runnable command;
         if (statsActive) {
             command = new Runnable() {
@@ -179,7 +190,7 @@
             command = runnable;
         }
 
-        PooledExecutor p;
+        ThreadPoolExecutor p;
         synchronized (this) {
             p = executor;
         }
@@ -207,13 +218,26 @@
             clients.put(consumerName, new Integer(test.intValue() - 1));
         }
     }
-
+    
+    private static class WaitWhenBlockedPolicy
+        implements RejectedExecutionHandler
+    {
+        public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) throws RejectedExecutionException {
+            try {
+                executor.getQueue().put(r);
+            }
+            catch (InterruptedException e) {
+                throw new RejectedExecutionException(e);
+            }
+        }
+    }
+    
     public void setWaitWhenBlocked(boolean wait) {
         waitWhenBlocked = wait;
         if(wait) {
-            executor.waitWhenBlocked();
+            executor.setRejectedExecutionHandler(new WaitWhenBlockedPolicy());
         } else {
-            executor.abortWhenBlocked();
+            executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
         }
     }
 
@@ -225,7 +249,7 @@
     }
 
     public void doStop() throws Exception {
-        PooledExecutor p;
+        ThreadPoolExecutor p;
         synchronized (this) {
             p = executor;
             executor = null;

Modified: geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Tue Sep 12 11:15:24 2006
@@ -36,6 +36,7 @@
 import java.util.Set;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
+
 import javax.xml.namespace.QName;
 
 import org.apache.commons.logging.Log;
@@ -47,7 +48,6 @@
 import org.apache.geronimo.deployment.util.NestedJarFile;
 import org.apache.geronimo.deployment.xbeans.ArtifactType;
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
-import org.apache.geronimo.deployment.xbeans.ServiceDocument;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
@@ -80,7 +80,6 @@
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerApplicationType;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerExtModuleType;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerModuleType;
-import org.apache.geronimo.xbeans.geronimo.j2ee.GerSecurityDocument;
 import org.apache.geronimo.xbeans.j2ee.ApplicationType;
 import org.apache.geronimo.xbeans.j2ee.ModuleType;
 import org.apache.xmlbeans.XmlException;
@@ -89,14 +88,12 @@
 /**
  * @version $Rev$ $Date$
  */
-public class EARConfigBuilder implements ConfigurationBuilder {
+public class EARConfigBuilder implements ConfigurationBuilder, CorbaGBeanNameSource {
 
     private static final Log log = LogFactory.getLog(EARConfigBuilder.class);
     private static final String LINE_SEP = System.getProperty("line.separator");
 
     private final static QName APPLICATION_QNAME = GerApplicationDocument.type.getDocumentElementName();
-    private static final QName SECURITY_QNAME = GerSecurityDocument.type.getDocumentElementName();
-    private static final QName SERVICE_QNAME = ServiceDocument.type.getDocumentElementName();
 
     private final ConfigurationManager configurationManager;
     private final Collection repositories;
@@ -104,9 +101,7 @@
     private final SingleElementCollection webConfigBuilder;
     private final SingleElementCollection connectorConfigBuilder;
     private final SingleElementCollection appClientConfigBuilder;
-    private final SingleElementCollection ejbReferenceBuilder;
     private final SingleElementCollection resourceReferenceBuilder;
-    private final SingleElementCollection serviceReferenceBuilder;
     private final NamespaceDrivenBuilderCollection securityBuilders;
     private final NamespaceDrivenBuilderCollection serviceBuilders;
 
@@ -128,12 +123,10 @@
             AbstractNameQuery serverName,
             Collection repositories,
             Collection ejbConfigBuilder,
-            Collection ejbReferenceBuilder,
             Collection webConfigBuilder,
             Collection connectorConfigBuilder,
             Collection resourceReferenceBuilder,
             Collection appClientConfigBuilder,
-            Collection serviceReferenceBuilder,
             Collection securityBuilders,
             Collection serviceBuilders,
             Kernel kernel) {
@@ -147,12 +140,10 @@
                 ConfigurationUtil.getConfigurationManager(kernel),
                 repositories,
                 new SingleElementCollection(ejbConfigBuilder),
-                new SingleElementCollection(ejbReferenceBuilder),
                 new SingleElementCollection(webConfigBuilder),
                 new SingleElementCollection(connectorConfigBuilder),
                 new SingleElementCollection(resourceReferenceBuilder),
                 new SingleElementCollection(appClientConfigBuilder),
-                new SingleElementCollection(serviceReferenceBuilder),
                 securityBuilders,
                 serviceBuilders,
                 kernel.getNaming());
@@ -166,12 +157,10 @@
             AbstractNameQuery serverName,
             Collection repositories,
             ModuleBuilder ejbConfigBuilder,
-            EJBReferenceBuilder ejbReferenceBuilder,
             ModuleBuilder webConfigBuilder,
             ModuleBuilder connectorConfigBuilder,
-            ResourceReferenceBuilder resourceReferenceBuilder,
+            ActivationSpecInfoLocator activationSpecInfoLocator,
             ModuleBuilder appClientConfigBuilder,
-            ServiceReferenceBuilder serviceReferenceBuilder,
             NamespaceDrivenBuilder securityBuilder,
             NamespaceDrivenBuilder serviceBuilder,
             Naming naming) {
@@ -185,12 +174,10 @@
                 null,
                 repositories,
                 new SingleElementCollection(ejbConfigBuilder),
-                new SingleElementCollection(ejbReferenceBuilder),
                 new SingleElementCollection(webConfigBuilder),
                 new SingleElementCollection(connectorConfigBuilder),
-                new SingleElementCollection(resourceReferenceBuilder),
+                new SingleElementCollection(activationSpecInfoLocator),
                 new SingleElementCollection(appClientConfigBuilder),
-                new SingleElementCollection(serviceReferenceBuilder),
                 securityBuilder == null? Collections.EMPTY_SET: Collections.singleton(securityBuilder),
                 serviceBuilder == null? Collections.EMPTY_SET: Collections.singleton(serviceBuilder),
                 naming);
@@ -206,25 +193,22 @@
             ConfigurationManager configurationManager,
             Collection repositories,
             SingleElementCollection ejbConfigBuilder,
-            SingleElementCollection ejbReferenceBuilder,
             SingleElementCollection webConfigBuilder,
             SingleElementCollection connectorConfigBuilder,
             SingleElementCollection resourceReferenceBuilder,
             SingleElementCollection appClientConfigBuilder,
-            SingleElementCollection serviceReferenceBuilder,
             Collection securityBuilders,
-            Collection serviceBuilders, Naming naming) {
+            Collection serviceBuilders,
+            Naming naming) {
         this.configurationManager = configurationManager;
         this.repositories = repositories;
         this.defaultEnvironment = defaultEnvironment;
 
         this.ejbConfigBuilder = ejbConfigBuilder;
-        this.ejbReferenceBuilder = ejbReferenceBuilder;
         this.resourceReferenceBuilder = resourceReferenceBuilder;
         this.webConfigBuilder = webConfigBuilder;
         this.connectorConfigBuilder = connectorConfigBuilder;
         this.appClientConfigBuilder = appClientConfigBuilder;
-        this.serviceReferenceBuilder = serviceReferenceBuilder;
         this.securityBuilders = new NamespaceDrivenBuilderCollection(securityBuilders);
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders);
 
@@ -237,6 +221,11 @@
         this.naming = naming;
     }
 
+
+    public AbstractNameQuery getCorbaGBeanName() {
+        return corbaGBeanObjectName;
+    }
+
     private ModuleBuilder getEjbConfigBuilder() {
         return (ModuleBuilder) ejbConfigBuilder.getElement();
     }
@@ -253,16 +242,8 @@
         return (ModuleBuilder) appClientConfigBuilder.getElement();
     }
 
-    private EJBReferenceBuilder getEjbReferenceBuilder() {
-        return (EJBReferenceBuilder) ejbReferenceBuilder.getElement();
-    }
-
-    private ResourceReferenceBuilder getResourceReferenceBuilder() {
-        return (ResourceReferenceBuilder) resourceReferenceBuilder.getElement();
-    }
-
-    private ServiceReferenceBuilder getServiceReferenceBuilder() {
-        return (ServiceReferenceBuilder) serviceReferenceBuilder.getElement();
+    private ActivationSpecInfoLocator getResourceReferenceBuilder() {
+        return (ActivationSpecInfoLocator) resourceReferenceBuilder.getElement();
     }
 
     public Object getDeploymentPlan(File planFile, DeployableModule jarFile, ModuleIDBuilder idBuilder) throws DeploymentException {
@@ -467,8 +448,8 @@
                     connectionTrackerObjectName,
                     transactionalTimerObjectName,
                     nonTransactionalTimerObjectName,
-                    corbaGBeanObjectName,
-                    new RefContext(getEjbReferenceBuilder(), getResourceReferenceBuilder(), getServiceReferenceBuilder()));
+                    corbaGBeanObjectName
+            );
 
             if (earFile instanceof DefaultDeployableModule) {
                 JarFile jar = ((DefaultDeployableModule) earFile).getJarFile();
@@ -921,12 +902,10 @@
 
         infoBuilder.addReference("Repositories", Repository.class, "Repository");
         infoBuilder.addReference("EJBConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addReference("EJBReferenceBuilder", EJBReferenceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("WebConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ConnectorConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addReference("ResourceReferenceBuilder", ResourceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ActivationSpecInfoLocator", ActivationSpecInfoLocator.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("AppClientConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addReference("ServiceReferenceBuilder", ServiceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
 
@@ -944,12 +923,10 @@
                 "serverName",
                 "Repositories",
                 "EJBConfigBuilder",
-                "EJBReferenceBuilder",
                 "WebConfigBuilder",
                 "ConnectorConfigBuilder",
-                "ResourceReferenceBuilder",
+                "ActivationSpecInfoLocator",
                 "AppClientConfigBuilder",
-                "ServiceReferenceBuilder",
                 "SecurityBuilders",
                 "ServiceBuilders",
                 "kernel"

Modified: geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java Tue Sep 12 11:15:24 2006
@@ -34,21 +34,20 @@
  * @version $Rev:386276 $ $Date$
  */
 public class EARContext extends DeploymentContext {
+
+    private final AbstractNameQuery serverName;
     private final AbstractNameQuery transactionManagerObjectName;
     private final AbstractNameQuery connectionTrackerObjectName;
-
     private final AbstractNameQuery transactedTimerName;
     private final AbstractNameQuery nonTransactedTimerName;
-
     private final AbstractNameQuery corbaGBeanObjectName;
 
-    private final RefContext refContext;
-    private final AbstractNameQuery serverName;
-
     private final Map contextIDToPermissionsMap = new HashMap();
     private AbstractName jaccManagerName;
     private Object securityConfiguration;
 
+    private final Map  messageDestinations = new HashMap();
+
     public EARContext(File baseDir,
             File inPlaceConfigurationDir,
             Environment environment,
@@ -61,8 +60,8 @@
             AbstractNameQuery connectionTrackerObjectName,
             AbstractNameQuery transactedTimerName,
             AbstractNameQuery nonTransactedTimerName,
-            AbstractNameQuery corbaGBeanObjectName,
-            RefContext refContext) throws DeploymentException {
+            AbstractNameQuery corbaGBeanObjectName
+    ) throws DeploymentException {
         super(baseDir, inPlaceConfigurationDir, environment, baseName, moduleType, naming, configurationManager, repositories);
 
         this.serverName = serverName;
@@ -71,7 +70,6 @@
         this.transactedTimerName = transactedTimerName;
         this.nonTransactedTimerName = nonTransactedTimerName;
         this.corbaGBeanObjectName = corbaGBeanObjectName;
-        this.refContext = refContext;
     }
 
     public EARContext(File baseDir,
@@ -86,8 +84,8 @@
             AbstractNameQuery connectionTrackerObjectName,
             AbstractNameQuery transactedTimerName,
             AbstractNameQuery nonTransactedTimerName,
-            AbstractNameQuery corbaGBeanObjectName,
-            RefContext refContext) throws DeploymentException {
+            AbstractNameQuery corbaGBeanObjectName
+    ) throws DeploymentException {
         super(baseDir, inPlaceConfigurationDir, environment, baseName, moduleType, naming, configurationManager);
 
         this.serverName = serverName;
@@ -97,30 +95,28 @@
         this.transactedTimerName = transactedTimerName;
         this.nonTransactedTimerName = nonTransactedTimerName;
         this.corbaGBeanObjectName = corbaGBeanObjectName;
-        this.refContext = refContext;
     }
 
     public EARContext(File baseDir, File inPlaceConfigurationDir, Environment environment, ConfigurationModuleType moduleType, AbstractName baseName, EARContext parent) throws DeploymentException {
         super(baseDir, inPlaceConfigurationDir, environment, baseName, moduleType, parent.getNaming(), parent.getConfigurationManager());
         this.serverName = parent.getServerName();
 
-        this.transactionManagerObjectName = parent.getTransactionManagerObjectName();
-        this.connectionTrackerObjectName = parent.getConnectionTrackerObjectName();
+        this.transactionManagerObjectName = parent.getTransactionManagerName();
+        this.connectionTrackerObjectName = parent.getConnectionTrackerName();
         this.transactedTimerName = parent.getTransactedTimerName();
         this.nonTransactedTimerName = parent.getNonTransactedTimerName();
-        this.corbaGBeanObjectName = parent.getCORBAGBeanObjectName();
-        this.refContext = parent.getRefContext();
+        this.corbaGBeanObjectName = parent.getCORBAGBeanName();
     }
 
     public AbstractNameQuery getServerName() {
         return serverName;
     }
 
-    public AbstractNameQuery getTransactionManagerObjectName() {
+    public AbstractNameQuery getTransactionManagerName() {
         return transactionManagerObjectName;
     }
 
-    public AbstractNameQuery getConnectionTrackerObjectName() {
+    public AbstractNameQuery getConnectionTrackerName() {
         return connectionTrackerObjectName;
     }
 
@@ -132,14 +128,10 @@
         return nonTransactedTimerName;
     }
 
-    public AbstractNameQuery getCORBAGBeanObjectName() {
+    public AbstractNameQuery getCORBAGBeanName() {
         return corbaGBeanObjectName;
     }
 
-    public RefContext getRefContext() {
-        return refContext;
-    }
-
     public Map getContextIDToPermissionsMap() {
         return contextIDToPermissionsMap;
     }
@@ -169,4 +161,13 @@
     public Object getSecurityConfiguration() {
         return securityConfiguration;
     }
+
+    public void registerMessageDestionations(String moduleName, Map nameMap) throws DeploymentException {
+        messageDestinations.put(moduleName, nameMap);
+    }
+
+    public Map getMessageDestinations() {
+        return messageDestinations;
+    }
+
 }

Modified: geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java Tue Sep 12 11:15:24 2006
@@ -18,15 +18,11 @@
 
 import java.util.jar.JarFile;
 import java.net.URI;
-import java.net.URISyntaxException;
-import java.io.IOException;
-import java.io.File;
 
 import org.apache.xmlbeans.XmlObject;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
-import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.DeployableModule;
 import org.apache.geronimo.gbean.AbstractName;
 
@@ -49,8 +45,7 @@
     private final String namespace;
 
     private EARContext earContext;
-
-    private URI uniqueModuleLocation;
+    private EARContext rootEarContext;
 
     protected Module(boolean standAlone, AbstractName moduleName, Environment environment, DeployableModule deployableModule, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, String namespace) {
         assert targetPath != null: "targetPath is null";
@@ -146,54 +141,6 @@
         deployableModule.cleanup();
     }
 
-    public void addClass(String fqcn, byte[] bytes, DeploymentContext context) throws IOException, URISyntaxException {
-        URI location = getUniqueModuleLocation(context);
-        addClass(location, fqcn, bytes, context);
-    }
-
-    private URI getUniqueModuleLocation(DeploymentContext context) throws IOException {
-        if (uniqueModuleLocation == null) {
-            URI metainfUri = URI.create("META-INF/");
-            File metainfDir = context.getTargetFile(metainfUri);
-            if (!metainfDir.exists()) {
-                metainfDir.mkdirs();
-            }
-            if (!metainfDir.isDirectory()) {
-                throw new IOException("META-INF directory exists but is not a directory: " + metainfDir.getAbsolutePath());
-            }
-            if (!metainfDir.canRead()) {
-                throw new IOException("META-INF directory is not readable: " + metainfDir.getAbsolutePath());
-            }
-            if (!metainfDir.canWrite()) {
-                throw new IOException("META-INF directory is not writable: " + metainfDir.getAbsolutePath());
-            }
-
-            String suffix = "";
-            URI generatedUri;
-            File generatedDir;
-            int i = 0;
-            do {
-                generatedUri = metainfUri.resolve("geronimo-generated" + suffix + "/");
-                generatedDir = context.getTargetFile(generatedUri);
-                suffix = "" + i++;
-            } while (generatedDir.exists());
-            generatedDir.mkdirs();
-
-            // these shouldn't ever happen, but let's check anyway
-            if (!generatedDir.isDirectory()) {
-                throw new IOException("Geronimo generated classes directory exists but is not a directory: " + generatedDir.getAbsolutePath());
-            }
-            if (!generatedDir.canRead()) {
-                throw new IOException("Geronimo generated classes directory is not readable: " + generatedDir.getAbsolutePath());
-            }
-            if (!generatedDir.canWrite()) {
-                throw new IOException("Geronimo generated classes directory is not writable: " + generatedDir.getAbsolutePath());
-            }
-
-            uniqueModuleLocation = generatedUri;
-        }
-        return uniqueModuleLocation;
-    }
 
     public EARContext getEarContext() {
         return earContext;
@@ -203,5 +150,11 @@
         this.earContext = earContext;
     }
 
-    public abstract void addClass(URI location, String fqcn, byte[] bytes, DeploymentContext context) throws IOException, URISyntaxException;
+    public EARContext getRootEarContext() {
+        return rootEarContext;
+    }
+
+    public void setRootEarContext(EARContext rootEarContext) {
+        this.rootEarContext = rootEarContext;
+    }
 }

Modified: geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebModule.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebModule.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebModule.java Tue Sep 12 11:15:24 2006
@@ -54,14 +54,5 @@
         return portMap;
     }
 
-    //TODO configid check all modules can use this form.    Remove if!
-    public void addClass(URI location, String fqcn, byte[] bytes, DeploymentContext context) throws IOException, URISyntaxException {
-        if (getEarContext() != null) {
-            getEarContext().addClass(location, fqcn, bytes);
-        } else {
-            context.addClass(location, fqcn, bytes);
-        }
-    }
-
 }
 

Modified: geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java?view=diff&rev=442665&r1=442664&r2=442665
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java Tue Sep 12 11:15:24 2006
@@ -19,6 +19,11 @@
 
 package org.apache.geronimo.j2ee.deployment;
 
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+import java.util.jar.JarFile;
+
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
@@ -40,14 +45,6 @@
 import org.apache.geronimo.kernel.repository.ImportType;
 import org.apache.geronimo.testsupport.TestSupport;
 
-import javax.xml.namespace.QName;
-import java.io.IOException;
-import java.net.URI;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.jar.JarFile;
-
 /**
  * Provides support for EAR config builder tests.
  *
@@ -72,19 +69,12 @@
     
     protected static MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
     
-    protected static ResourceReferenceBuilder resourceReferenceBuilder = connectorConfigBuilder;
+    protected static ActivationSpecInfoLocator activationSpecInfoLocator = connectorConfigBuilder;
     
     protected static ModuleBuilder appClientConfigBuilder = null;
     
     protected final static ModuleIDBuilder idBuilder = new ModuleIDBuilder();
     
-    protected static ServiceReferenceBuilder serviceReferenceBuilder = new ServiceReferenceBuilder() {
-        //it could return a Service or a Reference, we don't care
-        public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext deploymentContext, Module module, ClassLoader classLoader) {
-            return null;
-        }
-    };
-
     protected static final NamespaceDrivenBuilder securityBuilder = null;
     
     protected static final NamespaceDrivenBuilder serviceBuilder = null;
@@ -147,12 +137,10 @@
                     null,
                     null,
                     ejbConfigBuilder,
-                    ejbConfigBuilder,
                     webConfigBuilder,
                     connectorConfigBuilder,
-                    resourceReferenceBuilder,
+                    activationSpecInfoLocator,
                     appClientConfigBuilder,
-                    serviceReferenceBuilder,
                     securityBuilder,
                     serviceBuilder,
                     naming);
@@ -180,12 +168,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                ejbConfigBuilder,
                 webConfigBuilder,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -221,12 +207,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                ejbConfigBuilder,
                 webConfigBuilder,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -262,12 +246,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                ejbConfigBuilder,
                 webConfigBuilder,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -303,12 +285,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                ejbConfigBuilder,
                 webConfigBuilder,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -344,12 +324,10 @@
                 null,
                 null,
                 null,
-                null,
                 webConfigBuilder,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -384,12 +362,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                ejbConfigBuilder,
                 null,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -423,12 +399,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                null,
                 webConfigBuilder,
                 null,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);



Mime
View raw message