dain 2004/04/13 21:01:25
Modified:
modules/connector/src/java/org/apache/geronimo/connector/deployment
AbstractRARConfigBuilder.java
modules/connector/src/java/org/apache/geronimo/connector/outbound
ConnectionManagerDeployment.java
modules/connector/src/schema geronimo-connector_1_5.xsd
Log:
Added support for dependencies to the geronimo-ra.xml file
Commented out support for connection pooling as the code is simply broken
right now
Revision Changes Path
1.13 +28 -3
incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/AbstractRARConfigBuilder.java
Index: AbstractRARConfigBuilder.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/AbstractRARConfigBuilder.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- AbstractRARConfigBuilder.java 3 Apr 2004 22:37:57 -0000 1.12
+++ AbstractRARConfigBuilder.java 14 Apr 2004 04:01:24 -0000 1.13
@@ -31,15 +31,14 @@
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
import java.util.jar.JarOutputStream;
-
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
+import org.apache.geronimo.common.xml.XmlBeansUtil;
import org.apache.geronimo.deployment.ConfigurationBuilder;
import org.apache.geronimo.deployment.DeploymentContext;
import org.apache.geronimo.deployment.DeploymentException;
import org.apache.geronimo.deployment.service.GBeanHelper;
-import org.apache.geronimo.common.xml.XmlBeansUtil;
import org.apache.geronimo.gbean.GAttributeInfo;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoFactory;
@@ -50,6 +49,7 @@
import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
import org.apache.geronimo.xbeans.geronimo.GerConnectorType;
import org.apache.geronimo.xbeans.geronimo.GerGbeanType;
+import org.apache.geronimo.xbeans.geronimo.GerDependencyType;
import org.apache.xmlbeans.SchemaType;
import org.apache.xmlbeans.SchemaTypeLoader;
import org.apache.xmlbeans.XmlBeans;
@@ -179,6 +179,11 @@
throw new DeploymentException(e);
}
+ GerDependencyType[] dependencies =
geronimoConnector.getDependencyArray();
+ for (int i = 0; i < dependencies.length; i++) {
+ context.addDependency(getDependencyURI(dependencies[i]));
+ }
+
XmlObject genericConnectorDocument = generateClassPath(configID,
module, context);
ClassLoader cl = context.getClassLoader(repository);
@@ -207,6 +212,26 @@
}
abstract void addConnectorGBeans(DeploymentContext context, XmlObject
gerericConnectorDocument, GerConnectorType geronimoConnector, ClassLoader cl)
throws DeploymentException;
+
+ private URI getDependencyURI(GerDependencyType dep) throws
DeploymentException {
+ URI uri;
+ if (dep.isSetUri()) {
+ try {
+ uri = new URI(dep.getUri());
+ } catch (URISyntaxException e) {
+ throw new DeploymentException("Invalid dependency URI " +
dep.getUri(), e);
+ }
+ } else {
+ // @todo support more than just jars
+ String id = dep.getGroupId() + "/jars/" + dep.getArtifactId() +
'-' + dep.getVersion() + ".jar";
+ try {
+ uri = new URI(id);
+ } catch (URISyntaxException e) {
+ throw new DeploymentException("Unable to construct URI for
groupId=" + dep.getGroupId() + ", artifactId=" + dep.getArtifactId() + ",
version=" + dep.getVersion(), e);
+ }
+ }
+ return uri;
+ }
public static final GBeanInfo GBEAN_INFO;
1.8 +20 -24
incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionManagerDeployment.java
Index: ConnectionManagerDeployment.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionManagerDeployment.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ConnectionManagerDeployment.java 8 Apr 2004 20:35:32 -0000 1.7
+++ ConnectionManagerDeployment.java 14 Apr 2004 04:01:24 -0000 1.8
@@ -17,13 +17,11 @@
package org.apache.geronimo.connector.outbound;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
import javax.resource.ResourceException;
-import javax.resource.spi.ManagedConnectionFactory;
import javax.resource.spi.ConnectionManager;
-import javax.resource.spi.LazyAssociatableConnectionManager;
import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.LazyAssociatableConnectionManager;
+import javax.resource.spi.ManagedConnectionFactory;
import
org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker;
import org.apache.geronimo.gbean.GAttributeInfo;
@@ -35,9 +33,7 @@
import org.apache.geronimo.gbean.GOperationInfo;
import org.apache.geronimo.gbean.GReferenceInfo;
import org.apache.geronimo.gbean.WaitingException;
-import org.apache.geronimo.kernel.KernelMBean;
import org.apache.geronimo.security.bridge.RealmBridge;
-import org.apache.geronimo.deployment.DeploymentException;
/**
* ConnectionManagerDeployment is an mbean that sets up a
ProxyConnectionManager
@@ -112,10 +108,10 @@
* LocalXAResourceInsertionInterceptor or XAResourceInsertionInterceptor
(useTransactions (&localTransactions))
* MCFConnectionInterceptor
*/
- private void setUpConnectionManager() throws DeploymentException {
+ private void setUpConnectionManager() throws IllegalStateException {
//check for consistency between attributes
if (realmBridge == null && useSubject) {
- throw new DeploymentException("To use Subject in pooling, you
need a SecurityDomain");
+ throw new IllegalStateException("To use Subject in pooling, you
need a SecurityDomain");
}
//Set up the interceptor stack
@@ -127,21 +123,21 @@
stack = new XAResourceInsertionInterceptor(stack);
}
}
- if (useSubject || useConnectionRequestInfo) {
- stack = new MultiPoolConnectionInterceptor(
- stack,
- maxSize,
- blockingTimeout,
- useSubject,
- useConnectionRequestInfo);
- } else {
- stack = new SinglePoolConnectionInterceptor(
- stack,
- null,
- null,
- maxSize,
- blockingTimeout);
- }
+// if (useSubject || useConnectionRequestInfo) {
+// stack = new MultiPoolConnectionInterceptor(
+// stack,
+// maxSize,
+// blockingTimeout,
+// useSubject,
+// useConnectionRequestInfo);
+// } else {
+// stack = new SinglePoolConnectionInterceptor(
+// stack,
+// null,
+// null,
+// maxSize,
+// blockingTimeout);
+// }
if (realmBridge != null) {
stack = new SubjectInterceptor(stack, realmBridge);
}
1.12 +4 -3
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.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- geronimo-connector_1_5.xsd 12 Mar 2004 17:58:45 -0000 1.11
+++ geronimo-connector_1_5.xsd 14 Apr 2004 04:01:25 -0000 1.12
@@ -278,12 +278,13 @@
</xsd:annotation>
<xsd:sequence>
- <xsd:element name="resourceadapter"
- type="ger:resourceadapterType"/>
+ <xsd:element name="dependency" type="ger:dependencyType"
minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="gbean" type="ger:gbeanType" minOccurs="0"
maxOccurs="unbounded"/>
+ <xsd:element name="resourceadapter"
type="ger:resourceadapterType"/>
+ <xsd:element name="gbean" type="ger:gbeanType" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
+
<xsd:attribute name="version" type="ger:versionType" use="required"/>
<xsd:attribute name="configId" type="xsd:string" use="required"/>
<xsd:attribute name="parentId" type="xsd:string" use="optional"/>