geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r393699 - in /geronimo/branches/1.1/modules: connector-builder/src/java/org/apache/geronimo/connector/deployment/jsr88/ connector-builder/src/test/org/apache/geronimo/connector/deployment/jsr88/ service-builder/ service-builder/src/java/org...
Date Thu, 13 Apr 2006 03:28:41 GMT
Author: ammulder
Date: Wed Apr 12 20:28:38 2006
New Revision: 393699

URL: http://svn.apache.org/viewcvs?rev=393699&view=rev
Log:
Add EnvironmentType to DConfigBeans (GERONIMO-1830).

Added:
    geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/jsr88/
    geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/jsr88/Artifact.java
      - copied, changed from r393678, geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/jsr88/Artifact.java
    geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/jsr88/EnvironmentData.java
Removed:
    geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/jsr88/Artifact.java
Modified:
    geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/jsr88/ConnectorDCB.java
    geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java
    geronimo/branches/1.1/modules/service-builder/project.xml

Modified: geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/jsr88/ConnectorDCB.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/jsr88/ConnectorDCB.java?rev=393699&r1=393698&r2=393699&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/jsr88/ConnectorDCB.java
(original)
+++ geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/jsr88/ConnectorDCB.java
Wed Apr 12 20:28:38 2006
@@ -16,26 +16,26 @@
  */
 package org.apache.geronimo.connector.deployment.jsr88;
 
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.ArrayList;
 import java.util.Map;
-import java.util.LinkedHashMap;
-import java.util.Arrays;
-import java.util.Collections;
+import java.util.Set;
 import javax.enterprise.deploy.model.DDBean;
-import javax.enterprise.deploy.model.XpathListener;
 import javax.enterprise.deploy.model.XpathEvent;
+import javax.enterprise.deploy.model.XpathListener;
 import javax.enterprise.deploy.spi.DConfigBean;
 import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
-
 import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
+import org.apache.geronimo.deployment.service.jsr88.EnvironmentData;
+import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
+import org.apache.geronimo.xbeans.geronimo.GerAdminobjectType;
 import org.apache.geronimo.xbeans.geronimo.GerConnectorType;
 import org.apache.geronimo.xbeans.geronimo.GerResourceadapterType;
-import org.apache.geronimo.xbeans.geronimo.GerAdminobjectType;
-import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
 import org.apache.xmlbeans.SchemaTypeLoader;
 import org.apache.xmlbeans.XmlCursor;
 
