You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2006/02/05 03:16:01 UTC
svn commit: r374958 [1/2] - in /geronimo/branches/configid: ./
modules/client-builder/
modules/client-builder/src/java/org/apache/geronimo/client/builder/
modules/client-builder/src/schema/ modules/connector-builder/
modules/connector-builder/src/java/...
Author: djencks
Date: Sat Feb 4 18:14:29 2006
New Revision: 374958
URL: http://svn.apache.org/viewcvs?rev=374958&view=rev
Log:
Some new classes: Artifact and Environment, and EnvironmentBuilder. Modified ServiceConfigBuilder, and some of DeploymentContext.
Some schemas partially modified for new elements. New code compiles but not new schemas.
Added:
geronimo/branches/configid/modules/client-builder/src/schema/geronimo-application-client-1.1.xsd
geronimo/branches/configid/modules/connector-builder/src/schema/geronimo-connector-1.1.xsd
geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/Environment.java
geronimo/branches/configid/modules/j2ee-builder/src/schema/geronimo-application-1.1.xsd
geronimo/branches/configid/modules/jetty-builder/src/schema/geronimo-jetty-1.1.xsd
geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Artifact.java
geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
geronimo/branches/configid/modules/tomcat-builder/src/schema/geronimo-tomcat-1.1.xsd
geronimo/branches/configid/modules/web-builder/src/schema/geronimo-web-1.1.xsd
Removed:
geronimo/branches/configid/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ConfigPlanTest.java
Modified:
geronimo/branches/configid/modules/client-builder/maven.xml
geronimo/branches/configid/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
geronimo/branches/configid/modules/client-builder/src/schema/xmlconfig.xml
geronimo/branches/configid/modules/connector-builder/maven.xml
geronimo/branches/configid/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
geronimo/branches/configid/modules/connector-builder/src/schema/xmlconfig.xml
geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
geronimo/branches/configid/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java
geronimo/branches/configid/modules/j2ee-builder/maven.xml
geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
geronimo/branches/configid/modules/j2ee-builder/src/schema/xmlconfig.xml
geronimo/branches/configid/modules/jetty-builder/maven.xml
geronimo/branches/configid/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
geronimo/branches/configid/modules/jetty-builder/src/schema/xmlconfig.xml
geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java
geronimo/branches/configid/modules/service-builder/maven.xml
geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
geronimo/branches/configid/modules/service-builder/src/schema/xmlconfig.xml
geronimo/branches/configid/modules/service-builder/src/test-resources/services/plan1.xml
geronimo/branches/configid/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ParentIDTest.java
geronimo/branches/configid/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
geronimo/branches/configid/modules/tomcat-builder/maven.xml
geronimo/branches/configid/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
geronimo/branches/configid/modules/tomcat-builder/src/schema/xmlconfig.xml
geronimo/branches/configid/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
geronimo/branches/configid/modules/web-builder/maven.xml
geronimo/branches/configid/modules/web-builder/src/schema/xmlconfig.xml
geronimo/branches/configid/plugins/geronimo-dependency-plugin/src/java/org/apache/geronimo/plugin/dependency/GenerateServiceXml.java
geronimo/branches/configid/project.properties
Modified: geronimo/branches/configid/modules/client-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/client-builder/maven.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/client-builder/maven.xml (original)
+++ geronimo/branches/configid/modules/client-builder/maven.xml Sat Feb 4 18:14:29 2006
@@ -27,7 +27,7 @@
<preGoal name="java:compile">
<xmlbeans:schema2java
- maven.xmlbeans2.sourceschema="schema/geronimo-application-client-1.0.xsd"/>
+ maven.xmlbeans2.sourceschema="schema/geronimo-application-client-1.1.xsd"/>
<mkdir dir="${basedir}/target/xmlbeans-classes"/>
<mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
<copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">
Modified: geronimo/branches/configid/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/branches/configid/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Sat Feb 4 18:14:29 2006
@@ -47,7 +47,6 @@
import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
import org.apache.geronimo.deployment.util.DeploymentUtil;
import org.apache.geronimo.deployment.util.NestedJarFile;
-import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
import org.apache.geronimo.deployment.xbeans.DependencyType;
import org.apache.geronimo.deployment.xbeans.GbeanType;
import org.apache.geronimo.gbean.GBeanData;
@@ -84,7 +83,6 @@
import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlCursor;
/**
@@ -343,7 +341,7 @@
try {
URI clientConfigId = URI.create(geronimoAppClient.getClientConfigId());
- List clientParentId = ServiceConfigBuilder.getParentID(geronimoAppClient.getClientParentId(), geronimoAppClient.getImportArray());
+ List clientParentId = ServiceConfigBuilder.toArtifacts(geronimoAppClient.getClientParentId(), geronimoAppClient.getImportArray());
clientParentId.addAll(defaultClientParentId);
appClientDeploymentContext = new EARContext(appClientDir,
clientConfigId,
Added: geronimo/branches/configid/modules/client-builder/src/schema/geronimo-application-client-1.1.xsd
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/client-builder/src/schema/geronimo-application-client-1.1.xsd?rev=374958&view=auto
==============================================================================
--- geronimo/branches/configid/modules/client-builder/src/schema/geronimo-application-client-1.1.xsd (added)
+++ geronimo/branches/configid/modules/client-builder/src/schema/geronimo-application-client-1.1.xsd Sat Feb 4 18:14:29 2006
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 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.
+-->
+<!-- @version $Rev: 356022 $ $Date: 2005-12-11 12:58:34 -0800 (Sun, 11 Dec 2005) $ -->
+<xs:schema
+ xmlns:geronimo="http://geronimo.apache.org/xml/ns/j2ee/application-client-1.1"
+ targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/application-client-1.1"
+ xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.0"
+ xmlns:connector="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1"
+ xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1"
+ xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0">
+
+ <xs:import namespace="http://geronimo.apache.org/xml/ns/naming-1.0" schemaLocation="geronimo-naming-1.0.xsd"/>
+ <xs:import namespace="http://geronimo.apache.org/xml/ns/security-1.1" schemaLocation="geronimo-security-1.1.xsd"/>
+ <xs:import namespace="http://geronimo.apache.org/xml/ns/j2ee/connector-1.0" schemaLocation="geronimo-connector-1.1.xsd"/>
+ <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.1" schemaLocation="geronimo-config-1.1.xsd"/>
+
+ <xs:element name="application-client" type="geronimo:application-clientType"/>
+
+ <xs:complexType name="application-clientType">
+ <xs:sequence>
+<!-- <xs:element ref="sys:parent" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element name="include" type="sys:dependencyType" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:dependency" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:hidden-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:non-overridable-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+ <xs:group ref="sys:classloader-include-infoGroup"/>
+
+
+ <xs:element ref="naming:ejb-ref" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="naming:service-ref" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="naming:resource-ref" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="naming:resource-env-ref" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="naming:message-destination" minOccurs="0" maxOccurs="unbounded"/>
+
+ <xs:element ref="security:default-principal" minOccurs="0"/>
+
+ <xs:sequence minOccurs="0">
+ <xs:element name="realm-name" type="xs:string"/>
+ <xs:element name="callback-handler" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+
+
+ <xs:element name="resource" type="geronimo:resourceType" minOccurs="0" maxOccurs="unbounded"/>
+
+ <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+
+ <xs:attribute name="configId" type="xs:string" use="required"/>
+ <xs:attribute name="parentId" type="xs:string" use="optional"/>
+ <xs:attribute name="clientConfigId" type="xs:string" use="required"/>
+ <xs:attribute name="clientParentId" type="xs:string" use="optional"/>
+ </xs:complexType>
+
+ <xs:complexType name="resourceType">
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name="external-rar" type="xs:string"/>
+ <xs:element name="internal-rar" type="xs:string"/>
+ </xs:choice>
+ <xs:element ref="connector:connector"/>
+ </xs:sequence>
+ </xs:complexType>
+
+
+</xs:schema>
Modified: geronimo/branches/configid/modules/client-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/client-builder/src/schema/xmlconfig.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/client-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/configid/modules/client-builder/src/schema/xmlconfig.xml Sat Feb 4 18:14:29 2006
@@ -18,7 +18,7 @@
<!-- @version $Rev$ $Date$ -->
<xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
- <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/application-client-1.0">
+ <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/application-client-1.1">
<xb:package>org.apache.geronimo.xbeans.geronimo.client</xb:package>
<xb:prefix>Ger</xb:prefix>
</xb:namespace>
Modified: geronimo/branches/configid/modules/connector-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/connector-builder/maven.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/connector-builder/maven.xml (original)
+++ geronimo/branches/configid/modules/connector-builder/maven.xml Sat Feb 4 18:14:29 2006
@@ -28,7 +28,7 @@
<preGoal name="java:compile">
<xmlbeans:schema2java
- maven.xmlbeans2.sourceschema="schema/geronimo-connector-1.0.xsd"/>
+ maven.xmlbeans2.sourceschema="schema/geronimo-connector-1.1.xsd"/>
<mkdir dir="${basedir}/target/xmlbeans-classes"/>
<mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
<copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">
Modified: geronimo/branches/configid/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/branches/configid/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Sat Feb 4 18:14:29 2006
@@ -69,8 +69,6 @@
import org.apache.geronimo.deployment.xbeans.ClassFilterType;
import org.apache.geronimo.deployment.xbeans.DependencyType;
import org.apache.geronimo.deployment.xbeans.GbeanType;
-import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
import org.apache.geronimo.gbean.DynamicGAttributeInfo;
import org.apache.geronimo.gbean.GAttributeInfo;
import org.apache.geronimo.gbean.GBeanData;
@@ -242,7 +240,7 @@
throw new DeploymentException("Invalid configId " + gerConnector.getConfigId(), e);
}
- List parentId = ServiceConfigBuilder.getParentID(gerConnector.getParentId(), gerConnector.getImportArray());
+ List parentId = ServiceConfigBuilder.toArtifacts(gerConnector.getParentId(), gerConnector.getImportArray());
//suppressing the default parentid is mostly useful for deploying standalone connectors on the app client.
//The defaultParentId normally pulls in and tries to start all the base server gbeans.
if (!gerConnector.getSuppressDefaultParentId()) {
Added: geronimo/branches/configid/modules/connector-builder/src/schema/geronimo-connector-1.1.xsd
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/connector-builder/src/schema/geronimo-connector-1.1.xsd?rev=374958&view=auto
==============================================================================
--- geronimo/branches/configid/modules/connector-builder/src/schema/geronimo-connector-1.1.xsd (added)
+++ geronimo/branches/configid/modules/connector-builder/src/schema/geronimo-connector-1.1.xsd Sat Feb 4 18:14:29 2006
@@ -0,0 +1,399 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 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.
+-->
+
+<xs:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ger="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1"
+ xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.0"
+ xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"
+ targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified">
+
+ <xs:import namespace="http://geronimo.apache.org/xml/ns/naming-1.0" schemaLocation="geronimo-naming-1.0.xsd"/>
+ <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.1" schemaLocation="geronimo-config-1.1.xsd"/>
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[
+ documents using this schema should start like:
+<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.0"
+ version="1.5">
+
+ @(#)geronimo-connector_1_5.xsds
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+
+
+
+ <!-- **************************************************** -->
+
+
+ <xs:element name="connector" type="ger:connectorType">
+ <xs:annotation>
+ <xs:documentation>
+
+ The connector element is the root element of the deployment
+ descriptor for the resource adapter. This element includes
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:unique name="resourceadapter-instance-name-uniqueness">
+ <xs:annotation>
+ <xs:documentation>
+
+ The resourceadapter-instance element must have a unique name.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:selector xpath="ger:resourceadapter/ger:resourceadapter-instance"/>
+ <xs:field xpath="ger:resourceadapter-name"/>
+ </xs:unique>
+
+ <xs:unique name="connectiondefinition-instance-name-uniqueness">
+ <xs:annotation>
+ <xs:documentation>
+
+ The connectiondefinition-instance element must have a unique name.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:selector xpath="ger:resourceadapter/ger:outbound-resourceadapter/ger:connection-definition/ger:connectiondefinition-instance"/>
+ <xs:field xpath="ger:name"/>
+ </xs:unique>
+
+ <xs:unique name="admin-object-instance-name-uniqueness">
+ <xs:annotation>
+ <xs:documentation>
+
+ The admin-object-instance element must have a unique name.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:selector xpath="ger:adminobject/ger:adminobject-instance"/>
+ <xs:field xpath="ger:message-destination-name"/>
+ </xs:unique>
+
+ </xs:element>
+
+
+ <!-- **************************************************** -->
+
+ <xs:complexType name="adminobjectType">
+ <xs:annotation>
+ <xs:documentation>
+ reference back into standard dd
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:sequence>
+ <xs:element name="adminobject-interface"
+ type="ger:fully-qualified-classType">
+ <xs:annotation>
+ <xs:documentation>
+ believe it or not, there are no uniqueness constraints on admin object intf or class
+ </xs:documentation>
+ </xs:annotation>
+
+ </xs:element>
+ <xs:element name="adminobject-class"
+ type="ger:fully-qualified-classType">
+ <xs:annotation>
+ <xs:documentation>reference back into the standard dd</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="adminobject-instance"
+ type="ger:adminobject-instanceType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="adminobject-instanceType">
+ <xs:sequence>
+ <xs:element name="message-destination-name"
+ type="xs:string">
+ <xs:annotation>
+ <xs:documentation>unique name for admin object instance. Used in object name of gbean for it. Matches message-destination-name in ejb-jar.xml assembly descriptor.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="config-property-setting"
+ type="ger:config-property-settingType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+
+ <!-- **************************************************** -->
+
+ <xs:complexType name="config-property-settingType">
+ <xs:annotation>
+ <xs:documentation>
+
+ The config-property-settingType contains a name-value pair for a
+ config-property or required-config-property
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <!-- **************************************************** -->
+
+ <xs:complexType name="connection-definitionType">
+ <xs:annotation>
+ <xs:documentation>
+
+ The connection-definitionType defines a set of connection
+ interfaces and classes pertaining to a particular connection
+ type. This also includes configurable properties for
+ ManagedConnectionFactory instances that may be produced out
+ of this set.
+
+ The name element uniquely identifies this instance
+
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:sequence>
+ <xs:element name="connectionfactory-interface"
+ type="ger:fully-qualified-classType">
+ <xs:annotation>
+ <xs:documentation>
+ connectionfactory-interface is unique in ra.xml so is used to index into ra.xml
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="connectiondefinition-instance"
+ type="ger:connectiondefinition-instanceType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="connectiondefinition-instanceType">
+ <xs:sequence>
+ <xs:element name="name"
+ type="xs:string"/>
+
+ <xs:element name="implemented-interface"
+ type="ger:fully-qualified-classType"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>
+ Additional interfaces implemented by the connectionfactory, used by the application
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="config-property-setting"
+ type="ger:config-property-settingType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <!-- <xs:choice>-->
+ <xs:element name="connectionmanager"
+ type="ger:connectionmanagerType">
+ </xs:element>
+ <!-- <xs:element name="connectionmanager-ref" type="xs:string"/>-->
+ <!-- </xs:choice>-->
+
+ </xs:sequence>
+ </xs:complexType>
+
+ <!-- **************************************************** -->
+
+ <xs:complexType name="connectionmanagerType">
+ <xs:annotation>
+ <xs:documentation>
+ The ConnectionManager configuration.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:sequence>
+ <xs:element name="container-managed-security" type="ger:emptyType" minOccurs="0"/>
+ <xs:choice minOccurs="0">
+ <xs:element name="no-transaction" type="ger:emptyType"/>
+ <xs:element name="local-transaction" type="ger:emptyType"/>
+ <xs:element name="xa-transaction" type="ger:xatransactionType"/>
+ <xs:element name="transaction-log" type="ger:emptyType"/>
+ </xs:choice>
+ <xs:choice>
+ <xs:element name="no-pool" type="ger:emptyType"/>
+ <xs:element name="single-pool" type="ger:singlepoolType"/>
+ <xs:element name="partitioned-pool" type="ger:partitionedpoolType"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="xatransactionType">
+ <xs:sequence>
+ <xs:element name="transaction-caching" type="ger:emptyType" minOccurs="0"/>
+ <xs:element name="thread-caching" type="ger:emptyType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="singlepoolType">
+ <xs:sequence>
+ <xs:element name="max-size" type="xs:int" minOccurs="0"/>
+ <xs:element name="min-size" type="xs:int" minOccurs="0"/>
+ <xs:element name="blocking-timeout-milliseconds" type="xs:int" minOccurs="0"/>
+ <xs:element name="idle-timeout-minutes" type="xs:int" minOccurs="0"/>
+ <xs:choice>
+ <xs:element name="match-one" type="ger:emptyType"/>
+ <xs:element name="match-all" type="ger:emptyType"/>
+ <xs:element name="select-one-assume-match" type="ger:emptyType"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="partitionedpoolType">
+ <complexContent>
+ <extension base="ger:singlepoolType">
+ <xs:sequence>
+ <xs:element name="partition-by-subject" type="ger:emptyType" minOccurs="0"/>
+ <xs:element name="partition-by-connectionrequestinfo" type="ger:emptyType" minOccurs="0"/>
+ </xs:sequence>
+ </extension>
+ </complexContent>
+ </xs:complexType>
+
+ <!-- **************************************************** -->
+
+ <xs:complexType name="connectorType">
+ <xs:annotation>
+ <xs:documentation>
+ The connectorType defines a resource adapter.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:sequence>
+<!-- <xs:element ref="sys:parent" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:dependency" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:hidden-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:non-overridable-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+ <xs:group ref="sys:classloader-infoGroup"/>
+
+ <xs:element name="resourceadapter" type="ger:resourceadapterType" maxOccurs="unbounded"/>
+
+ <xs:element name="adminobject" type="ger:adminobjectType" minOccurs="0" maxOccurs="unbounded"/>
+
+ <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+
+ <xs:attribute name="configId" type="xs:string" use="required"/>
+ <xs:attribute name="parentId" type="xs:string" use="optional"/>
+ <xs:attribute name="suppressDefaultParentId" type="xs:boolean" use="optional"/>
+ <xs:attribute name="inverseClassloading" type="xs:boolean" use="optional"/>
+ </xs:complexType>
+
+ <!-- **************************************************** -->
+
+ <xs:complexType name="emptyType"/>
+
+ <!-- **************************************************** -->
+
+ <xs:complexType name="outbound-resourceadapterType">
+ <xs:annotation>
+ <xs:documentation>
+
+ The outbound-resourceadapterType specifies information about
+ an outbound resource adapter. The information includes fully
+ qualified names of classes/interfaces required as part of
+ the connector architecture specified contracts for
+ connection management, level of transaction support
+ provided, one or more authentication mechanisms supported
+ and additional required security permissions.
+
+ If there is no authentication-mechanism specified as part of
+ resource adapter element then the resource adapter does not
+ support any standard security authentication mechanisms as
+ part of security contract. The application server ignores
+ the security part of the system contracts in this case.
+
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:sequence>
+ <xs:element name="connection-definition"
+ type="ger:connection-definitionType"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+
+ <!-- **************************************************** -->
+
+ <xs:complexType name="resourceadapterType">
+
+ <xs:sequence>
+ <xs:element name="resourceadapter-instance"
+ type="ger:resourceadapter-instanceType"
+ minOccurs="0">
+ </xs:element>
+ <xs:element name="outbound-resourceadapter"
+ type="ger:outbound-resourceadapterType"
+ minOccurs="0">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="resourceadapter-instanceType">
+ <xs:annotation>
+ <xs:documentation>
+ The resourceadapter instance info is put in a separate optional element
+ to provide easier more consistent support for 1.0 adapters.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="resourceadapter-name" type="xs:string"/>
+ <xs:element name="config-property-setting"
+ type="ger:config-property-settingType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xs:element ref="naming:workmanager"/>
+ </xs:sequence>
+ </xs:complexType>
+
+
+
+ <!-- types borrowed from the j2ee schema. We might want to centralize these -->
+
+ <xs:simpleType name="fully-qualified-classType">
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+
+ <xs:complexType name="descriptionType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute ref="xml:lang"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+
+</xs:schema>
+
Modified: geronimo/branches/configid/modules/connector-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/connector-builder/src/schema/xmlconfig.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/connector-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/configid/modules/connector-builder/src/schema/xmlconfig.xml Sat Feb 4 18:14:29 2006
@@ -1,7 +1,7 @@
<xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config"
>
- <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/connector-1.0">
+ <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
<xb:package>org.apache.geronimo.xbeans.geronimo</xb:package>
<xb:prefix>Ger</xb:prefix>
</xb:namespace>
Modified: geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java (original)
+++ geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java Sat Feb 4 18:14:29 2006
@@ -79,15 +79,11 @@
private final byte[] buffer = new byte[4096];
private final List loadedAncestors = new ArrayList();
private final List startedAncestors = new ArrayList();
-// private final ClassLoader[] parentCL;
- public DeploymentContext(File baseDir, URI configId, ConfigurationModuleType type, List parentID, Kernel kernel) throws DeploymentException {
- this(baseDir, configId, type, parentID, null, null, kernel);
- }
- public DeploymentContext(File baseDir, URI configId, ConfigurationModuleType type, List parentId, String domain, String server, Kernel kernel) throws DeploymentException {
+ public DeploymentContext(File baseDir, Environment environment, ConfigurationModuleType type, Kernel kernel) throws DeploymentException {
assert baseDir != null: "baseDir is null";
- assert configId != null: "configID is null";
+ assert environment != null: "environment is null";
assert type != null: "type is null";
this.kernel = kernel;
@@ -102,18 +98,22 @@
this.baseUri = baseDir.toURI();
configurationData = new ConfigurationData();
- configurationData.setId(configId);
+ try {
+ configurationData.setId(environment.getConfigId().toURI());
+ } catch (URISyntaxException e) {
+ throw new DeploymentException(e);
+ }
configurationData.setModuleType(type);
- configurationData.setParentId(parentId);
- configurationData.setDomain(domain);
- configurationData.setServer(server);
+ //TODO configid this is broken, need Artifact to URI conversion or configData to use Artifacts.
+ configurationData.setParentId(new ArrayList(environment.getImports()));
+ configurationData.setNameKeys(environment.getNameKeys());
determineNaming();
determineInherited();
}
private void determineNaming() throws DeploymentException {
- if (configurationData.getDomain() != null && configurationData.getServer() != null) {
+ if (configurationData.getNameKeys() != null && !configurationData.getNameKeys().isEmpty()) {
return;
}
List parentId = configurationData.getParentId();
@@ -131,8 +131,7 @@
}
try {
ObjectName parentName = Configuration.getConfigurationObjectName(parent);
- configurationData.setDomain((String) kernel.getAttribute(parentName, "domain"));
- configurationData.setServer((String) kernel.getAttribute(parentName, "server"));
+ configurationData.setNameKeys((Map) kernel.getAttribute(parentName, "nameKeys"));
} catch (Exception e) {
throw new DeploymentException("Unable to copy domain and server from parent configuration", e);
} finally {
@@ -148,10 +147,9 @@
}
//check that domain and server are now known
- if (configurationData.getDomain() == null || configurationData.getServer() == null) {
+ if (configurationData.getNameKeys() == null || configurationData.getNameKeys().isEmpty()) {
throw new IllegalStateException("Domain or server could not be determined from explicit args or parent configuration. ParentID: " + parentId
- + ", domain: " + configurationData.getDomain()
- + ", server: " + configurationData.getServer());
+ + ", name keys: " + configurationData.getNameKeys());
}
}
@@ -224,11 +222,11 @@
}
public String getDomain() {
- return configurationData.getDomain();
+ return (String) configurationData.getNameKeys().get("domain");
}
public String getServer() {
- return configurationData.getServer();
+ return (String) configurationData.getNameKeys().get("J2EEServer");
}
public void addGBean(GBeanData gbean) {
@@ -669,31 +667,6 @@
ConfigurationData configurationData = new ConfigurationData(this.configurationData);
configurationData.setGBeans(Arrays.asList(gbeans.getGBeans()));
return configurationData;
- }
-
- /**
- * @return a copy of the configurations GBeanData
- * @deprecated Currently used only in some tests, and may not be appropriate as a public method.
- */
- public GBeanData getConfigurationGBeanData() throws MalformedObjectNameException, InvalidConfigException {
- URI id = configurationData.getId();
- GBeanData config = new GBeanData(Configuration.getConfigurationObjectName(id), Configuration.GBEAN_INFO);
- config.setAttribute("id", id);
- config.setAttribute("type", configurationData.getModuleType());
- config.setAttribute("domain", configurationData.getDomain());
- config.setAttribute("server", configurationData.getServer());
-
- List parentId = configurationData.getParentId();
- if (parentId != null) {
- config.setAttribute("parentId", parentId.toArray(new URI[parentId.size()]));
- }
-
- config.setAttribute("gBeanState", Configuration.storeGBeans(gbeans.getGBeans()));
- config.setReferencePatterns("Repositories", Collections.singleton(new ObjectName("*:name=Repository,*")));
- config.setAttribute("dependencies", configurationData.getDependencies());
- config.setAttribute("classPath", configurationData.getClassPath());
-
- return config;
}
public Object getAttribute(ObjectName name, String property) throws Exception {
Added: geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/Environment.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/Environment.java?rev=374958&view=auto
==============================================================================
--- geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/Environment.java (added)
+++ geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/Environment.java Sat Feb 4 18:14:29 2006
@@ -0,0 +1,132 @@
+/**
+ *
+ * Copyright 2006 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.deployment;
+
+import org.apache.geronimo.kernel.repository.Artifact;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * holds the data from the EnvironmentType xml while it is being resolved, transitively closed, etc.
+ * @version $Rev:$ $Date:$
+ */
+public class Environment {
+
+ private Artifact configId;
+
+ private Map nameKeys = new HashMap();
+
+ private LinkedHashSet imports;
+ private LinkedHashSet references;
+ private LinkedHashSet dependencies;
+ private LinkedHashSet includes;
+
+ private Set hiddenClasses;
+ private Set nonOverrideableClasses;
+
+ private boolean inverseClassloading;
+
+ public Environment(Artifact configId, Map nameKeys, LinkedHashSet imports, LinkedHashSet references, LinkedHashSet dependencies, LinkedHashSet includes, Set hiddenClasses, Set nonOverrideableClasses, boolean inverseClassloading) {
+ this.configId = configId;
+ this.nameKeys = nameKeys;
+ this.imports = imports;
+ this.references = references;
+ this.dependencies = dependencies;
+ this.includes = includes;
+ this.hiddenClasses = hiddenClasses;
+ this.nonOverrideableClasses = nonOverrideableClasses;
+ this.inverseClassloading = inverseClassloading;
+ }
+
+ public Artifact getConfigId() {
+ return configId;
+ }
+
+ public void setConfigId(Artifact configId) {
+ this.configId = configId;
+ }
+
+ public Map getNameKeys() {
+ return nameKeys;
+ }
+
+ public void setNameKeys(Map nameKeys) {
+ this.nameKeys = nameKeys;
+ }
+
+ public LinkedHashSet getImports() {
+ return imports;
+ }
+
+ public void setImports(LinkedHashSet imports) {
+ this.imports = imports;
+ }
+
+ public LinkedHashSet getReferences() {
+ return references;
+ }
+
+ public void setReferences(LinkedHashSet references) {
+ this.references = references;
+ }
+
+ public LinkedHashSet getDependencies() {
+ return dependencies;
+ }
+
+ public void setDependencies(LinkedHashSet dependencies) {
+ this.dependencies = dependencies;
+ }
+
+ public LinkedHashSet getIncludes() {
+ return includes;
+ }
+
+ public void setIncludes(LinkedHashSet includes) {
+ this.includes = includes;
+ }
+
+ public Set getHiddenClasses() {
+ return hiddenClasses;
+ }
+
+ public void setHiddenClasses(Set hiddenClasses) {
+ this.hiddenClasses = hiddenClasses;
+ }
+
+ public Set getNonOverrideableClasses() {
+ return nonOverrideableClasses;
+ }
+
+ public void setNonOverrideableClasses(Set nonOverrideableClasses) {
+ this.nonOverrideableClasses = nonOverrideableClasses;
+ }
+
+ public boolean isInverseClassloading() {
+ return inverseClassloading;
+ }
+
+ public void setInverseClassloading(boolean inverseClassloading) {
+ this.inverseClassloading = inverseClassloading;
+ }
+}
Modified: geronimo/branches/configid/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java (original)
+++ geronimo/branches/configid/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java Sat Feb 4 18:14:29 2006
@@ -20,10 +20,15 @@
import java.net.URI;
import java.net.URLClassLoader;
import java.net.URL;
+import java.util.LinkedHashSet;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.HashMap;
import javax.sql.DataSource;
import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.repository.Artifact;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.core.DefaultGeneratorStrategy;
@@ -41,8 +46,11 @@
basedir.mkdirs();
try {
basedir.deleteOnExit();
- URI configID = new URI("test");
- DeploymentContext context = new DeploymentContext(basedir, configID, ConfigurationModuleType.CAR, null, "foo", "bar", null);
+ Artifact configId = new Artifact("foo", "artifact", "1", "car", true);
+ Map nameKeys = new HashMap();
+ nameKeys.put("domain", "d");
+ Environment environment = new Environment(configId, nameKeys, new LinkedHashSet(), new LinkedHashSet(), new LinkedHashSet(), new LinkedHashSet(), new HashSet(), new HashSet(), false);
+ DeploymentContext context = new DeploymentContext(basedir, environment, ConfigurationModuleType.CAR, null);
Enhancer enhancer = new Enhancer();
enhancer.setInterfaces(new Class[]{DataSource.class});
enhancer.setCallbackType(MethodInterceptor.class);
Modified: geronimo/branches/configid/modules/j2ee-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/maven.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/maven.xml (original)
+++ geronimo/branches/configid/modules/j2ee-builder/maven.xml Sat Feb 4 18:14:29 2006
@@ -27,7 +27,7 @@
<preGoal name="java:compile">
<xmlbeans:schema2java
- maven.xmlbeans2.sourceschema="schema/geronimo-application-1.0.xsd"/>
+ maven.xmlbeans2.sourceschema="schema/geronimo-application-1.1.xsd"/>
<mkdir dir="${basedir}/target/xmlbeans-classes"/>
<mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
<copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">
Modified: geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Sat Feb 4 18:14:29 2006
@@ -214,7 +214,7 @@
throw new DeploymentException("Invalid configId " + gerApplication.getConfigId(), e);
}
- List parentId = ServiceConfigBuilder.getParentID(gerApplication.getParentId(), gerApplication.getImportArray());
+ List parentId = ServiceConfigBuilder.toArtifacts(gerApplication.getParentId(), gerApplication.getImportArray());
parentId.addAll(defaultParentId);
// get the modules either the application plan or for a stand alone module from the specific deployer
Added: geronimo/branches/configid/modules/j2ee-builder/src/schema/geronimo-application-1.1.xsd
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/schema/geronimo-application-1.1.xsd?rev=374958&view=auto
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/schema/geronimo-application-1.1.xsd (added)
+++ geronimo/branches/configid/modules/j2ee-builder/src/schema/geronimo-application-1.1.xsd Sat Feb 4 18:14:29 2006
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 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.
+-->
+
+<xs:schema
+ xmlns:geronimo="http://geronimo.apache.org/xml/ns/j2ee/application-1.1"
+ targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/application-1.1"
+ xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1"
+ xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0">
+
+ <xs:import namespace="http://geronimo.apache.org/xml/ns/security-1.1" schemaLocation="geronimo-security-1.1.xsd"/>
+ <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.1" schemaLocation="geronimo-config-1.1.xsd"/>
+
+ <xs:element name="application" type="geronimo:applicationType"/>
+
+ <xs:complexType name="applicationType">
+ <xs:sequence>
+<!-- <xs:element ref="sys:parent" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:dependency" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:hidden-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:non-overridable-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+ <xs:group ref="sys:classloader-infoGroup"/>
+
+ <xs:element name="module" type="geronimo:moduleType" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="ext-module" type="geronimo:ext-moduleType" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="security:security" minOccurs="0"/>
+ <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+
+ <xs:attribute name="configId" type="xs:string" use="required"/>
+ <xs:attribute name="parentId" type="xs:string" use="optional"/>
+ <xs:attribute name="application-name" type="xs:string" use="optional"/>
+ <xs:attribute name="inverseClassloading" type="xs:boolean" use="optional"/>
+ </xs:complexType>
+
+ <xs:complexType name="moduleType">
+ <xs:annotation>
+ <xs:documentation>
+ Mirrors the moduleType defined by application_1_4.xsd and adds an
+ optional alt-dd element defining a Geronimo specific deployment descriptor.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name="connector" type="geronimo:pathType"/>
+ <xs:element name="ejb" type="geronimo:pathType"/>
+ <xs:element name="java" type="geronimo:pathType"/>
+ <xs:element name="web" type="geronimo:pathType"/>
+ </xs:choice>
+ <xs:choice>
+ <xs:element name="alt-dd" type="geronimo:pathType">
+ <xs:annotation>
+ <xs:documentation>
+ Specifies an optional URI to the post-assembly version of the Geronimo
+ specific deployment descriptor file for a particular J2EE module.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:any namespace="##other" processContents="lax"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="ext-moduleType">
+ <xs:annotation>
+ <xs:documentation>
+ Mirrors the moduleType defined by application_1_4.xsd and adds an
+ optional alt-dd element defining a Geronimo specific deployment descriptor.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:choice>
+ <xs:annotation>
+ <xs:documentation>
+ This is the name for the module, not the path inside the ear.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:element name="connector" type="geronimo:pathType"/>
+ <xs:element name="ejb" type="geronimo:pathType"/>
+ <xs:element name="java" type="geronimo:pathType"/>
+ <xs:element name="web" type="geronimo:pathType"/>
+ </xs:choice>
+ <xs:choice>
+ <xs:element name="internal-path" type="xs:token"/>
+ <xs:element name="external-path" type="xs:token"/>
+ </xs:choice>
+ <!--TODO consider an alt-spec-dd element-->
+ <!--Do not allow vendor plan inside ear. If it is in the ear, this does not need to be an external module -->
+ <xs:any namespace="##other" processContents="lax"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="pathType">
+ <xs:annotation>
+ <xs:documentation>
+ Mirrors j2ee:pathType.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:restriction base="geronimo:string"/>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="string">
+ <xs:annotation>
+ <xs:documentation>
+ Mirrors j2ee:string.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:extension base="xs:token">
+ <xs:attribute name="id" type="xs:ID"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+</xs:schema>
Modified: geronimo/branches/configid/modules/j2ee-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/schema/xmlconfig.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/schema/xmlconfig.xml Sat Feb 4 18:14:29 2006
@@ -1,6 +1,6 @@
<xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
- <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/application-1.0">
+ <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/application-1.1">
<xb:package>org.apache.geronimo.xbeans.geronimo.j2ee</xb:package>
<xb:prefix>Ger</xb:prefix>
</xb:namespace>
Modified: geronimo/branches/configid/modules/jetty-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/maven.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/maven.xml (original)
+++ geronimo/branches/configid/modules/jetty-builder/maven.xml Sat Feb 4 18:14:29 2006
@@ -25,7 +25,7 @@
<preGoal name="java:compile">
<xmlbeans:schema2java
- maven.xmlbeans2.sourceschema="schema/geronimo-jetty-1.0.xsd,schema/geronimo-jetty-config-1.0.xsd"/>
+ maven.xmlbeans2.sourceschema="schema/geronimo-jetty-1.1.xsd,schema/geronimo-jetty-config-1.0.xsd"/>
<mkdir dir="${basedir}/target/xmlbeans-classes"/>
<mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
<copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">
Modified: geronimo/branches/configid/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Sat Feb 4 18:14:29 2006
@@ -257,7 +257,7 @@
throw new DeploymentException("Invalid configId " + jettyWebApp.getConfigId(), e);
}
- List parentId = ServiceConfigBuilder.getParentID(jettyWebApp.getParentId(), jettyWebApp.getImportArray());
+ List parentId = ServiceConfigBuilder.toArtifacts(jettyWebApp.getParentId(), jettyWebApp.getImportArray());
if (parentId.isEmpty()) {
parentId = new ArrayList(defaultParentId);
}
Added: geronimo/branches/configid/modules/jetty-builder/src/schema/geronimo-jetty-1.1.xsd
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/schema/geronimo-jetty-1.1.xsd?rev=374958&view=auto
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/schema/geronimo-jetty-1.1.xsd (added)
+++ geronimo/branches/configid/modules/jetty-builder/src/schema/geronimo-jetty-1.1.xsd Sat Feb 4 18:14:29 2006
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2004-2005 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.
+-->
+
+<xs:schema
+ xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.1"
+ targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.1"
+ xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.0"
+ xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1"
+ xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0">
+
+ <xs:import namespace="http://geronimo.apache.org/xml/ns/naming-1.0" schemaLocation="geronimo-naming-1.0.xsd"/>
+ <xs:import namespace="http://geronimo.apache.org/xml/ns/security-1.1" schemaLocation="geronimo-security-1.1.xsd"/>
+ <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.1" schemaLocation="geronimo-config-1.1.xsd"/>
+
+ <xs:element name="web-app" type="web:web-appType"/>
+
+
+ <xs:complexType name="web-appType">
+ <xs:sequence>
+<!-- <xs:element ref="sys:parent" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:dependency" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:hidden-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+<!-- <xs:element ref="sys:non-overridable-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+ <xs:group ref="sys:classloader-infoGroup"/>
+
+ <xs:element name="context-root" type="xs:string" minOccurs="0"/>
+ <xs:element name="context-priority-classloader" type="xs:boolean" minOccurs="0"/>
+ <xs:element name="virtual-host" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="session-manager" type="xs:string" minOccurs="0"/>
+
+ <xs:group ref="naming:jndiEnvironmentRefsGroup"/>
+ <xs:element ref="naming:message-destination" minOccurs="0" maxOccurs="unbounded"/>
+
+ <xs:sequence minOccurs="0">
+ <xs:element name="security-realm-name" type="xs:string"/>
+ <xs:element ref="security:security" minOccurs="0"/>
+ </xs:sequence>
+
+ <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
+
+ </xs:sequence>
+ <xs:attribute name="configId" type="xs:string" use="required"/>
+ <xs:attribute name="parentId" type="xs:string" use="optional"/>
+ <xs:attribute name="inverseClassloading" type="xs:boolean" use="optional"/>
+ </xs:complexType>
+
+ <xs:complexType name="container-configType">
+ <xs:sequence>
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
Modified: geronimo/branches/configid/modules/jetty-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/schema/xmlconfig.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/schema/xmlconfig.xml Sat Feb 4 18:14:29 2006
@@ -17,7 +17,7 @@
-->
<!-- @version $Rev$ $Date$ -->
<xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
- <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0">
+ <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.1">
<xb:package>org.apache.geronimo.xbeans.geronimo.web.jetty</xb:package>
<xb:prefix>Jetty</xb:prefix>
</xb:namespace>
Modified: geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java Sat Feb 4 18:14:29 2006
@@ -73,6 +73,7 @@
import org.apache.geronimo.kernel.management.State;
import org.apache.geronimo.security.SecurityServiceImpl;
import org.apache.geronimo.system.serverinfo.BasicServerInfo;
+import org.apache.geronimo.system.configuration.ExecutableConfigurationUtil;
import org.apache.geronimo.transaction.context.TransactionContextManagerGBean;
import org.apache.geronimo.transaction.manager.TransactionManagerImplGBean;
@@ -119,7 +120,7 @@
earContext.close();
module.close();
- GBeanData configData = earContext.getConfigurationGBeanData();
+ GBeanData configData = ExecutableConfigurationUtil.getConfigurationGBeanData(earContext.getConfigurationData());
ObjectName configName = configData.getName();
configData.setAttribute("baseURL", path.toURL());
kernel.loadGBean(configData, cl);
Modified: geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java (original)
+++ geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java Sat Feb 4 18:14:29 2006
@@ -25,6 +25,8 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
import org.apache.geronimo.gbean.GBeanData;
@@ -43,19 +45,20 @@
private ConfigurationModuleType moduleType;
/**
- * The uri of the parent of this configuration. May be null.
+ * The uris of the parents of this configuration.
*/
- private List parentId;
+ private List parentId = new ArrayList();
/**
- * The domain name of the configurations. This is used to autogenerate names for sub components.
+ * The uris of the references (configurations required by but not in classpath) of this configuration.
*/
- private String domain;
+ private List references = new ArrayList();
/**
- * The server name of the configurations. This is used to autogenerate names for sub components.
+ * map of key-value pairs for names inside this and child configurations. Typically domain and server
+ * Note that domain doesn't have a key name in an object name.
*/
- private String server;
+ private Map nameKeys = new HashMap();
/**
* List of URIs of jar files on which this configuration is dependent on.
@@ -63,7 +66,7 @@
private final LinkedHashSet dependencies = new LinkedHashSet();
/**
- * List of URIs in this configuration's classpath.
+ * List of URIs in this configuration's classpath. These are for the classes directly included in the configuration
*/
private final LinkedHashSet classPath = new LinkedHashSet();
@@ -99,9 +102,9 @@
public ConfigurationData(ConfigurationData configurationData) {
id = configurationData.id;
moduleType = configurationData.moduleType;
- parentId = configurationData.getParentId();
- domain = configurationData.domain;
- server = configurationData.server;
+ parentId.addAll(configurationData.getParentId());
+ references.addAll(configurationData.getReferences());
+ this.nameKeys.putAll(configurationData.nameKeys);
setDependencies(new ArrayList(configurationData.dependencies));
setClassPath(new ArrayList(configurationData.classPath));
setGBeans(configurationData.gbeans);
@@ -128,27 +131,42 @@
}
public List getParentId() {
- return parentId;
+ return new ArrayList(parentId);
}
public void setParentId(List parentId) {
- this.parentId = parentId;
+ this.parentId.clear();
+ this.parentId.addAll(parentId);
}
- public String getDomain() {
- return domain;
+ public void addParent(URI parentId) {
+ this.parentId.add(parentId);
}
- public void setDomain(String domain) {
- this.domain = domain;
+ public List getReferences() {
+ return new ArrayList(references);
}
- public String getServer() {
- return server;
+ public void setReferences(List references) {
+ this.references.clear();
+ this.references.addAll(references);
}
- public void setServer(String server) {
- this.server = server;
+ public void addReference(URI reference) {
+ this.references.add(reference);
+ }
+
+ public Map getNameKeys() {
+ return new HashMap(nameKeys);
+ }
+
+ public void setNameKeys(Map nameKeys) {
+ this.nameKeys.clear();
+ this.nameKeys.putAll(nameKeys);
+ }
+
+ public void addNameKey(String key, String value) {
+ nameKeys.put(key, value);
}
public List getDependencies() {
Added: geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Artifact.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Artifact.java?rev=374958&view=auto
==============================================================================
--- geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Artifact.java (added)
+++ geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Artifact.java Sat Feb 4 18:14:29 2006
@@ -0,0 +1,94 @@
+/**
+ *
+ * Copyright 2006 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.kernel.repository;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class Artifact {
+
+ private String groupId;
+ private String artifactId;
+ private String version;
+ private String type;
+ private boolean resolved;
+
+ public Artifact() {
+ }
+
+ public Artifact(String groupId, String artifactId, String version, String type, boolean resolved) {
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.version = version;
+ this.type = type;
+ this.resolved = resolved;
+ }
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ public void setArtifactId(String artifactId) {
+ this.artifactId = artifactId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public boolean isResolved() {
+ return resolved;
+ }
+
+ public void setResolved(boolean resolved) {
+ this.resolved = resolved;
+ }
+
+ /**
+ * @deprecated for use during conversion only!
+ * @return
+ * @throws URISyntaxException
+ */
+ public URI toURI() throws URISyntaxException {
+ String id = groupId + "/" + artifactId + "/" + version + "/" + type;
+ return new URI(id);
+ }
+}
Modified: geronimo/branches/configid/modules/service-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/service-builder/maven.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/service-builder/maven.xml (original)
+++ geronimo/branches/configid/modules/service-builder/maven.xml Sat Feb 4 18:14:29 2006
@@ -24,7 +24,7 @@
<preGoal name="java:compile">
<xmlbeans:schema2java
- maven.xmlbeans2.sourceschema="schema/geronimo-config-1.0.xsd,schema/geronimo-javabean-xmlattribute-1.0.xsd"/>
+ maven.xmlbeans2.sourceschema="schema/geronimo-config-1.1.xsd,schema/geronimo-javabean-xmlattribute-1.0.xsd"/>
<mkdir dir="${basedir}/target/xmlbeans-classes"/>
<mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
<copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">
Added: geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java?rev=374958&view=auto
==============================================================================
--- geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java (added)
+++ geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java Sat Feb 4 18:14:29 2006
@@ -0,0 +1,98 @@
+/**
+ *
+ * Copyright 2006 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.deployment.service;
+
+import org.apache.geronimo.deployment.Environment;
+import org.apache.geronimo.deployment.xbeans.EnvironmentType;
+import org.apache.geronimo.deployment.xbeans.NameKeyType;
+import org.apache.geronimo.deployment.xbeans.ClassloaderType;
+import org.apache.geronimo.deployment.xbeans.ClassFilterType;
+import org.apache.geronimo.deployment.xbeans.ArtifactType;
+import org.apache.geronimo.kernel.repository.Artifact;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class EnvironmentBuilder {
+
+
+ public static Environment buildEnvironment(EnvironmentType environmentType) {
+ Artifact configId = toArtifact(environmentType.getConfigid());
+
+ NameKeyType[] nameKeyArray = environmentType.getNameKeyArray();
+ Map nameKeyMap = new HashMap();
+ for (int i = 0; i < nameKeyArray.length; i++) {
+ NameKeyType nameKey = nameKeyArray[i];
+ String key = nameKey.getKey().trim();
+ String value = nameKey.getValue().trim();
+ nameKeyMap.put(key, value);
+ }
+
+
+ ClassloaderType classloaderType = environmentType.getClassloader();
+ LinkedHashSet imports = toArtifacts(classloaderType.getImportArray());
+ LinkedHashSet dependencies = toArtifacts(classloaderType.getDependencyArray());
+ LinkedHashSet includes = toArtifacts(classloaderType.getIncludeArray());
+
+ LinkedHashSet references = toArtifacts(environmentType.getReferenceArray());
+ boolean inverseClassloading = classloaderType.isSetInverseClassloading();
+ Set hiddenClasses = toFilters(classloaderType.getHiddenClassesArray());
+ Set nonOverrideableClasses = toFilters(classloaderType.getNonOverridableClassesArray());
+
+ Environment environment = new Environment(configId, nameKeyMap, imports, references, dependencies, includes, hiddenClasses, nonOverrideableClasses, inverseClassloading);
+ return environment;
+ }
+
+ private static Set toFilters(ClassFilterType[] filterArray) {
+ Set filters = new HashSet();
+ for (int i = 0; i < filterArray.length; i++) {
+ ClassFilterType classFilterType = filterArray[i];
+ String filter = classFilterType.getFilter().trim();
+ filters.add(filter);
+ }
+ return filters;
+ }
+
+ //package level for testing
+ static LinkedHashSet toArtifacts(ArtifactType[] artifactTypes) {
+ LinkedHashSet artifacts = new LinkedHashSet();
+ for (int i = 0; i < artifactTypes.length; i++) {
+ ArtifactType artifactType = artifactTypes[i];
+ Artifact artifact = toArtifact(artifactType);
+ artifacts.add(artifact);
+ }
+ return artifacts;
+ }
+
+ //TODO make private
+ static Artifact toArtifact(ArtifactType artifactType) {
+ String groupId = artifactType.isSetGroupId() ? artifactType.getGroupId().trim() : null;
+ String type = artifactType.isSetType() ? artifactType.getType().trim() : "jar";
+ String artifactId = artifactType.getArtifactId().trim();
+ String version = artifactType.isSetVersion() ? artifactType.getVersion().trim() : null;
+ return new Artifact(groupId, artifactId, version, type, false);
+ }
+
+
+}