geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/deployment/src/test-resources/etc bootstrapped-service.xml
Date Tue, 20 Jan 2004 06:13:39 GMT
djencks     2004/01/19 22:13:39

  Modified:    .        maven.xml
               modules/core/src/java/org/apache/geronimo/connector
                        BootstrapContext.java
               modules/core/src/java/org/apache/geronimo/connector/outbound
                        ConnectionManagerDeployment.java
               modules/core/src/java/org/apache/geronimo/connector/outbound/security
                        PasswordCredentialRealm.java
               modules/core/src/java/org/apache/geronimo/connector/work
                        GeronimoWorkManager.java
               modules/core/src/test/org/apache/geronimo/connector/outbound
                        ConnectionManagerTest.java
               modules/deployment/src/test-resources/etc
                        bootstrapped-service.xml
  Log:
  gbean-ify the easy connector beans
  
  Revision  Changes    Path
  1.52      +9 -1      incubator-geronimo/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/maven.xml,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- maven.xml	20 Jan 2004 01:36:58 -0000	1.51
  +++ maven.xml	20 Jan 2004 06:13:38 -0000	1.52
  @@ -663,6 +663,10 @@
                       <fileset dir="${maven.repo.local}/regexp/jars">
                             <include name="regexp-1.3-dev.jar"/>
                       </fileset>
  +                    <!-- connector work manager -->
  +                    <fileset dir="${maven.repo.local}/concurrent/jars">
  +                          <include name="concurrent-1.3.2.jar"/>
  +                    </fileset>
                   </classpath>
   
                   <arg value="file:${run.dir}/deployment/src/test-resources/etc/bootstrapped-service.xml"/>
  @@ -735,6 +739,10 @@
                       <!-- security -->
                       <fileset dir="${maven.repo.local}/regexp/jars">
                             <include name="regexp-1.3-dev.jar"/>
  +                    </fileset>
  +                    <!-- connector work manager -->
  +                    <fileset dir="${maven.repo.local}/concurrent/jars">
  +                          <include name="concurrent-1.3.2.jar"/>
                       </fileset>
                   </classpath>
   
  
  
  
  1.3       +24 -1     incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/BootstrapContext.java
  
  Index: BootstrapContext.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/BootstrapContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BootstrapContext.java	26 Nov 2003 02:17:40 -0000	1.2
  +++ BootstrapContext.java	20 Jan 2004 06:13:38 -0000	1.3
  @@ -64,12 +64,19 @@
   
   import org.apache.geronimo.kernel.service.GeronimoMBeanEndpoint;
   import org.apache.geronimo.kernel.service.GeronimoMBeanInfo;
  +import org.apache.geronimo.gbean.GBeanInfo;
  +import org.apache.geronimo.gbean.GBeanInfoFactory;
  +import org.apache.geronimo.gbean.GOperationInfo;
  +import org.apache.geronimo.gbean.GEndpointInfo;
  +import org.apache.geronimo.gbean.GConstructorInfo;
   
   /**
    * @version $Revision$ $Date$
    */
   public class BootstrapContext implements javax.resource.spi.BootstrapContext {
   
  +    private static final GBeanInfo GBEAN_INFO;
  +
       private WorkManager workManager;
       private XATerminator xATerminator;
   
  @@ -117,6 +124,22 @@
           return new Timer();
       }
   
  +    static {
  +        GBeanInfoFactory infoFactory = new GBeanInfoFactory(BootstrapContext.class.getName());
  +        infoFactory.addOperation(new GOperationInfo("getWorkManager"));
  +        infoFactory.addOperation(new GOperationInfo("getXATerminator"));
  +        infoFactory.addOperation(new GOperationInfo("createTimer"));
  +        infoFactory.addEndpoint(new GEndpointInfo("WorkManager", WorkManager.class.getName()));
  +        infoFactory.addEndpoint(new GEndpointInfo("XATerminator", XATerminator.class.getName()));
  +        infoFactory.setConstructor(new GConstructorInfo(
  +                new String[] {"WorkManager", "XATerminator"},
  +                new Class[] {WorkManager.class, XATerminator.class}));
  +        GBEAN_INFO = infoFactory.getBeanInfo();
  +    }
  +
  +    public static GBeanInfo getGBeanInfo() {
  +        return GBEAN_INFO;
  +    }
   
       public static GeronimoMBeanInfo getGeronimoMBeanInfo() throws Exception {
           GeronimoMBeanInfo rc = new GeronimoMBeanInfo();
  
  
  
  1.11      +89 -26    incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/outbound/ConnectionManagerDeployment.java
  
  Index: ConnectionManagerDeployment.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/outbound/ConnectionManagerDeployment.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ConnectionManagerDeployment.java	15 Jan 2004 01:20:53 -0000	1.10
  +++ ConnectionManagerDeployment.java	20 Jan 2004 06:13:38 -0000	1.11
  @@ -57,12 +57,22 @@
   package org.apache.geronimo.connector.outbound;
   
   import javax.management.MBeanOperationInfo;
  +import javax.management.MBeanServer;
  +import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
   import javax.resource.ResourceException;
   import javax.resource.spi.ManagedConnectionFactory;
   
   import org.apache.geronimo.connector.deployment.ConnectionManagerFactory;
   import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker;
  +import org.apache.geronimo.gbean.GAttributeInfo;
  +import org.apache.geronimo.gbean.GBean;
  +import org.apache.geronimo.gbean.GBeanInfo;
  +import org.apache.geronimo.gbean.GBeanInfoFactory;
  +import org.apache.geronimo.gbean.GConstructorInfo;
  +import org.apache.geronimo.gbean.GEndpointInfo;
  +import org.apache.geronimo.gbean.GOperationInfo;
  +import org.apache.geronimo.kernel.KernelMBean;
   import org.apache.geronimo.kernel.service.GeronimoAttributeInfo;
   import org.apache.geronimo.kernel.service.GeronimoMBeanContext;
   import org.apache.geronimo.kernel.service.GeronimoMBeanEndpoint;
  @@ -79,9 +89,9 @@
    *
    * @version $Revision$ $Date$
    * */
  -public class ConnectionManagerDeployment
  +public class ConnectionManagerDeployment implements GeronimoMBeanTarget, ConnectionManagerFactory,
GBean {
   
  -        implements GeronimoMBeanTarget, ConnectionManagerFactory {
  +    private static final GBeanInfo GBEAN_INFO;
   
       private final static String MBEAN_SERVER_DELEGATE =
               "JMImplementation:type=MBeanServerDelegate";
  @@ -103,12 +113,11 @@
       /**
        * Identifying string used by unshareable resource detection
        */
  -    private String jndiName;
  +    private String name;
       //dependencies
       private RealmBridge realmBridge;
       private ConnectionTracker connectionTracker;
  -
  -    private String globalJNDIName;
  +    private KernelMBean kernel;
   
       //GeronimoMBeanTarget support.
       private GeronimoMBeanContext context;
  @@ -117,17 +126,17 @@
       public ConnectionManagerDeployment() {
       }
   
  -    //constructor primarily for testing.  Connection manager/connection factory will not
be serializable.
       public ConnectionManagerDeployment(boolean useConnectionRequestInfo,
  -     boolean useSubject,
  -     boolean useTransactionCaching,
  -     boolean useLocalTransactions,
  -     boolean useTransactions,
  -     int maxSize,
  -     int blockingTimeout,
  -     RealmBridge realmBridge,
  -     String jndiName,
  -     ConnectionTracker connectionTracker) {
  +                                       boolean useSubject,
  +                                       boolean useTransactionCaching,
  +                                       boolean useLocalTransactions,
  +                                       boolean useTransactions,
  +                                       int maxSize,
  +                                       int blockingTimeout,
  +                                       String name,
  +                                       RealmBridge realmBridge,
  +                                       ConnectionTracker connectionTracker,
  +                                       KernelMBean kernel) {
           this.useConnectionRequestInfo = useConnectionRequestInfo;
           this.useLocalTransactions = useLocalTransactions;
           this.useSubject = useSubject;
  @@ -136,9 +145,9 @@
           this.maxSize = maxSize;
           this.blockingTimeout = blockingTimeout;
           this.realmBridge = realmBridge;
  -        this.jndiName = jndiName;
  +        this.name = name;
           this.connectionTracker = connectionTracker;
  -        setUpConnectionManager(null, null);
  +        this.kernel = kernel;
       }
   
       public void setMBeanContext(GeronimoMBeanContext context) {
  @@ -150,14 +159,29 @@
       }
   
       public void doStart() {
  -        ObjectName connectionManagerName = context.getObjectName();
  +        MBeanServer mbeanServer = null;
  +        if (kernel != null) {
  +            mbeanServer = kernel.getMBeanServer();
  +        } else if (context != null) {
  +            mbeanServer = context.getServer();
  +        } else {
  +            throw new IllegalStateException("Neither kernel nor context is set, but you're
trying to start");
  +        }
  +
           String agentID;
           try {
               ObjectName name = ObjectName.getInstance(MBEAN_SERVER_DELEGATE);
  -            agentID = (String) context.getServer().getAttribute(name, "MBeanServerId");
  +            agentID = (String) mbeanServer.getAttribute(name, "MBeanServerId");
           } catch (Exception e) {
               throw new RuntimeException("Problem getting agentID from MBeanServerDelegate",
e);
           }
  +
  +        ObjectName connectionManagerName = null;
  +        try {
  +            connectionManagerName = ObjectName.getInstance("geronimo.management:j2eeType=ConnectionManager,name="
+ name);
  +        } catch (MalformedObjectNameException e) {
  +            throw new RuntimeException("could not construct an object name for ConnectionManagerDeployment
mbean", e);
  +        }
           setUpConnectionManager(agentID, connectionManagerName);
   
       }
  @@ -217,7 +241,7 @@
           if (connectionTracker != null) {
               stack = new ConnectionTrackingInterceptor(
                       stack,
  -                    jndiName,
  +                    name,
                       connectionTracker,
                       realmBridge);
           }
  @@ -267,12 +291,12 @@
           this.connectionTracker = connectionTracker;
       }
   
  -    public String getJndiName() {
  -        return jndiName;
  +    public String getName() {
  +        return name;
       }
   
  -    public void setJndiName(String jndiName) {
  -        this.jndiName = jndiName;
  +    public void setName(String name) {
  +        this.name = name;
       }
   
       public int getMaxSize() {
  @@ -334,6 +358,45 @@
           this.useTransactionCaching = useTransactionCaching;
       }
   
  +    public KernelMBean getKernel() {
  +        return kernel;
  +    }
  +
  +    public void setKernel(KernelMBean kernel) {
  +        this.kernel = kernel;
  +    }
  +
  +    static {
  +        GBeanInfoFactory infoFactory = new GBeanInfoFactory(ConnectionManagerDeployment.class.getName());
  +
  +        infoFactory.addAttribute(new GAttributeInfo("BlockingTimeout", true));
  +        infoFactory.addAttribute(new GAttributeInfo("Name", true));
  +        infoFactory.addAttribute(new GAttributeInfo("MaxSize", true));
  +        infoFactory.addAttribute(new GAttributeInfo("UseConnectionRequestInfo", true));
  +        infoFactory.addAttribute(new GAttributeInfo("UseTransactions", true));
  +        infoFactory.addAttribute(new GAttributeInfo("UseLocalTransactions", true));
  +        infoFactory.addAttribute(new GAttributeInfo("UseTransactionCaching", true));
  +        infoFactory.addAttribute(new GAttributeInfo("UseSubject", true));
  +
  +        infoFactory.addOperation(new GOperationInfo("getStack"));
  +        infoFactory.addOperation(new GOperationInfo("createConnectionFactory", new String[]{ManagedConnectionFactory.class.getName()}));
  +
  +        infoFactory.addEndpoint(new GEndpointInfo("ConnectionTracker", ConnectionTracker.class.getName()));
  +        infoFactory.addEndpoint(new GEndpointInfo("RealmBridge", RealmBridge.class.getName()));
  +        infoFactory.addEndpoint(new GEndpointInfo("Kernel", KernelMBean.class.getName()));
  +
  +        infoFactory.setConstructor(new GConstructorInfo(
  +                new String[]{"UseConnectionRequestInfo", "UseSubject", "UseTransactionCaching",
"UseLocalTransactions", "UseTransactions",
  +                             "MaxSize", "BlockingTimeout", "Name", "RealmBridge", "ConnectionTracker",
"Kernel"},
  +                new Class[]{Boolean.TYPE, Boolean.TYPE, Boolean.TYPE, Boolean.TYPE, Boolean.TYPE,
  +                            Integer.TYPE, Integer.TYPE, String.class, RealmBridge.class,
ConnectionTracker.class, KernelMBean.class}));
  +        GBEAN_INFO = infoFactory.getBeanInfo();
  +    }
  +
  +    public static GBeanInfo getGBeanInfo() {
  +        return GBEAN_INFO;
  +    }
  +
       public static GeronimoMBeanInfo getGeronimoMBeanInfo() throws Exception {
           GeronimoMBeanInfo mBeanInfo = new GeronimoMBeanInfo();
   
  @@ -353,7 +416,7 @@
           mBeanInfo.addOperationInfo(new GeronimoOperationInfo("getStack"));
   
           mBeanInfo.addOperationInfo(new GeronimoOperationInfo("createConnectionFactory",
  -                new GeronimoParameterInfo[] {new GeronimoParameterInfo("ManagedConnectionFactory",
ManagedConnectionFactory.class, "ManagedConnectionFactory that will create the ConnectionFactory")},
  +                new GeronimoParameterInfo[]{new GeronimoParameterInfo("ManagedConnectionFactory",
ManagedConnectionFactory.class, "ManagedConnectionFactory that will create the ConnectionFactory")},
                   MBeanOperationInfo.ACTION,
                   "PRIVATE OPERATION. Have the supplied ManagedConnectionFactory create a
connection factory"));
           return mBeanInfo;
  
  
  
  1.2       +21 -9     incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialRealm.java
  
  Index: PasswordCredentialRealm.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialRealm.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PasswordCredentialRealm.java	11 Jan 2004 08:28:15 -0000	1.1
  +++ PasswordCredentialRealm.java	20 Jan 2004 06:13:38 -0000	1.2
  @@ -59,14 +59,15 @@
   import java.util.HashMap;
   import java.util.Map;
   import java.util.Set;
  -import java.security.Principal;
   
   import javax.resource.spi.ManagedConnectionFactory;
  -import javax.resource.spi.security.PasswordCredential;
   import javax.security.auth.login.AppConfigurationEntry;
   
  +import org.apache.geronimo.gbean.GBeanInfo;
  +import org.apache.geronimo.gbean.GBeanInfoFactory;
   import org.apache.geronimo.kernel.service.GeronimoAttributeInfo;
   import org.apache.geronimo.kernel.service.GeronimoMBeanInfo;
  +import org.apache.geronimo.security.AbstractSecurityRealm;
   import org.apache.geronimo.security.GeronimoSecurityException;
   import org.apache.geronimo.security.SecurityRealm;
   import org.apache.regexp.RE;
  @@ -79,18 +80,14 @@
    * */
   public class PasswordCredentialRealm implements SecurityRealm {
   
  +    private static final GBeanInfo GBEAN_INFO;
  +
       private String realmName;
   
       ManagedConnectionFactory managedConnectionFactory;
   
       static final String REALM_INSTANCE = "org.apache.connector.outbound.security.PasswordCredentialRealm";
   
  -    public static GeronimoMBeanInfo getGeronimoMBeanInfo() {
  -        GeronimoMBeanInfo mbeanInfo = new GeronimoMBeanInfo();
  -        mbeanInfo.setTargetClass(PasswordCredentialRealm.class);
  -        mbeanInfo.addAttributeInfo(new GeronimoAttributeInfo("Realm", true, true, "Name
of this realm"));
  -        return mbeanInfo;
  -    }
   
       public void setRealmName(String realmName) {
           this.realmName = realmName;
  @@ -136,4 +133,19 @@
           return managedConnectionFactory;
       }
   
  +    static {
  +        GBeanInfoFactory infoFactory = new GBeanInfoFactory(PasswordCredentialRealm.class.getName(),
AbstractSecurityRealm.getGBeanInfo());
  +        GBEAN_INFO = infoFactory.getBeanInfo();
  +    }
  +
  +    public static GBeanInfo getGBeanInfo() {
  +        return GBEAN_INFO;
  +    }
  +
  +    public static GeronimoMBeanInfo getGeronimoMBeanInfo() {
  +        GeronimoMBeanInfo mbeanInfo = new GeronimoMBeanInfo();
  +        mbeanInfo.setTargetClass(PasswordCredentialRealm.class);
  +        mbeanInfo.addAttributeInfo(new GeronimoAttributeInfo("Realm", true, true, "Name
of this realm"));
  +        return mbeanInfo;
  +    }
   }
  
  
  
  1.6       +53 -19    incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
  
  Index: GeronimoWorkManager.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GeronimoWorkManager.java	27 Nov 2003 02:30:21 -0000	1.5
  +++ GeronimoWorkManager.java	20 Jan 2004 06:13:38 -0000	1.6
  @@ -55,6 +55,7 @@
    */
   
   package org.apache.geronimo.connector.work;
  +
   import javax.resource.spi.work.ExecutionContext;
   import javax.resource.spi.work.Work;
   import javax.resource.spi.work.WorkException;
  @@ -67,6 +68,11 @@
   import org.apache.geronimo.connector.work.pool.WorkExecutorPool;
   import org.apache.geronimo.kernel.service.GeronimoMBeanInfo;
   import org.apache.geronimo.kernel.service.GeronimoAttributeInfo;
  +import org.apache.geronimo.gbean.GBeanInfo;
  +import org.apache.geronimo.gbean.GBeanInfoFactory;
  +import org.apache.geronimo.gbean.GAttributeInfo;
  +import org.apache.geronimo.gbean.GOperationInfo;
  +import org.apache.geronimo.gbean.GConstructorInfo;
   
   /**
    * WorkManager implementation which uses under the cover three WorkExecutorPool
  @@ -79,13 +85,15 @@
    * TODO There needs to be better lifecycle support.  The individual pools can be stopped
now, but
    * not restarted AFAIK.
    *
  -* @version $Revision$ $Date$
  + * @version $Revision$ $Date$
    */
   public class GeronimoWorkManager implements WorkManager {
   
       private final static int DEFAULT_MIN_POOL_SIZE = 0;
       private final static int DEFAULT_MAX_POOL_SIZE = 10;
   
  +    private static final GBeanInfo GBEAN_INFO;
  +
       /**
        * Pool of threads used by this WorkManager in order to process
        * the Work instances submitted via the doWork methods.
  @@ -192,13 +200,13 @@
        * @see javax.resource.spi.work.WorkManager#doWork(javax.resource.spi.work.Work, long,
javax.resource.spi.work.ExecutionContext, javax.resource.spi.work.WorkListener)
        */
       public void doWork(
  -        Work work,
  -        long startTimeout,
  -        ExecutionContext execContext,
  -        WorkListener workListener)
  -        throws WorkException {
  +            Work work,
  +            long startTimeout,
  +            ExecutionContext execContext,
  +            WorkListener workListener)
  +            throws WorkException {
           WorkerContext workWrapper =
  -            new WorkerContext(work, startTimeout, execContext, workListener);
  +                new WorkerContext(work, startTimeout, execContext, workListener);
           workWrapper.setThreadPriority(Thread.currentThread().getPriority());
           syncWorkExecutorPool.executeWork(workWrapper);
       }
  @@ -217,13 +225,13 @@
        * @see javax.resource.spi.work.WorkManager#startWork(javax.resource.spi.work.Work,
long, javax.resource.spi.work.ExecutionContext, javax.resource.spi.work.WorkListener)
        */
       public long startWork(
  -        Work work,
  -        long startTimeout,
  -        ExecutionContext execContext,
  -        WorkListener workListener)
  -        throws WorkException {
  +            Work work,
  +            long startTimeout,
  +            ExecutionContext execContext,
  +            WorkListener workListener)
  +            throws WorkException {
           WorkerContext workWrapper =
  -            new WorkerContext(work, startTimeout, execContext, workListener);
  +                new WorkerContext(work, startTimeout, execContext, workListener);
           workWrapper.setThreadPriority(Thread.currentThread().getPriority());
           startWorkExecutorPool.executeWork(workWrapper);
           return System.currentTimeMillis() - workWrapper.getAcceptedTime();
  @@ -242,17 +250,43 @@
        * @see javax.resource.spi.work.WorkManager#scheduleWork(javax.resource.spi.work.Work,
long, javax.resource.spi.work.ExecutionContext, javax.resource.spi.work.WorkListener)
        */
       public void scheduleWork(
  -        Work work,
  -        long startTimeout,
  -        ExecutionContext execContext,
  -        WorkListener workListener)
  -        throws WorkException {
  +            Work work,
  +            long startTimeout,
  +            ExecutionContext execContext,
  +            WorkListener workListener)
  +            throws WorkException {
           WorkerContext workWrapper =
  -            new WorkerContext(work, startTimeout, execContext, workListener);
  +                new WorkerContext(work, startTimeout, execContext, workListener);
           workWrapper.setThreadPriority(Thread.currentThread().getPriority());
           scheduledWorkExecutorPool.executeWork(workWrapper);
       }
   
  +    static {
  +        GBeanInfoFactory infoFactory = new GBeanInfoFactory(GeronimoWorkManager.class.getName());
  +        infoFactory.addAttribute(new GAttributeInfo("SyncThreadCount", true));
  +        infoFactory.addAttribute(new GAttributeInfo("SyncMinimumPoolSize", true));
  +        infoFactory.addAttribute(new GAttributeInfo("SyncMaximumPoolSize", true));
  +        infoFactory.addAttribute(new GAttributeInfo("StartThreadCount", true));
  +        infoFactory.addAttribute(new GAttributeInfo("StartMinimumPoolSize", true));
  +        infoFactory.addAttribute(new GAttributeInfo("StartMaximumPoolSize", true));
  +        infoFactory.addAttribute(new GAttributeInfo("ScheduledThreadCount", true));
  +        infoFactory.addAttribute(new GAttributeInfo("ScheduledMinimumPoolSize", true));
  +        infoFactory.addAttribute(new GAttributeInfo("ScheduledMaximumPoolSize", true));
  +        infoFactory.addOperation(new GOperationInfo("doWork", new String[]{Work.class.getName()}));
  +        infoFactory.addOperation(new GOperationInfo("doWork", new String[]{Work.class.getName(),
Long.TYPE.getName(), ExecutionContext.class.getName(), WorkListener.class.getName()}));
  +        infoFactory.addOperation(new GOperationInfo("startWork", new String[]{Work.class.getName()}));
  +        infoFactory.addOperation(new GOperationInfo("startWork", new String[]{Work.class.getName(),
Long.TYPE.getName(), ExecutionContext.class.getName(), WorkListener.class.getName()}));
  +        infoFactory.addOperation(new GOperationInfo("scheduleWork", new String[]{Work.class.getName()}));
  +        infoFactory.addOperation(new GOperationInfo("scheduleWork", new String[]{Work.class.getName(),
Long.TYPE.getName(), ExecutionContext.class.getName(), WorkListener.class.getName()}));
  +        infoFactory.setConstructor(new GConstructorInfo(
  +                new String[] {"SyncMinimumPoolSize", "SyncMaximumPoolSize", "StartMinimumPoolSize",
"StartMaximumPoolSize", "ScheduledMinimumPoolSize", "ScheduledMaximumPoolSize"},
  +                new Class[] {Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE,
Integer.TYPE}));
  +        GBEAN_INFO = infoFactory.getBeanInfo();
  +    }
  +
  +    public static GBeanInfo getGBeanInfo() {
  +        return GBEAN_INFO;
  +    }
   
       /**
        * Provides the GeronimoMBean description for this class
  
  
  
  1.3       +12 -4     incubator-geronimo/modules/core/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTest.java
  
  Index: ConnectionManagerTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConnectionManagerTest.java	11 Jan 2004 08:28:15 -0000	1.2
  +++ ConnectionManagerTest.java	20 Jan 2004 06:13:38 -0000	1.3
  @@ -74,6 +74,7 @@
   import org.apache.geronimo.connector.outbound.connectiontracking.defaultimpl.DefaultInterceptor;
   import org.apache.geronimo.security.bridge.RealmBridge;
   import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
  +import org.apache.geronimo.kernel.Kernel;
   
   /**
    *
  @@ -90,10 +91,11 @@
       protected boolean useTransactions = true;
       protected int maxSize = 5;
       protected int blockingTimeout = 100;
  -    protected String jndiName = "testCF";
  +    protected String name = "testCF";
       //dependencies
       protected RealmBridge realmBridge = this;
       protected ConnectionTrackingCoordinator connectionTrackingCoordinator;
  +    protected Kernel kernel;
   
       protected TransactionManager transactionManager;
       protected ConnectionManagerDeployment connectionManagerDeployment;
  @@ -107,6 +109,8 @@
   
       protected void setUp() throws Exception {
           connectionTrackingCoordinator = new ConnectionTrackingCoordinator();
  +        kernel = new Kernel("testdomain");
  +        kernel.boot();
           transactionManager = new TransactionManagerImpl();
           mockManagedConnectionFactory = new MockManagedConnectionFactory();
           subject = new Subject();
  @@ -117,9 +121,11 @@
                   useTransactions,
                   maxSize,
                   blockingTimeout,
  +                name,
                   realmBridge,
  -                jndiName,
  -                connectionTrackingCoordinator);
  +                connectionTrackingCoordinator,
  +                kernel);
  +        connectionManagerDeployment.doStart();
           connectionFactory = (MockConnectionFactory)connectionManagerDeployment.createConnectionFactory(mockManagedConnectionFactory);
           defaultComponentContext = new DefaultComponentContext();
           defaultComponentInterceptor = new DefaultComponentInterceptor(this, connectionTrackingCoordinator,
unshareableResources, transactionManager);
  @@ -127,6 +133,8 @@
   
       protected void tearDown() throws Exception {
           connectionTrackingCoordinator = null;
  +        kernel.shutdown();
  +        kernel = null;
           transactionManager = null;
           mockManagedConnectionFactory = null;
           connectionManagerDeployment = null;
  
  
  
  1.4       +64 -3     incubator-geronimo/modules/deployment/src/test-resources/etc/bootstrapped-service.xml
  
  Index: bootstrapped-service.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/test-resources/etc/bootstrapped-service.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- bootstrapped-service.xml	20 Jan 2004 01:36:59 -0000	1.3
  +++ bootstrapped-service.xml	20 Jan 2004 06:13:39 -0000	1.4
  @@ -35,6 +35,70 @@
           <default attribute="GroupsURI" type="java.net.URI">file:./core/src/test-data/data/groups.properties</default>
       </gbean>
   
  +    <gbean class="org.apache.geronimo.security.bridge.CallerIdentityUserPasswordRealmBridge"
objectName="geronimo.security:service=RealmBridge,type=CallerIdentity">
  +        <default attribute="TargetRealm" type="java.lang.String">Foo</default>
  +    </gbean>
  +
  +    <gbean class="org.apache.geronimo.security.bridge.ConfiguredIdentityUserPasswordRealmBridge"
objectName="geronimo.security:service=RealmBridge,type=ConfiguredIdentity">
  +        <default attribute="TargetRealm" type="java.lang.String">Foo</default>
  +        <default attribute="ConfiguredUser" type="java.lang.String">user</default>
  +        <default attribute="ConfiguredPassword" type="java.lang.String">password</default>
  +    </gbean>
  +
  +    <gbean class="org.apache.geronimo.security.bridge.PropertiesFilePrincipalMappingUserPasswordRealmBridge"
objectName="geronimo.security:service=RealmBridge,type=MappedIdentity">
  +        <default attribute="TargetRealm" type="java.lang.String">Foo</default>
  +        <default attribute="PrincipalSourceType" type="java.lang.Class">org.apache.geronimo.security.providers.PropertiesFileUserPrincipal</default>
  +        <default attribute="PrincipalTargetCallbackName" type="java.lang.String">user
name</default>
  +        <default attribute="UserNameSourceType" type="java.lang.Class">org.apache.geronimo.security.providers.PropertiesFileUserPrincipal</default>
  +        <default attribute="UserNameTargetCallbackName" type="java.lang.String">user
name</default>
  +        <default attribute="PasswordSourceType" type="java.lang.Class">org.apache.geronimo.security.providers.PropertiesFileUserPrincipal</default>
  +        <default attribute="PropertyFileURL" type="java.net.URL">file:./core/src/test-data/data/mapping.properties</default>
  +    </gbean>
  +
  +    <!-- transaction -->
  +    <gbean class="org.apache.geronimo.transaction.TransactionManagerProxy" objectName="geronimo.transaction:service=TransactionManager"/>
  +
  +    <!-- connector -->
  +    <gbean class="org.apache.geronimo.connector.work.GeronimoWorkManager" objectName="geronimo.connector:service=WorkManager">
  +        <default attribute="SyncMinimumPoolSize" type="int">0</default>
  +        <default attribute="SyncMaximumPoolSize" type="int">10</default>
  +        <default attribute="StartMinimumPoolSize" type="int">0</default>
  +        <default attribute="StartMaximumPoolSize" type="int">10</default>
  +        <default attribute="ScheduledMinimumPoolSize" type="int">0</default>
  +        <default attribute="ScheduledMaximumPoolSize" type="int">10</default>
  +    </gbean>
  +
  +    <gbean class="org.apache.geronimo.connector.BootstrapContext" objectName="geronimo.connector:role=BootstrapContext">
  +        <endpoint name="WorkManager">
  +            <pattern>geronimo.connector:service=WorkManager</pattern>
  +        </endpoint>
  +        <endpoint name="XATerminator">
  +            <pattern>geronimo.transaction:service=TransactionManager</pattern>
  +        </endpoint>
  +    </gbean>
  +
  +    <gbean class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator"
objectName="geronimo.connector:service=ConnectionTrackingCoordinator"/>
  +
  +    <gbean class="org.apache.geronimo.connector.outbound.ConnectionManagerDeployment"
objectName="geronimo.management:j2eeType=ConnectionManager,name=test">
  +        <default attribute="UseConnectionRequestInfo" type="boolean">false</default>
  +        <default attribute="UseSubject" type="boolean">false</default>
  +        <default attribute="UseTransactionCaching" type="boolean">true</default>
  +        <default attribute="UseLocalTransactions" type="boolean">true</default>
  +        <default attribute="UseTransactions" type="boolean">true</default>
  +        <default attribute="MaxSize" type="int">10</default>
  +        <default attribute="BlockingTimeout" type="int">1000</default>
  +        <default attribute="Name" type="java.lang.String">test</default>
  +        <endpoint name="RealmBridge">
  +            <pattern>geronimo.security:service=RealmBridge,type=CallerIdentity</pattern>
  +        </endpoint>
  +        <endpoint name="ConnectionTracker">
  +            <pattern>geronimo.connector:service=ConnectionTrackingCoordinator</pattern>
  +        </endpoint>
  +        <endpoint name="Kernel">
  +            <pattern>geronimo.boot:role=Kernel</pattern>
  +        </endpoint>
  +    </gbean>
  +
       <!-- web -->
   
       <gbean class="org.apache.geronimo.web.jetty.JettyWebContainer" objectName="geronimo.web:type=WebContainer,container=Jetty">
  @@ -72,9 +136,6 @@
           </endpoint>
       </gbean>
   
  -    <gbean class="org.apache.geronimo.transaction.TransactionManagerProxy" objectName="geronimo.transaction:service=TransactionManager"/>
  -
  -    <gbean class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator"
objectName="geronimo.connector:service=ConnectionTrackingCoordinator"/>
   
       <gbean class="org.apache.geronimo.deployment.util.ExplicitDeployment" objectName="geronimo.app:name=WebConsole">
           <default attribute="ConfigID" type="java.net.URI">org/apache/geronimo/WebConsole</default>
  
  
  

Mime
View raw message