@@ -48,8 +48,8 @@
 public class ConnectorDCB extends DConfigBeanSupport {
     private DDBean resourceAdapterDDBean;
     private ResourceAdapter[] resourceAdapter = new ResourceAdapter[0];
-    private Artifact[] dependency = new Artifact[0];
     private AdminObjectDCB[] adminobjects = new AdminObjectDCB[0];
+    private EnvironmentData environment;
 
     public ConnectorDCB(DDBean connectorDDBean, final GerConnectorType connector) {
         super(connectorDDBean, connector);
@@ -211,62 +211,26 @@
     // ----------------------- JavaBean Properties for /connector ----------------------
 
     //todo: the following child elements
-    // import*
-    // hidden-classes*
-    // non-overridable-classes*
     // gbean*
 
-//    public String getConfigID() {
-//        return getConnector().getConfigId();
-//    }
-
-//    public void setConfigID(String configId) {
-//        String old = getConfigID();
-//        getConnector().setConfigId(configId);
-//        pcs.firePropertyChange("configID", old, configId);
-//    }
-
-//    public String getParentID() {
-//        return getConnector().getParentId();
-//    }
-//
-//    public void setParentID(String parentId) {
-//        String old = getParentID();
-//        if(parentId == null) {
-//            getConnector().unsetParentId();
-//        } else {
-//            getConnector().setParentId(parentId);
-//        }
-//        pcs.firePropertyChange("parentID", old, parentId);
-//    }
-//
-//    public Boolean getSuppressDefaultParentID() {
-//        return getConnector().isSetSuppressDefaultParentId() ? getConnector().getSuppressDefaultParentId()
? Boolean.TRUE : Boolean.FALSE : null;
-//    }
-//
-//    public void setSuppressDefaultParentID(Boolean suppress) {
-//        Boolean old = getSuppressDefaultParentID();
-//        if(suppress == null) {
-//            getConnector().unsetSuppressDefaultParentId();
-//        } else {
-//            getConnector().setSuppressDefaultEnvironment(suppress.booleanValue());
-//        }
-//        pcs.firePropertyChange("suppressDefaultParentID", old, suppress);
-//    }
-//
-//    public Boolean getInverseClassLoading() {
-//        return getConnector().isSetInverseClassloading() ? getConnector().getInverseClassloading()
? Boolean.TRUE : Boolean.FALSE : null;
-//    }
-//
-//    public void setInverseClassLoading(Boolean inverse) {
-//        Boolean old = getInverseClassLoading();
-//        if(inverse == null) {
-//            getConnector().unsetInverseClassloading();
-//        } else {
-//            getConnector().setInverseClassloading(inverse.booleanValue());
-//        }
-//        pcs.firePropertyChange("inverseClassLoading", old, inverse);
-//    }
+    public EnvironmentData getEnvironment() {
+        return environment;
+    }
+
+    public void setEnvironment(EnvironmentData environment) {
+        EnvironmentData old = this.environment;
+        this.environment = environment;
+        if((old == null && environment == null) || (old != null&& old ==
environment)) {
+            return;
+        }
+        if(old != null) {
+            getConnector().unsetEnvironment();
+        }
+        if(environment != null) {
+            environment.configure(getConnector().addNewEnvironment());
+        }
+        pcs.firePropertyChange("environment", old, environment);
+    }
 
     public ResourceAdapter[] getResourceAdapter() {
         return resourceAdapter;
@@ -314,53 +278,6 @@
         }
         pcs.firePropertyChange("resourceAdapter", old, resourceAdapter);
     }
-
-//    public Artifact[] getDependency() {
-//        return dependency;
-//    }
-//
-//    public void setDependency(Artifact[] dependency) {
-//        Artifact[] old = this.dependency;
-//        Set before = new HashSet();
-//        for (int i = 0; i < old.length; i++) {
-//            before.add(old[i]);
-//        }
-//        this.dependency = dependency;
-//         Handle current or new resource adapters
-//        for (int i = 0; i < dependency.length; i++) {
-//            Artifact dep = dependency[i];
-//            if(dep.getDependency() == null) {
-//                dep.configure(getConnector().addNewDependency());
-//            } else {
-//                before.remove(dep);
-//            }
-//        }
-        // Handle removed resource adapters
-//        for (Iterator it = before.iterator(); it.hasNext();) {
-//            Artifact dep = (Artifact) it.next();
-//            ArtifactType all[] = getConnector().getDependencyArray();
-//            for (int i = 0; i < all.length; i++) {
-//                if(all[i] == dep) {
-//                    getConnector().removeDependency(i);
-//                    break;
-//                }
-//            }
-//        }
-//        pcs.firePropertyChange("dependency", old, dependency);
-//    }
-//
-//    public Artifact getDependency(int index) {
-//        return dependency[index];
-//    }
-//
-//    public void setDependency(int index, Artifact dep) {
-//        Artifact[] old = this.dependency;
-//        dependency[index] = dep;
-//        if(dep.getDependency() == null) {
-//            dep.configure(getConnector().addNewDependency());
-//        }
-//        pcs.firePropertyChange("dependency", old, dependency);
-//    }
 
 
     // ----------------------- End of JavaBean Properties ----------------------

Modified: geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java?rev=393699&r1=393698&r2=393699&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java
(original)
+++ geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java
Wed Apr 12 20:28:38 2006
@@ -16,17 +16,6 @@
  */
 package org.apache.geronimo.connector.deployment.jsr88;
 
-import junit.framework.TestCase;
-import org.apache.geronimo.connector.deployment.RARConfiguration;
-import org.apache.geronimo.deployment.tools.loader.ConnectorDeployable;
-import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
-import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
-import org.apache.geronimo.naming.deployment.jsr88.GBeanLocator;
-
-import javax.enterprise.deploy.model.DDBeanRoot;
-import javax.enterprise.deploy.model.DDBean;
-import javax.enterprise.deploy.shared.ModuleType;
-import javax.enterprise.deploy.spi.DConfigBean;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
@@ -34,6 +23,18 @@
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
+import javax.enterprise.deploy.model.DDBean;
+import javax.enterprise.deploy.model.DDBeanRoot;
+import javax.enterprise.deploy.shared.ModuleType;
+import javax.enterprise.deploy.spi.DConfigBean;
+import junit.framework.TestCase;
+import org.apache.geronimo.connector.deployment.RARConfiguration;
+import org.apache.geronimo.deployment.tools.loader.ConnectorDeployable;
+import org.apache.geronimo.deployment.service.jsr88.EnvironmentData;
+import org.apache.geronimo.deployment.service.jsr88.Artifact;
+import org.apache.geronimo.naming.deployment.jsr88.GBeanLocator;
+import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
+import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
 
 /**
  * @version $Rev$ $Date$
@@ -67,31 +68,40 @@
         // Try the /connector element
         ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
         assertNotNull(connector);
-//        assertNull(connector.getConfigID());
-//        assertNull(connector.getInverseClassLoading());
-//        assertNull(connector.getParentID());
-//        assertNull(connector.getSuppressDefaultParentID());
-//        connector.setConfigID("MyDatabase");
-//        connector.setParentID("geronimo/j2ee-server/1.0/car");
-        // Try the /connector/dependency element
-//        assertNotNull(connector.getDependency());
-//        assertEquals(0, connector.getDependency().length);
-//        Artifact dep = new Artifact();
-//        connector.setDependency(new Artifact[]{dep});
-//        assertEquals(1, connector.getDependency().length);
-//        dep.setURI("postgresql/postgresql-8.0/313.jdbc3/jar");
-//        assertNull(dep.getArtifactId());
-//        assertNull(dep.getGroupId());
-//        assertNull(dep.getType());
-//        assertNull(dep.getVersion());
-//        dep.setGroupId("postgresql");
-//        dep.setArtifactId("postgresql-8.0");
-//        dep.setVersion("313.jdbc3");
-//        assertNull(dep.getURI());
-//        assertNull(dep.getType());
-        // todo: Try the /connector/import element
-        // todo: Try the /connector/hidden-classes element
-        // todo: Try the /connector/non-overridable-classes element
+        assertNull(connector.getEnvironment());
+        EnvironmentData environment = new EnvironmentData();
+        connector.setEnvironment(environment);
+        Artifact configId = new Artifact();
+        environment.setConfigId(configId);
+        assertNull(configId.getArtifactId());
+        assertNull(configId.getGroupId());
+        assertNull(configId.getType());
+        assertNull(configId.getVersion());
+        configId.setGroupId("test");
+        configId.setArtifactId("product");
+        configId.setType("rar");
+        configId.setVersion("1.0");
+        Artifact parent = new Artifact();
+        Artifact dependency = new Artifact();
+        environment.setDependencies(new Artifact[]{parent, dependency});
+        assertNull(parent.getArtifactId());
+        assertNull(parent.getGroupId());
+        assertNull(parent.getType());
+        assertNull(parent.getVersion());
+        assertNull(dependency.getArtifactId());
+        assertNull(dependency.getGroupId());
+        assertNull(dependency.getType());
+        assertNull(dependency.getVersion());
+        parent.setGroupId("geronimo");
+        parent.setArtifactId("j2ee-server");
+        parent.setType("car");
+        assertNull(parent.getVersion());
+        dependency.setGroupId("postgresql");
+        dependency.setArtifactId("postgresql-8.0");
+        dependency.setType("jar");
+        dependency.setVersion("313.jdbc3");
+        // todo: Try the /connector/environment/hidden-classes element
+        // todo: Try the /connector/environment/non-overridable-classes element
         // Try the /connector/resourceadapter element
         assertNotNull(connector.getResourceAdapter());
         assertEquals(1, connector.getResourceAdapter().length);
@@ -163,7 +173,7 @@
         pool.setMaxSize(new Integer(30));
         pool.setBlockingTimeoutMillis(new Integer(5000));
         //todo: Look at the XmlBeans tree and make sure the right stuff is in there
-//        System.out.println(dcbRoot.getConnectorDocument());
+        System.out.println(dcbRoot.getConnectorDocument());
     }
 
     public void testWriteWithNulls() throws Exception {
@@ -313,11 +323,11 @@
 //        connector.setConfigID("MyJMS");
 //        connector.setParentID("geronimo/activemq/1.0/car");
         // Try the /connector/dependency element
-//        assertNotNull(connector.getDependency());
-//        assertEquals(0, connector.getDependency().length);
+//        assertNotNull(connector.getArtifactType());
+//        assertEquals(0, connector.getArtifactType().length);
 //        Artifact dep = new Artifact();
 //        connector.setDependency(new Artifact[]{dep});
-//        assertEquals(1, connector.getDependency().length);
+//        assertEquals(1, connector.getArtifactType().length);
 //        dep.setURI("postgresql/postgresql-8.0/313.jdbc3/jar");
 //        assertNull(dep.getArtifactId());
 //        assertNull(dep.getGroupId());

Modified: geronimo/branches/1.1/modules/service-builder/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/service-builder/project.xml?rev=393699&r1=393698&r2=393699&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/service-builder/project.xml (original)
+++ geronimo/branches/1.1/modules/service-builder/project.xml Wed Apr 12 20:28:38 2006
@@ -81,6 +81,12 @@
 
         <dependency>
             <groupId>geronimo</groupId>
+            <artifactId>geronimo-deploy-config</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
             <artifactId>geronimo-system</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>

Copied: geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/jsr88/Artifact.java
(from r393678, geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/jsr88/Artifact.java)
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/jsr88/Artifact.java?p2=geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/jsr88/Artifact.java&p1=geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/jsr88/Artifact.java&r1=393678&r2=393699&rev=393699&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/jsr88/Artifact.java
(original)
+++ geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/jsr88/Artifact.java
Wed Apr 12 20:28:38 2006
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.geronimo.connector.deployment.jsr88;
+package org.apache.geronimo.deployment.service.jsr88;
 
 import org.apache.geronimo.deployment.plugin.XmlBeanSupport;
 import org.apache.geronimo.deployment.xbeans.ArtifactType;
@@ -22,9 +22,8 @@
 import org.apache.xmlbeans.XmlBeans;
 
 /**
- * Represents /connector/dependency in the Geronimo Connector deployment plan
- *
- * //todo: move to service-builder module
+ * Represents an artifactType (e.g. a dependency or configId element) in a
+ * Geronimo deployment plan.
  *
  * @version $Rev$ $Date$
  */
@@ -40,69 +39,64 @@
         configure(dependency);
     }
 
