djencks 2004/07/11 14:55:34
Modified: modules/assembly/src/plan j2ee-server-plan.xml
modules/connector project.xml
modules/connector/src/java/org/apache/geronimo/connector
ResourceAdapterWrapper.java
modules/connector/src/java/org/apache/geronimo/connector/deployment
ConnectorModuleBuilder.java
modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean
ResourceAdapterDConfigBean.java
modules/connector/src/java/org/apache/geronimo/connector/work
GeronimoWorkManager.java
modules/connector/src/schema geronimo-connector_1_5.xsd
modules/connector/src/test/org/apache/geronimo/connector
BootstrapContextTest.java MockXATerminator.java
modules/connector/src/test-data/connector_1_5
geronimo-ra.xml
Added: modules/transaction/src/java/org/apache/geronimo/transaction
XAServices.java
modules/connector/src/java/org/apache/geronimo/connector
BootstrapContextImpl.java
Log:
Simplify inbound ra configuration. Supply a GeronimoWorkManager instead of a BootstrapContext
Revision Changes Path
1.1 incubator-geronimo/modules/transaction/src/java/org/apache/geronimo/transaction/XAServices.java
Index: XAServices.java
===================================================================
package org.apache.geronimo.transaction;
import javax.transaction.TransactionManager;
import javax.resource.spi.XATerminator;
/**
*
*
* @version $Revision: 1.1 $ $Date: 2004/07/11 21:55:33 $
*
* */
public interface XAServices extends XATerminator, XAWork {
}
1.34 +6 -11 incubator-geronimo/modules/assembly/src/plan/j2ee-server-plan.xml
Index: j2ee-server-plan.xml
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/assembly/src/plan/j2ee-server-plan.xml,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- j2ee-server-plan.xml 6 Jul 2004 17:20:47 -0000 1.33
+++ j2ee-server-plan.xml 11 Jul 2004 21:55:33 -0000 1.34
@@ -42,7 +42,7 @@
<uri>geronimo/jars/geronimo-connector-1.0-SNAPSHOT.jar</uri>
</dependency>
<dependency>
- <uri>concurrent/jars/concurrent-1.3.2.jar</uri>
+ <uri>concurrent/jars/concurrent-1.3.4.jar</uri>
</dependency>
<dependency>
<uri>geronimo/jars/geronimo-transaction-1.0-SNAPSHOT.jar</uri>
@@ -122,16 +122,11 @@
<gbean name="geronimo.server:type=ConnectionTracker" class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator">
</gbean>
- <gbean name="geronimo.server:type=WorkManager" class="org.apache.geronimo.connector.work.GeronimoWorkManager">
- <attribute name="SyncMaximumPoolSize" type="int">10</attribute>
- <attribute name="StartMaximumPoolSize" type="int">10</attribute>
- <attribute name="ScheduledMaximumPoolSize" type="int">10</attribute>
- <reference name="XAWork">geronimo.server:type=TransactionManager</reference>
- </gbean>
-
- <gbean name="geronimo.server:type=BootstrapContext" class="org.apache.geronimo.connector.BootstrapContext">
- <reference name="WorkManager">geronimo.server:type=WorkManager</reference>
- <reference name="XATerminator">geronimo.server:type=TransactionManager</reference>
+ <gbean name="geronimo.server:type=WorkManager,name=DefaultWorkManager" class="org.apache.geronimo.connector.work.GeronimoWorkManager">
+ <attribute name="syncMaximumPoolSize" type="int">10</attribute>
+ <attribute name="startMaximumPoolSize" type="int">10</attribute>
+ <attribute name="scheduledMaximumPoolSize" type="int">10</attribute>
+ <reference name="xaServices">geronimo.server:type=TransactionManager</reference>
</gbean>
<gbean name="geronimo.server:type=HOWLTransactionLog" class="org.apache.geronimo.transaction.log.HOWLLog">
1.25 +38 -2 incubator-geronimo/modules/connector/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/connector/project.xml,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- project.xml 24 Jun 2004 20:59:46 -0000 1.24
+++ project.xml 11 Jul 2004 21:55:33 -0000 1.25
@@ -56,6 +56,42 @@
<version>1.0-DEV</version>
</dependency>
+ <!-- jdbc timer WorkerPersistence -->
+ <dependency>
+ <groupId>xstream</groupId>
+ <artifactId>xstream</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+
+ <dependency>
+ <!--License is at http://www.extreme.indiana.edu/viewcvs/~checkout~/XPP3/java/LICENSE.txt
-->
+ <!-- it is modified BSD -->
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3</artifactId>
+ <url>http://www.extreme.indiana.edu/xgws/xsoap/xpp</url>
+ <!-- can we get by with 1.1.3.3_min?-->
+ <version>1.1.3.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>axion</groupId>
+ <artifactId>axion</artifactId>
+ <version>1.0-M3-dev</version>
+ <properties>
+ <repository>true</repository>
+ </properties>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-primitives</groupId>
+ <artifactId>commons-primitives</artifactId>
+ <version>1.0</version>
+ <properties>
+ <repository>true</repository>
+ </properties>
+ </dependency>
+
+
<!-- real stuff -->
<dependency>
<groupId>geronimo</groupId>
@@ -155,7 +191,7 @@
<dependency>
<groupId>concurrent</groupId>
<artifactId>concurrent</artifactId>
- <version>1.3.2</version>
+ <version>1.3.4</version>
</dependency>
<dependency>
1.14 +7 -6 incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java
Index: ResourceAdapterWrapper.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ResourceAdapterWrapper.java 25 Jun 2004 21:33:26 -0000 1.13
+++ ResourceAdapterWrapper.java 11 Jul 2004 21:55:33 -0000 1.14
@@ -21,13 +21,14 @@
import javax.resource.ResourceException;
import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.BootstrapContext;
import javax.resource.spi.ResourceAdapter;
import javax.resource.spi.ResourceAdapterAssociation;
-import javax.resource.spi.BootstrapContext;
import javax.resource.spi.ResourceAdapterInternalException;
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.transaction.xa.XAResource;
+import org.apache.geronimo.connector.work.GeronimoWorkManager;
import org.apache.geronimo.gbean.DynamicGBean;
import org.apache.geronimo.gbean.DynamicGBeanDelegate;
import org.apache.geronimo.gbean.GBeanInfo;
@@ -68,9 +69,9 @@
public ResourceAdapterWrapper(final Class resourceAdapterClass,
final Map activationSpecInfoMap,
- final BootstrapContext bootstrapContext) throws InstantiationException,
IllegalAccessException {
+ final GeronimoWorkManager workManager) throws InstantiationException,
IllegalAccessException {
this.resourceAdapterClass = resourceAdapterClass;
- this.bootstrapContext = bootstrapContext;
+ this.bootstrapContext = new BootstrapContextImpl(workManager);
this.activationSpecInfoMap = activationSpecInfoMap;
resourceAdapter = (ResourceAdapter) resourceAdapterClass.newInstance();
delegate = new DynamicGBeanDelegate();
@@ -140,13 +141,13 @@
infoFactory.addAttribute("resourceAdapterClass", Class.class, true);
infoFactory.addAttribute("activationSpecInfoMap", Map.class, true);
- infoFactory.addReference("bootstrapContext", BootstrapContext.class);
+ infoFactory.addReference("workManager", GeronimoWorkManager.class);
infoFactory.addOperation("registerResourceAdapterAssociation", new Class[]{ResourceAdapterAssociation.class});
infoFactory.addInterface(ResourceAdapter.class);
- infoFactory.setConstructor(new String[]{"resourceAdapterClass", "activationSpecInfoMap",
"bootstrapContext"});
+ infoFactory.setConstructor(new String[]{"resourceAdapterClass", "activationSpecInfoMap",
"workManager"});
GBEAN_INFO = infoFactory.getBeanInfo();
}
1.1 incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/BootstrapContextImpl.java
Index: BootstrapContextImpl.java
===================================================================
/**
*
* Copyright 2003-2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.geronimo.connector;
import java.util.Timer;
import javax.resource.spi.UnavailableException;
import javax.resource.spi.XATerminator;
import javax.resource.spi.work.WorkManager;
import org.apache.geronimo.connector.work.GeronimoWorkManager;
/**
* GBean BootstrapContext implementation that refers to externally configured WorkManager
* and XATerminator gbeans.
*
* @version $Revision: 1.1 $ $Date: 2004/07/11 21:55:33 $
*/
public class BootstrapContextImpl implements javax.resource.spi.BootstrapContext {
private final GeronimoWorkManager workManager;
/**
* Normal constructor for use as a GBean.
* @param workManager
*/
public BootstrapContextImpl(final GeronimoWorkManager workManager) {
this.workManager = workManager;
}
/**
* @see javax.resource.spi.BootstrapContext#getWorkManager()
*/
public WorkManager getWorkManager() {
return workManager;
}
/**
* @see javax.resource.spi.BootstrapContext#getXATerminator()
*/
public XATerminator getXATerminator() {
return workManager.getXATerminator();
}
/**
* @see javax.resource.spi.BootstrapContext#createTimer()
*/
public Timer createTimer() throws UnavailableException {
return new Timer();
}
// public static final GBeanInfo GBEAN_INFO;
//
// static {
// GBeanInfoFactory infoFactory = new GBeanInfoFactory(BootstrapContext.class);
// //adding interface does not work, creates attributes for references???
//// infoFactory.addInterface(javax.resource.spi.BootstrapContext.class);
//
// infoFactory.addOperation("createTimer");
// infoFactory.addOperation("getWorkManager");
// infoFactory.addOperation("getXATerminator");
//
// infoFactory.addReference("WorkManager", WorkManager.class);
// infoFactory.addReference("XATerminator", XATerminator.class);
//
// infoFactory.setConstructor(new String[]{"WorkManager", "XATerminator"});
//
// GBEAN_INFO = infoFactory.getBeanInfo();
// }
//
// public static GBeanInfo getGBeanInfo() {
// return GBEAN_INFO;
// }
}
1.6 +43 -41 incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Index: ConnectorModuleBuilder.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ConnectorModuleBuilder.java 6 Jul 2004 17:19:13 -0000 1.5
+++ ConnectorModuleBuilder.java 11 Jul 2004 21:55:33 -0000 1.6
@@ -36,6 +36,7 @@
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
import java.util.zip.ZipEntry;
+
import javax.management.AttributeNotFoundException;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
@@ -44,12 +45,8 @@
import org.apache.geronimo.common.propertyeditor.PropertyEditors;
import org.apache.geronimo.common.xml.XmlBeansUtil;
-import org.apache.geronimo.connector.AdminObjectWrapper;
-import org.apache.geronimo.connector.ResourceAdapterWrapper;
-import org.apache.geronimo.connector.ActivationSpecWrapper;
import org.apache.geronimo.connector.ActivationSpecInfo;
import org.apache.geronimo.connector.outbound.GenericConnectionManager;
-import org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper;
import org.apache.geronimo.connector.outbound.connectionmanagerconfig.LocalTransactions;
import org.apache.geronimo.connector.outbound.connectionmanagerconfig.NoPool;
import org.apache.geronimo.connector.outbound.connectionmanagerconfig.NoTransactions;
@@ -82,15 +79,15 @@
import org.apache.geronimo.xbeans.geronimo.GerDependencyType;
import org.apache.geronimo.xbeans.geronimo.GerGbeanType;
import org.apache.geronimo.xbeans.geronimo.GerResourceadapterType;
+import org.apache.geronimo.xbeans.j2ee.ActivationspecType;
import org.apache.geronimo.xbeans.j2ee.AdminobjectType;
import org.apache.geronimo.xbeans.j2ee.ConfigPropertyType;
import org.apache.geronimo.xbeans.j2ee.ConnectionDefinitionType;
import org.apache.geronimo.xbeans.j2ee.ConnectorDocument;
import org.apache.geronimo.xbeans.j2ee.ConnectorType;
-import org.apache.geronimo.xbeans.j2ee.ResourceadapterType;
import org.apache.geronimo.xbeans.j2ee.MessagelistenerType;
-import org.apache.geronimo.xbeans.j2ee.ActivationspecType;
import org.apache.geronimo.xbeans.j2ee.RequiredConfigPropertyType;
+import org.apache.geronimo.xbeans.j2ee.ResourceadapterType;
import org.apache.geronimo.xbeans.j2ee.connector_1_0.ConfigPropertyType10;
import org.apache.geronimo.xbeans.j2ee.connector_1_0.ConnectorDocument10;
import org.apache.geronimo.xbeans.j2ee.connector_1_0.ConnectorType10;
@@ -105,6 +102,7 @@
public class ConnectorModuleBuilder implements ModuleBuilder {
private static final String BASE_REALM_BRIDGE_NAME = "geronimo.security:service=RealmBridge,name=";
private static final String BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME = "geronimo.security:service=Realm,type=PasswordCredential,name=";
+ private static final String BASE_WORK_MANAGER_NAME = "geronimo.server:type=WorkManager,name=";
public XmlObject getDeploymentPlan(URL module) throws XmlException {
try {
@@ -333,7 +331,7 @@
String resourceAdapterName = geronimoResourceAdapter.getResourceadapterInstance().getResourceadapterName();
// Create the resource adapter gbean
- GBeanInfoFactory resourceAdapterInfoFactory = new GBeanInfoFactory(ResourceAdapterWrapper.class,
ResourceAdapterWrapper.getGBeanInfo());
+ GBeanInfoFactory resourceAdapterInfoFactory = new GBeanInfoFactory("org.apache.geronimo.connector.ResourceAdapterWrapper",
cl);
ConfigProperty[] configProperties = getConfigProperties(resourceadapter.getConfigPropertyArray(),
geronimoResourceAdapter.getResourceadapterInstance().getConfigPropertySettingArray());
GBeanMBean resourceAdapterGBean = setUpDynamicGBean(resourceAdapterInfoFactory,
configProperties, cl);
@@ -350,12 +348,12 @@
throw new DeploymentException("Could not set ResourceAdapterClass", e);
}
- // set the bootstrap context name
+ // set the work manager name
try {
- resourceAdapterGBean.setReferencePattern("bootstrapContext",
- ObjectName.getInstance(geronimoResourceAdapter.getResourceadapterInstance().getBootstrapcontextName().getStringValue()));
+ resourceAdapterGBean.setReferencePattern("workManager",
+ ObjectName.getInstance(BASE_WORK_MANAGER_NAME + geronimoResourceAdapter.getResourceadapterInstance().getWorkmanagerName().getStringValue()));
} catch (MalformedObjectNameException e) {
- throw new DeploymentException("Could not create object name for bootstrap
context", e);
+ throw new DeploymentException("Could not create object name for work manager",
e);
}
// add it
@@ -380,32 +378,36 @@
// first we need a map of the published outbound adaptors by connection factory
interface type
Map connectionDefinitions = new HashMap();
- for (int j = 0; j < resourceadapter.getOutboundResourceadapter().getConnectionDefinitionArray().length;
j++) {
- ConnectionDefinitionType connectionDefinition = resourceadapter.getOutboundResourceadapter().getConnectionDefinitionArray(j);
- connectionDefinitions.put(connectionDefinition.getConnectionfactoryInterface().getStringValue(),
connectionDefinition);
- }
+ if (resourceadapter.isSetOutboundResourceadapter()) {
+ for (int j = 0; j < resourceadapter.getOutboundResourceadapter().getConnectionDefinitionArray().length;
j++) {
+ ConnectionDefinitionType connectionDefinition = resourceadapter.getOutboundResourceadapter().getConnectionDefinitionArray(j);
+ connectionDefinitions.put(connectionDefinition.getConnectionfactoryInterface().getStringValue(),
connectionDefinition);
+ }
// ManagedConnectionFactory setup
- for (int i = 0; i < geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray().length;
i++) {
- GerConnectionDefinitionType geronimoConnectionDefinition = geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray(i);
- assert geronimoConnectionDefinition != null: "Null GeronimoConnectionDefinition";
-
- String connectionFactoryInterfaceName = geronimoConnectionDefinition.getConnectionfactoryInterface().getStringValue();
- ConnectionDefinitionType connectionDefinition = (ConnectionDefinitionType)
connectionDefinitions.get(connectionFactoryInterfaceName);
- if (connectionDefinition == null) {
- throw new DeploymentException("No connection definition for ConnectionFactory
class: " + connectionFactoryInterfaceName);
- }
+ if (geronimoResourceAdapter.isSetOutboundResourceadapter()) {
+ for (int i = 0; i < geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray().length;
i++) {
+ GerConnectionDefinitionType geronimoConnectionDefinition = geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray(i);
+ assert geronimoConnectionDefinition != null: "Null GeronimoConnectionDefinition";
+
+ String connectionFactoryInterfaceName = geronimoConnectionDefinition.getConnectionfactoryInterface().getStringValue();
+ ConnectionDefinitionType connectionDefinition = (ConnectionDefinitionType)
connectionDefinitions.get(connectionFactoryInterfaceName);
+ if (connectionDefinition == null) {
+ throw new DeploymentException("No connection definition for ConnectionFactory
class: " + connectionFactoryInterfaceName);
+ }
- for (int j = 0; j < geronimoConnectionDefinition.getConnectiondefinitionInstanceArray().length;
j++) {
- GerConnectiondefinitionInstanceType connectionfactoryInstance = geronimoConnectionDefinition.getConnectiondefinitionInstanceArray()[j];
- String managedConnectionFactoryClass = connectionDefinition.getManagedconnectionfactoryClass().getStringValue();
- String connectionFactoryInterface = connectionDefinition.getConnectionfactoryInterface().getStringValue();
- String connectionFactoryImplClass = connectionDefinition.getConnectionfactoryImplClass().getStringValue();
- String connectionInterface = connectionDefinition.getConnectionInterface().getStringValue();
- String connectionImplClass = connectionDefinition.getConnectionImplClass().getStringValue();
- ConfigProperty[] configProperties = getConfigProperties(connectionDefinition.getConfigPropertyArray(),
connectionfactoryInstance.getConfigPropertySettingArray());
+ for (int j = 0; j < geronimoConnectionDefinition.getConnectiondefinitionInstanceArray().length;
j++) {
+ GerConnectiondefinitionInstanceType connectionfactoryInstance =
geronimoConnectionDefinition.getConnectiondefinitionInstanceArray()[j];
+ String managedConnectionFactoryClass = connectionDefinition.getManagedconnectionfactoryClass().getStringValue();
+ String connectionFactoryInterface = connectionDefinition.getConnectionfactoryInterface().getStringValue();
+ String connectionFactoryImplClass = connectionDefinition.getConnectionfactoryImplClass().getStringValue();
+ String connectionInterface = connectionDefinition.getConnectionInterface().getStringValue();
+ String connectionImplClass = connectionDefinition.getConnectionImplClass().getStringValue();
+ ConfigProperty[] configProperties = getConfigProperties(connectionDefinition.getConfigPropertyArray(),
connectionfactoryInstance.getConfigPropertySettingArray());
- addOutboundGBeans(earContext, resourceAdapterObjectName, connectionfactoryInstance,
configProperties, managedConnectionFactoryClass, connectionFactoryInterface, connectionFactoryImplClass,
connectionInterface, connectionImplClass, cl);
+ addOutboundGBeans(earContext, resourceAdapterObjectName, connectionfactoryInstance,
configProperties, managedConnectionFactoryClass, connectionFactoryInterface, connectionFactoryImplClass,
connectionInterface, connectionImplClass, cl);
+ }
+ }
}
}
@@ -434,7 +436,7 @@
GerAdminobjectInstanceType gerAdminObjectInstance = gerAdminObject.getAdminobjectInstanceArray()[j];
// create the adminObjectGBean
- GBeanInfoFactory adminObjectInfoFactory = new GBeanInfoFactory(AdminObjectWrapper.class,
AdminObjectWrapper.getGBeanInfo());
+ GBeanInfoFactory adminObjectInfoFactory = new GBeanInfoFactory("org.apache.geronimo.connector.AdminObjectWrapper",
cl);
ConfigProperty[] configProperties = getConfigProperties(adminObject.getConfigPropertyArray(),
gerAdminObjectInstance.getConfigPropertySettingArray());
GBeanMBean adminObjectGBean = setUpDynamicGBean(adminObjectInfoFactory,
configProperties, cl);
@@ -468,7 +470,7 @@
MessagelistenerType messagelistenerType = messagelistenerArray[i];
ActivationspecType activationspec = messagelistenerType.getActivationspec();
String activationSpecClassName = activationspec.getActivationspecClass().getStringValue();
- GBeanInfoFactory infoFactory = new GBeanInfoFactory(ActivationSpecWrapper.class,
ActivationSpecWrapper.getGBeanInfo());
+ GBeanInfoFactory infoFactory = new GBeanInfoFactory("org.apache.geronimo.connector.ActivationSpecWrapper",
cl);
for (int j = 0; j < activationspec.getRequiredConfigPropertyArray().length;
j++) {
RequiredConfigPropertyType requiredConfigPropertyType = activationspec.getRequiredConfigPropertyArray()[j];
String propertyName = requiredConfigPropertyType.getConfigPropertyName().getStringValue();
@@ -590,7 +592,7 @@
gbean.setAttribute(name, value);
}
- private ObjectName configureConnectionManager(GerConnectiondefinitionInstanceType connectionfactoryInstance,
EARContext earContext) throws DeploymentException {
+ private ObjectName configureConnectionManager(GerConnectiondefinitionInstanceType connectionfactoryInstance,
EARContext earContext, ClassLoader cl) throws DeploymentException {
if (connectionfactoryInstance.getConnectionmanagerRef() != null) {
//we don't configure anything, just use the supplied gbean
try {
@@ -604,7 +606,7 @@
GerConnectionmanagerType connectionManager = connectionfactoryInstance.getConnectionmanager();
GBeanMBean connectionManagerGBean;
try {
- connectionManagerGBean = new GBeanMBean(GenericConnectionManager.GBEAN_INFO,
GenericConnectionManager.class.getClassLoader());
+ connectionManagerGBean = new GBeanMBean(GBeanInfo.getGBeanInfo("org.apache.geronimo.connector.outbound.GenericConnectionManager",
cl), cl);
} catch (InvalidConfigurationException e) {
throw new DeploymentException("Unable to create GMBean", e);
}
@@ -670,10 +672,10 @@
private void addOutboundGBeans(EARContext earContext, ObjectName resourceAdapterObjectName,
GerConnectiondefinitionInstanceType connectionfactoryInstance, ConfigProperty[] configProperties,
String managedConnectionFactoryClass, String connectionFactoryInterface, String connectionFactoryImplClass,
String connectionInterface, String connectionImplClass, ClassLoader cl) throws DeploymentException
{
// ConnectionManager
- ObjectName connectionManagerObjectName = configureConnectionManager(connectionfactoryInstance,
earContext);
+ ObjectName connectionManagerObjectName = configureConnectionManager(connectionfactoryInstance,
earContext, cl);
// ManagedConnectionFactory
- GBeanInfoFactory managedConnectionFactoryInfoFactory = new GBeanInfoFactory(ManagedConnectionFactoryWrapper.class,
ManagedConnectionFactoryWrapper.getGBeanInfo());
+ GBeanInfoFactory managedConnectionFactoryInfoFactory = new GBeanInfoFactory("org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper",
cl);
GBeanMBean managedConnectionFactoryGBean = setUpDynamicGBean(managedConnectionFactoryInfoFactory,
configProperties, cl);
try {
managedConnectionFactoryGBean.setAttribute("ManagedConnectionFactoryClass",
cl.loadClass(managedConnectionFactoryClass));
@@ -686,7 +688,7 @@
managedConnectionFactoryGBean.setReferencePattern("ResourceAdapterWrapper",
resourceAdapterObjectName);
}
managedConnectionFactoryGBean.setReferencePattern("ConnectionManagerFactory",
connectionManagerObjectName);
- if (connectionfactoryInstance.getCredentialInterface() != null && PasswordCredential.class.getName().equals(connectionfactoryInstance.getCredentialInterface().getStringValue()))
{
+ if (connectionfactoryInstance.getCredentialInterface() != null && "javax.resource.spi.security.PasswordCredential".equals(connectionfactoryInstance.getCredentialInterface().getStringValue()))
{
GBeanMBean realmGBean = new GBeanMBean(PasswordCredentialRealm.getGBeanInfo(),
cl);
realmGBean.setAttribute("RealmName", BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME
+ connectionfactoryInstance.getName());
ObjectName realmObjectNam = ObjectName.getInstance(BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME
+ connectionfactoryInstance.getName());
1.11 +7 -7 incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ResourceAdapterDConfigBean.java
Index: ResourceAdapterDConfigBean.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ResourceAdapterDConfigBean.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ResourceAdapterDConfigBean.java 10 Mar 2004 09:58:31 -0000 1.10
+++ ResourceAdapterDConfigBean.java 11 Jul 2004 21:55:33 -0000 1.11
@@ -54,8 +54,8 @@
if (getResourceadapterInstance() == null) {
resourceadapter.addNewResourceadapterInstance();
}
- if (getResourceadapterInstance().getBootstrapcontextName() == null) {
- getResourceadapterInstance().addNewBootstrapcontextName();
+ if (getResourceadapterInstance().getWorkmanagerName() == null) {
+ getResourceadapterInstance().addNewWorkmanagerName();
}
ConfigPropertiesHelper.initializeConfigSettings(ddBean, new ConfigPropertiesHelper.ConfigPropertiesSource()
{
public GerConfigPropertySettingType[] getConfigPropertySettingArray() {
@@ -155,12 +155,12 @@
getResourceadapterInstance().setResourceadapterName(resourceAdapterName);
}
- public String getBootstrapContext() {
- return getResourceadapterInstance().getBootstrapcontextName().getStringValue();
+ public String getWorkManager() {
+ return getResourceadapterInstance().getWorkmanagerName().getStringValue();
}
- public void setBootstrapContext(String bootstrapContext) {
- getResourceadapterInstance().getBootstrapcontextName().setStringValue(bootstrapContext);
+ public void setWorkManager(String workManager) {
+ getResourceadapterInstance().getWorkmanagerName().setStringValue(workManager);
}
public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException {
1.9 +25 -18 incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
Index: GeronimoWorkManager.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- GeronimoWorkManager.java 6 Jul 2004 17:15:54 -0000 1.8
+++ GeronimoWorkManager.java 11 Jul 2004 21:55:34 -0000 1.9
@@ -23,6 +23,7 @@
import javax.resource.spi.work.WorkException;
import javax.resource.spi.work.WorkListener;
import javax.resource.spi.work.WorkManager;
+import javax.resource.spi.XATerminator;
import EDU.oswego.cs.dl.util.concurrent.Executor;
import org.apache.geronimo.connector.work.pool.NullWorkExecutorPool;
@@ -35,7 +36,7 @@
import org.apache.geronimo.gbean.GBeanInfoFactory;
import org.apache.geronimo.gbean.GBeanLifecycle;
import org.apache.geronimo.gbean.WaitingException;
-import org.apache.geronimo.transaction.XAWork;
+import org.apache.geronimo.transaction.XAServices;
/**
* WorkManager implementation which uses under the cover three WorkExecutorPool
@@ -69,7 +70,7 @@
*/
private WorkExecutorPool scheduledWorkExecutorPool;
- private final XAWork xaWork;
+ private final XAServices xaServices;
private final WorkExecutor scheduleWorkExecutor = new ScheduleWorkExecutor();
private final WorkExecutor startWorkExecutor = new StartWorkExecutor();
@@ -82,15 +83,15 @@
this(DEFAULT_POOL_SIZE, null);
}
- public GeronimoWorkManager(int size, XAWork xaWork) {
- this(size, size, size, xaWork);
+ public GeronimoWorkManager(int size, XAServices xaServices) {
+ this(size, size, size, xaServices);
}
- public GeronimoWorkManager(int syncSize, int startSize, int schedSize, XAWork xaWork)
{
+ public GeronimoWorkManager(int syncSize, int startSize, int schedSize, XAServices xaServices)
{
syncWorkExecutorPool = new NullWorkExecutorPool(syncSize);
startWorkExecutorPool = new NullWorkExecutorPool(startSize);
scheduledWorkExecutorPool = new NullWorkExecutorPool(schedSize);
- this.xaWork = xaWork;
+ this.xaServices = xaServices;
}
public void doStart() throws WaitingException, Exception {
@@ -113,6 +114,10 @@
}
}
+ public XATerminator getXATerminator() {
+ return xaServices;
+ }
+
public int getSyncThreadCount() {
return syncWorkExecutorPool.getPoolSize();
}
@@ -166,7 +171,7 @@
WorkListener workListener)
throws WorkException {
WorkerContext workWrapper =
- new WorkerContext(work, startTimeout, execContext, xaWork, workListener);
+ new WorkerContext(work, startTimeout, execContext, xaServices, workListener);
workWrapper.setThreadPriority(Thread.currentThread().getPriority());
executeWork(workWrapper, syncWorkExecutor, syncWorkExecutorPool);
}
@@ -191,7 +196,7 @@
WorkListener workListener)
throws WorkException {
WorkerContext workWrapper =
- new WorkerContext(work, startTimeout, execContext, xaWork, workListener);
+ new WorkerContext(work, startTimeout, execContext, xaServices, workListener);
workWrapper.setThreadPriority(Thread.currentThread().getPriority());
executeWork(workWrapper, startWorkExecutor, startWorkExecutorPool);
return System.currentTimeMillis() - workWrapper.getAcceptedTime();
@@ -216,7 +221,7 @@
WorkListener workListener)
throws WorkException {
WorkerContext workWrapper =
- new WorkerContext(work, startTimeout, execContext, xaWork, workListener);
+ new WorkerContext(work, startTimeout, execContext, xaServices, workListener);
workWrapper.setThreadPriority(Thread.currentThread().getPriority());
executeWork(workWrapper, scheduleWorkExecutor, scheduledWorkExecutorPool);
}
@@ -251,17 +256,19 @@
GBeanInfoFactory infoFactory = new GBeanInfoFactory(GeronimoWorkManager.class);
infoFactory.addInterface(WorkManager.class);
- infoFactory.addAttribute("SyncMaximumPoolSize", Integer.TYPE, true);
- infoFactory.addAttribute("StartMaximumPoolSize", Integer.TYPE, true);
- infoFactory.addAttribute("ScheduledMaximumPoolSize", Integer.TYPE, true);
+ infoFactory.addAttribute("syncMaximumPoolSize", Integer.TYPE, true);
+ infoFactory.addAttribute("startMaximumPoolSize", Integer.TYPE, true);
+ infoFactory.addAttribute("scheduledMaximumPoolSize", Integer.TYPE, true);
+
+ infoFactory.addOperation("getXATerminator");
- infoFactory.addReference("XAWork", XAWork.class);
+ infoFactory.addReference("xaServices", XAServices.class);
infoFactory.setConstructor(new String[]{
- "SyncMaximumPoolSize",
- "StartMaximumPoolSize",
- "ScheduledMaximumPoolSize",
- "XAWork"});
+ "syncMaximumPoolSize",
+ "startMaximumPoolSize",
+ "scheduledMaximumPoolSize",
+ "xaServices"});
GBEAN_INFO = infoFactory.getBeanInfo();
}
1.15 +1 -1 incubator-geronimo/modules/connector/src/schema/geronimo-connector_1_5.xsd
Index: geronimo-connector_1_5.xsd
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/connector/src/schema/geronimo-connector_1_5.xsd,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- geronimo-connector_1_5.xsd 25 Jun 2004 21:33:26 -0000 1.14
+++ geronimo-connector_1_5.xsd 11 Jul 2004 21:55:34 -0000 1.15
@@ -424,7 +424,7 @@
type="ger:config-property-settingType"
minOccurs="0"
maxOccurs="unbounded"/>
- <xsd:element name="bootstrapcontext-name"
+ <xsd:element name="workmanager-name"
type="j2ee:string"/>
</xsd:sequence>
</xsd:complexType>
1.5 +14 -17 incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/BootstrapContextTest.java
Index: BootstrapContextTest.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/BootstrapContextTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BootstrapContextTest.java 12 Jun 2004 18:43:31 -0000 1.4
+++ BootstrapContextTest.java 11 Jul 2004 21:55:34 -0000 1.5
@@ -18,52 +18,49 @@
package org.apache.geronimo.connector;
import java.util.Timer;
+
import javax.resource.spi.XATerminator;
import javax.resource.spi.work.WorkManager;
import junit.framework.TestCase;
+import org.apache.geronimo.connector.work.GeronimoWorkManager;
+import org.apache.geronimo.transaction.XAServices;
/**
- * Unit tests for {@link BootstrapContext}
+ * Unit tests for {@link BootstrapContextImpl}
* @version $Revision$ $Date$
*/
public class BootstrapContextTest extends TestCase {
/**
- * Creates a new instance of BootstrapContextTest
- * @param name the name of the test
- */
- public BootstrapContextTest(String name) {
- super(name);
- }
-
- /**
* Tests get and set work manager
*/
public void testGetSetWorkManager() {
- MockWorkManager manager = new MockWorkManager("testGetSetWorkManager");
- BootstrapContext context = new BootstrapContext(manager, null);
+ XAServices xaServices = new MockXATerminator("MockXATerminator");
+ GeronimoWorkManager manager = new GeronimoWorkManager(1, xaServices);
+ BootstrapContextImpl context = new BootstrapContextImpl(manager);
WorkManager wm = context.getWorkManager();
- assertTrue("Make sure it is the same object", manager.equals(wm));
+ assertSame("Make sure it is the same object", manager, wm);
}
/**
* Tests get and set XATerminator
*/
public void testGetSetXATerminator() {
- MockXATerminator t = new MockXATerminator("testGetSetXATerminator");
- BootstrapContext context = new BootstrapContext(null, t);
+ XAServices xaServices = new MockXATerminator("MockXATerminator");
+ GeronimoWorkManager manager = new GeronimoWorkManager(1, xaServices);
+ BootstrapContextImpl context = new BootstrapContextImpl(manager);
XATerminator xat = context.getXATerminator();
- assertTrue("Make sure it is the same object", t.equals(xat));
+ assertSame("Make sure it is the same object", xaServices, xat);
}
/**
* Tests getTimer
*/
public void testGetTimer() throws Exception {
- BootstrapContext context = new BootstrapContext();
+ BootstrapContextImpl context = new BootstrapContextImpl(null);
Timer t = context.createTimer();
assertNotNull("Object is not null", t);
}
1.4 +12 -2 incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/MockXATerminator.java
Index: MockXATerminator.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/MockXATerminator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MockXATerminator.java 10 Mar 2004 09:58:33 -0000 1.3
+++ MockXATerminator.java 11 Jul 2004 21:55:34 -0000 1.4
@@ -20,13 +20,17 @@
import javax.resource.spi.XATerminator;
import javax.transaction.xa.XAException;
import javax.transaction.xa.Xid;
+import javax.transaction.InvalidTransactionException;
+import javax.transaction.SystemException;
+
+import org.apache.geronimo.transaction.XAServices;
/**
* Dummy implementation of XATerminator interface for use in
* {@link BootstrapContextTest}
* @version $Revision$ $Date$
*/
-public class MockXATerminator implements XATerminator {
+public class MockXATerminator implements XAServices {
private String id = null;
@@ -63,6 +67,12 @@
}
public void rollback(Xid xid) throws XAException {
+ }
+
+ public void begin(Xid xid, long txTimeout) throws XAException, InvalidTransactionException,
SystemException {
+ }
+
+ public void end(Xid xid) throws XAException, SystemException {
}
}
1.20 +6 -11 incubator-geronimo/modules/connector/src/test-data/connector_1_5/geronimo-ra.xml
Index: geronimo-ra.xml
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test-data/connector_1_5/geronimo-ra.xml,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- geronimo-ra.xml 6 Jul 2004 17:19:14 -0000 1.19
+++ geronimo-ra.xml 11 Jul 2004 21:55:34 -0000 1.20
@@ -24,7 +24,7 @@
<resourceadapter-instance>
<resourceadapter-name>testRA</resourceadapter-name>
<config-property-setting name="RAStringProperty">NewStringValue</config-property-setting>
- <bootstrapcontext-name>geronimo.connector:role=BootstrapContext</bootstrapcontext-name>
+ <workmanager-name>DefaultWorkManager</workmanager-name>
</resourceadapter-instance>
<outbound-resourceadapter>
<connection-definition>
@@ -104,16 +104,11 @@
<gbean name="geronimo.connector:service=ConnectionTracker" class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator">
</gbean>
- <gbean name="geronimo.connector:service=WorkManager" class="org.apache.geronimo.connector.work.GeronimoWorkManager">
- <attribute name="SyncMaximumPoolSize" type="int">10</attribute>
- <attribute name="StartMaximumPoolSize" type="int">10</attribute>
- <attribute name="ScheduledMaximumPoolSize" type="int">10</attribute>
- <reference name="XAWork">geronimo.server:type=TransactionManager</reference>
- </gbean>
-
- <gbean name="geronimo.connector:role=BootstrapContext" class="org.apache.geronimo.connector.BootstrapContext">
- <reference name="WorkManager">geronimo.connector:service=WorkManager</reference>
- <reference name="XATerminator">geronimo.server:type=TransactionManager</reference>
+ <gbean name="geronimo.server:type=WorkManager,name=DefaultWorkManager" class="org.apache.geronimo.connector.work.GeronimoWorkManager">
+ <attribute name="syncMaximumPoolSize" type="int">10</attribute>
+ <attribute name="startMaximumPoolSize" type="int">10</attribute>
+ <attribute name="scheduledMaximumPoolSize" type="int">10</attribute>
+ <reference name="xaServices">geronimo.server:type=TransactionManager</reference>
</gbean>
<gbean name="geronimo.server:type=TransactionManager" class="org.apache.geronimo.transaction.GeronimoTransactionManager">
|