-    protected ArtifactType getDependency() {
+    protected ArtifactType getArtifactType() {
         return (ArtifactType) getXmlObject();
     }
 
     void configure(ArtifactType dependency) {
         setXmlObject(dependency);
-        //todo: read in data from dependency object?
     }
 
-    // ----------------------- JavaBean Properties for /connector/dependency ----------------------
+    // ----------------------- JavaBean Properties for artifactType ----------------------
 
     public String getGroupId() {
-        return getDependency().getGroupId();
+        return getArtifactType().getGroupId();
     }
 
     public void setGroupId(String groupId) {
         String old = getGroupId();
         if(groupId == null) {
-            getDependency().unsetGroupId();
+            getArtifactType().unsetGroupId();
         } else {
-            getDependency().setGroupId(groupId);
+            getArtifactType().setGroupId(groupId);
         }
         pcs.firePropertyChange("groupId", old, groupId);
     }
 
     public String getArtifactId() {
-        return getDependency().getArtifactId();
+        return getArtifactType().getArtifactId();
     }
 
     public void setArtifactId(String artifact) {
         String old = getArtifactId();
-//        if(artifact == null) {
-//            getDependency().unsetArtifactId();
-//        } else {
-            getDependency().setArtifactId(artifact);
-//        }
+        getArtifactType().setArtifactId(artifact);
         pcs.firePropertyChange("artifactId", old, artifact);
     }
 
     public String getType() {
-        return getDependency().getType();
+        return getArtifactType().getType();
     }
 
     public void setType(String type) {
-        String old = getDependency().getType();
+        String old = getArtifactType().getType();
         if(type == null) {
-            getDependency().unsetType();
+            getArtifactType().unsetType();
         } else {
-            getDependency().setType(type);
+            getArtifactType().setType(type);
         }
         pcs.firePropertyChange("type", old, type);
     }
 
     public String getVersion() {
-        return getDependency().getVersion();
+        return getArtifactType().getVersion();
     }
 
     public void setVersion(String version) {
         String old = getVersion();
         if(version == null) {
-            getDependency().unsetVersion();
+            getArtifactType().unsetVersion();
         } else {
-            getDependency().setVersion(version);
+            getArtifactType().setVersion(version);
         }
         pcs.firePropertyChange("version", old, version);
     }

Added: geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/jsr88/EnvironmentData.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/jsr88/EnvironmentData.java?rev=393699&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/jsr88/EnvironmentData.java
(added)
+++ geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/jsr88/EnvironmentData.java
Wed Apr 12 20:28:38 2006
@@ -0,0 +1,195 @@
+/**
+ * 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.jsr88;
+
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Iterator;
+import org.apache.geronimo.deployment.plugin.XmlBeanSupport;
+import org.apache.geronimo.deployment.xbeans.DependenciesType;
+import org.apache.geronimo.deployment.xbeans.EnvironmentType;
+import org.apache.geronimo.deployment.xbeans.ArtifactType;
+import org.apache.xmlbeans.SchemaTypeLoader;
+import org.apache.xmlbeans.XmlBeans;
+
+/**
+ * Represents an environmentType (e.g. an environment element) in a Geronimo
+ * deployment plan.
+ *
+ * @version $Rev: 355877 $ $Date: 2005-12-10 21:48:27 -0500 (Sat, 10 Dec 2005) $
+ */
+public class EnvironmentData extends XmlBeanSupport {
+    static final SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.typeLoaderForClassLoader(EnvironmentType.class.getClassLoader());
+
+    private Artifact configId;
+    private Artifact[] dependencies = new Artifact[0];
+
+    public EnvironmentData() {
+        super(null);
+    }
+
+    public EnvironmentData(EnvironmentType dependency) {
+        super(null);
+        configure(dependency);
+    }
+
+    protected EnvironmentType getEnvironmentType() {
+        return (EnvironmentType) getXmlObject();
+    }
+
+    public void configure(EnvironmentType env) {
+        setXmlObject(env);
+        if(env.isSetConfigId()) {
+            configId = new Artifact(env.getConfigId());
+        }
+        if(env.isSetDependencies()) {
+            DependenciesType deps = env.getDependencies();
+            dependencies = new Artifact[deps.getDependencyArray().length];
+            for (int i = 0; i < dependencies.length; i++) {
+                dependencies[i] = new Artifact(deps.getDependencyArray(i));
+            }
+        }
+    }
+
+    // ----------------------- JavaBean Properties for environmentType ----------------------
+
+    public Artifact getConfigId() {
+        return configId;
+    }
+
+    public void setConfigId(Artifact configId) {
+        Artifact old = this.configId;
+        this.configId = configId;
+        if((old == null && configId == null) || (old != null&& old == configId))
{
+            return;
+        }
+        if(old != null) {
+            getEnvironmentType().unsetConfigId();
+        }
+        if(configId != null) {
+            configId.configure(getEnvironmentType().addNewConfigId());
+        }
+        pcs.firePropertyChange("configId", old, configId);
+    }
+
+    public Artifact[] getDependencies() {
+        return dependencies;
+    }
+
+    public void setDependencies(Artifact[] dependencies) {
+        Artifact[] old = this.dependencies;
+        Set before = new HashSet();
+        for (int i = 0; i < old.length; i++) {
+            before.add(old[i]);
+        }
+        this.dependencies = dependencies;
+        // Handle current or new dependencies
+        for (int i = 0; i < dependencies.length; i++) {
+            Artifact dep = dependencies[i];
+            if(dep.getArtifactType() == null) {
+                if(!getEnvironmentType().isSetDependencies()) {
+                    getEnvironmentType().addNewDependencies();
+                }
+                dep.configure(getEnvironmentType().addNewDependencies().addNewDependency());
+            } else {
+                before.remove(dep);
+            }
+        }
+        // Handle removed or new dependencies
+        for (Iterator it = before.iterator(); it.hasNext();) {
+            Artifact adapter = (Artifact) it.next();
+            ArtifactType all[] = getEnvironmentType().getDependencies().getDependencyArray();
+            for (int i = 0; i < all.length; i++) {
+                if(all[i] == adapter) {
+                    getEnvironmentType().getDependencies().removeDependency(i);
+                    break;
+                }
+            }
+        }
+        if(getEnvironmentType().isSetDependencies() && getEnvironmentType().getDependencies().getDependencyArray().length
== 0) {
+            getEnvironmentType().unsetDependencies();
+        }
+        pcs.firePropertyChange("dependencies", old, dependencies);
+    }
+
+    public String[] getHiddenClasses() {
+        return getEnvironmentType().getHiddenClasses().getFilterArray();
+    }
+
+    public void setHiddenClasses(String[] hidden) {
+        String[] old = getEnvironmentType().isSetHiddenClasses() ? getEnvironmentType().getHiddenClasses().getFilterArray()
: null;
+        if(!getEnvironmentType().isSetHiddenClasses()) {
+            getEnvironmentType().addNewHiddenClasses();
+        }
+        getEnvironmentType().getHiddenClasses().setFilterArray(hidden);
+        pcs.firePropertyChange("hiddenClasses", old, hidden);
+    }
+
+    public String[] getNonOverridableClasses() {
+        return getEnvironmentType().getNonOverridableClasses().getFilterArray();
+    }
+
+    public void setNonOverridableClasses(String[] fixed) {
+        String[] old = getEnvironmentType().isSetNonOverridableClasses() ? getEnvironmentType().getNonOverridableClasses().getFilterArray()
: null;
+        if(!getEnvironmentType().isSetNonOverridableClasses()) {
+            getEnvironmentType().addNewNonOverridableClasses();
+        }
+        getEnvironmentType().getNonOverridableClasses().setFilterArray(fixed);
+        pcs.firePropertyChange("nonOverridableClasses", old, fixed);
+    }
+
+    public boolean isInverseClassLoading() {
+        return getEnvironmentType().isSetInverseClassloading();
+    }
+
+    public void setInverseClassLoading(boolean inverse) {
+        boolean old = isInverseClassLoading();
+        if(!inverse) {
+            if(old) {
+                getEnvironmentType().unsetInverseClassloading();
+            }
+        } else {
+            if(!old) {
+                getEnvironmentType().addNewInverseClassloading();
+            }
+        }
+        pcs.firePropertyChange("inverseClassLoading", old, inverse);
+    }
+
+    public boolean isSuppressDefaultEnvironment() {
+        return getEnvironmentType().isSetSuppressDefaultEnvironment();
+    }
+
+    public void setSuppressDefaultEnvironment(boolean suppress) {
+        boolean old = isSuppressDefaultEnvironment();
+        if(!suppress) {
+            if(old) {
+                getEnvironmentType().unsetSuppressDefaultEnvironment();
+            }
+        } else {
+            if(!old) {
+                getEnvironmentType().addNewSuppressDefaultEnvironment();
+            }
+        }
+        pcs.firePropertyChange("suppressDefaultEnvironment", old, suppress);
+    }
+
+    // ----------------------- End of JavaBean Properties ----------------------
+
+    protected SchemaTypeLoader getSchemaTypeLoader() {
+        return SCHEMA_TYPE_LOADER;
+    }
+}



Mime
View raw message