geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r406010 - in /geronimo/branches/1.1/modules: deploy-config/src/java/org/apache/geronimo/deployment/plugin/ naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/
Date Sat, 13 May 2006 04:06:16 GMT
Author: ammulder
Date: Fri May 12 21:06:15 2006
New Revision: 406010

URL: http://svn.apache.org/viewcvs?rev=406010&view=rev
Log:
Add some naming JavaBeans to support more DConfigBeans

Added:
    geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbLocalRef.java
  (with props)
    geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbRef.java
  (with props)
    geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/HasPattern.java
  (with props)
    geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceEnvRef.java
  (with props)
    geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceRef.java
  (with props)
Modified:
    geronimo/branches/1.1/modules/deploy-config/src/java/org/apache/geronimo/deployment/plugin/XmlBeanSupport.java
    geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/GBeanLocator.java

Modified: geronimo/branches/1.1/modules/deploy-config/src/java/org/apache/geronimo/deployment/plugin/XmlBeanSupport.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-config/src/java/org/apache/geronimo/deployment/plugin/XmlBeanSupport.java?rev=406010&r1=406009&r2=406010&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-config/src/java/org/apache/geronimo/deployment/plugin/XmlBeanSupport.java
(original)
+++ geronimo/branches/1.1/modules/deploy-config/src/java/org/apache/geronimo/deployment/plugin/XmlBeanSupport.java
Fri May 12 21:06:15 2006
@@ -74,4 +74,13 @@
     protected SchemaTypeLoader getSchemaTypeLoader() {
         return null;
     }
+
+    // Must be public but should not be a JavaBean property -- sigh
+    public boolean configured() {
+        return getXmlObject() != null;
+    }
+
+    protected static boolean isEmpty(String s) {
+        return s == null || s.trim().equals("");
+    }
 }

Added: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbLocalRef.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbLocalRef.java?rev=406010&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbLocalRef.java
(added)
+++ geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbLocalRef.java
Fri May 12 21:06:15 2006
@@ -0,0 +1,85 @@
+/**
+ *
+ * Copyright 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.
+ */
+package org.apache.geronimo.naming.deployment.jsr88;
+
+import org.apache.geronimo.xbeans.geronimo.naming.GerEjbLocalRefType;
+
+/**
+ * Represents an element of the ejb-local-refType in a Geronimo deployment
+ * plan.
+ *                                          <p>
+ * Has 3 JavaBean Properties                <br />
+ *  - refName (type String)                 <br />
+ *  - pattern (type Pattern)                <br />
+ *  - ejbLink (type String)                 </p>
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class EjbLocalRef extends HasPattern {
+    public EjbLocalRef() {
+        super(null);
+    }
+
+    public EjbLocalRef(GerEjbLocalRefType xmlObject) {
+        super(xmlObject);
+    }
+
+    public void setRefName(String name) {
+        String old = getEjbLocalRef().getRefName();
+        getEjbLocalRef().setRefName(name);
+        pcs.firePropertyChange("refName", old, name);
+    }
+
+    public String getRefName() {
+        return getEjbLocalRef().getRefName();
+    }
+
+    public String getEjbLink() {
+        return getEjbLocalRef().getEjbLink();
+    }
+
+    public void setEjbLink(String link) {
+        GerEjbLocalRefType ref = getEjbLocalRef();
+        if(link != null && ref.isSetPattern()) {
+            clearPatternFromChoice();
+        }
+        String old = getEjbLink();
+        ref.setEjbLink(link);
+        pcs.firePropertyChange("ejbLink", old, link);
+    }
+
+
+    protected void clearNonPatternFromChoice() {
+        GerEjbLocalRefType ref = getEjbLocalRef();
+        if(ref.isSetEjbLink()) {
+            String temp = ref.getEjbLink();
+            ref.unsetEjbLink();
+            pcs.firePropertyChange("ejbLink", temp, null);
+        }
+        // todo: clear CORBA property
+    }
+
+    // todo: getter and setter for CORBA property
+
+    protected GerEjbLocalRefType getEjbLocalRef() {
+        return (GerEjbLocalRefType) getXmlObject();
+    }
+
+    public void configure(GerEjbLocalRefType xml) {
+        setXmlObject(xml);
+    }
+}

Propchange: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbLocalRef.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbRef.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbRef.java?rev=406010&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbRef.java
(added)
+++ geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbRef.java
Fri May 12 21:06:15 2006
@@ -0,0 +1,88 @@
+/**
+ *
+ * Copyright 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.
+ */
+package org.apache.geronimo.naming.deployment.jsr88;
+
+import org.apache.geronimo.xbeans.geronimo.naming.GerEjbRefType;
+
+/**
+ * Represents an element of the ejb-refType in a Geronimo deployment plan.
+ *                                          <p>
+ * Has 4 JavaBean Properties                <br />
+ *  - refName (type String)                 <br />
+ *  - pattern (type Pattern)                <br />
+ *  - corbaNamingGroup (type ???)           <br />
+ *  - ejbLink (type String)                 </p>
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class EjbRef extends HasPattern {
+    public EjbRef() {
+        super(null);
+    }
+
+    public EjbRef(GerEjbRefType xmlObject) {
+        super(xmlObject);
+    }
+
+    public void setRefName(String name) {
+        String old = getEjbRef().getRefName();
+        getEjbRef().setRefName(name);
+        pcs.firePropertyChange("refName", old, name);
+    }
+
+    public String getRefName() {
+        return getEjbRef().getRefName();
+    }
+
+    public String getEjbLink() {
+        return getEjbRef().getEjbLink();
+    }
+
+    public void setEjbLink(String link) {
+        GerEjbRefType ref = getEjbRef();
+        if(link != null) {
+            if(ref.isSetPattern()) {
+                clearPatternFromChoice();
+            }
+            // todo: clear CORBA property
+        }
+        String old = getEjbLink();
+        ref.setEjbLink(link);
+        pcs.firePropertyChange("ejbLink", old, link);
+    }
+
+
+    protected void clearNonPatternFromChoice() {
+        GerEjbRefType ref = getEjbRef();
+        if(ref.isSetEjbLink()) {
+            String temp = ref.getEjbLink();
+            ref.unsetEjbLink();
+            pcs.firePropertyChange("ejbLink", temp, null);
+        }
+        // todo: clear CORBA property
+    }
+
+    // todo: getter and setter for CORBA property
+
+    protected GerEjbRefType getEjbRef() {
+        return (GerEjbRefType) getXmlObject();
+    }
+
+    public void configure(GerEjbRefType xml) {
+        setXmlObject(xml);
+    }
+}

Propchange: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/EjbRef.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/GBeanLocator.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/GBeanLocator.java?rev=406010&r1=406009&r2=406010&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/GBeanLocator.java
(original)
+++ geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/GBeanLocator.java
Fri May 12 21:06:15 2006
@@ -1,16 +1,18 @@
 package org.apache.geronimo.naming.deployment.jsr88;
 
-import org.apache.geronimo.deployment.plugin.XmlBeanSupport;
 import org.apache.geronimo.xbeans.geronimo.naming.GerGbeanLocatorType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
 
 /**
  * Represents an element of the gbean-locatorType in a Geronimo
  * deployment plan.
+ *                                     <p>
+ * Has 2 JavaBean Properties           <br />
+ *  - GBeanLink (type String)          <br />
+ *  - pattern (type Pattern)           </p>
  *
  * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
  */
-public class GBeanLocator extends XmlBeanSupport {
+public class GBeanLocator extends HasPattern {
     public GBeanLocator() {
         super(null);
     }
@@ -23,11 +25,6 @@
         return (GerGbeanLocatorType) getXmlObject();
     }
 
-    // Must be public but should not be a JavaBean property -- sigh
-    public boolean configured() {
-        return getXmlObject() != null;
-    }
-
     public void configure(GerGbeanLocatorType xml) {
         setXmlObject(xml);
     }
@@ -38,12 +35,8 @@
 
     public void setGBeanLink(String link) {
         GerGbeanLocatorType locator = getGBeanLocator();
-        if(link != null) {
-            if(locator.isSetPattern()) {
-                Pattern oldPattern = buildPattern(locator.getPattern());
-                locator.unsetPattern();
-                pcs.firePropertyChange("objectNameComponents", oldPattern, null);
-            }
+        if(link != null && locator.isSetPattern()) {
+            clearPatternFromChoice();
         }
         String old = getGBeanLink();
         locator.setGbeanLink(link);
@@ -51,49 +44,12 @@
     }
 
 
-    public Pattern buildPattern(GerPatternType patternType) {
-        Pattern group = new Pattern();
-        group.setGroupId(patternType.getGroupId());
-        group.setArtifactId(patternType.getArtifactId());
-        group.setVersion(patternType.getVersion());
-        group.setModule(patternType.getModule());
-        group.setName(patternType.getName());
-        return group.empty() ? null : group;
-    }
-
-    public void setPattern(Pattern group) {
+    protected void clearNonPatternFromChoice() {
         GerGbeanLocatorType locator = getGBeanLocator();
-        if(group != null && !group.empty()) {
-            if(locator.isSetGbeanLink()) {
-                String temp = locator.getGbeanLink();
-                locator.unsetGbeanLink();
-                pcs.firePropertyChange("GBeanLink", temp, null);
-            }
+        if(locator.isSetGbeanLink()) {
+            String temp = locator.getGbeanLink();
+            locator.unsetGbeanLink();
+            pcs.firePropertyChange("GBeanLink", temp, null);
         }
-        Pattern old = buildPattern(locator.getPattern());
-            locator.unsetPattern();
-        if(group != null) {
-            GerPatternType patternType = locator.addNewPattern();
-            if(!isEmpty(group.getGroupId())) {
-                patternType.setGroupId(group.getGroupId());
-            }
-            if(!isEmpty(group.getArtifactId())) {
-                patternType.setArtifactId(group.getArtifactId());
-            }
-            if(!isEmpty(group.getModule())) {
-                patternType.setModule(group.getModule());
-            }
-            if(!isEmpty(group.getName())) {
-                patternType.setName(group.getName());
-            }
-            if(!isEmpty(group.getVersion())) {
-                patternType.setVersion(group.getVersion());
-            }
-        }
-        pcs.firePropertyChange("objectNameComponents", old, group);
-    }
-
-    private static boolean isEmpty(String s) {
-        return s == null || s.trim().equals("");
     }
 }

Added: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/HasPattern.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/HasPattern.java?rev=406010&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/HasPattern.java
(added)
+++ geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/HasPattern.java
Fri May 12 21:06:15 2006
@@ -0,0 +1,136 @@
+/**
+ *
+ * Copyright 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.
+ */
+package org.apache.geronimo.naming.deployment.jsr88;
+
+import javax.xml.namespace.QName;
+import org.apache.geronimo.deployment.plugin.XmlBeanSupport;
+import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.impl.values.XmlObjectBase;
+
+/**
+ * Represents an element in a Geronimo dployment plan that has a child
+ * of type Pattern.  This handles patterns that are a member of a choice as
+ * well as singleton patterns.
+ *                                     <p>
+ * Has 1 JavaBean Properties           <br />
+ *  - pattern (type Pattern)           </p>
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class HasPattern extends XmlBeanSupport {
+    public HasPattern() {
+        super(null);
+    }
+
+    public HasPattern(XmlObject xmlObject) {
+        super(xmlObject);
+    }
+
+    /**
+     * JavaBean getter for the Pattern property.  Gets a JavaBean of type
+     * Pattern for the pattern child of this element, or null if there is no
+     * pattern child.
+     */
+    public Pattern getPattern() {
+        GerPatternType patternType = findPattern();
+        if(patternType == null) return null;
+        Pattern group = new Pattern();
+        group.setGroupId(patternType.getGroupId());
+        group.setArtifactId(patternType.getArtifactId());
+        group.setVersion(patternType.getVersion());
+        group.setModule(patternType.getModule());
+        group.setName(patternType.getName());
+        return group.empty() ? null : group;
+    }
+
+    /**
+     * JavaBean setter for the Pattern property.  Calls the helper
+     * clearNonPatternFromChoice if a non-null Pattern is set.
+     */
+    public void setPattern(Pattern group) {
+        Pattern old = getPattern();
+        if(group != null) {
+            GerPatternType patternType;
+            if(old == null) {
+                patternType = (GerPatternType) ((XmlObjectBase)getXmlObject()).get_store().add_element_user(new
QName("http://geronimo.apache.org/xml/ns/naming-1.1", "pattern"));
+            } else {
+                patternType = findPattern();
+            }
+            if(!isEmpty(group.getGroupId())) {
+                patternType.setGroupId(group.getGroupId());
+            } else {
+                if(patternType.isSetGroupId()) patternType.unsetGroupId();
+            }
+            if(!isEmpty(group.getArtifactId())) {
+                patternType.setArtifactId(group.getArtifactId());
+            } else {
+                if(patternType.isSetArtifactId()) patternType.unsetArtifactId();
+            }
+            if(!isEmpty(group.getModule())) {
+                patternType.setModule(group.getModule());
+            } else {
+                if(patternType.isSetModule()) patternType.unsetModule();
+            }
+            patternType.setName(group.getName());
+            if(!isEmpty(group.getVersion())) {
+                patternType.setVersion(group.getVersion());
+            } else {
+                if(patternType.isSetVersion()) patternType.unsetVersion();
+            }
+            clearNonPatternFromChoice();
+        } else {
+            if(old != null) {
+                ((XmlObjectBase)getXmlObject()).get_store().remove_element(new QName("http://geronimo.apache.org/xml/ns/naming-1.1",
"pattern"), 0);
+            }
+        }
+        pcs.firePropertyChange("objectNameComponents", old, group);
+    }
+
+    /**
+     * Should be overridden to remove any non-pattern elements if this
+     * element has a pattern that's part of a choice.  If this is called, it
+     * means a non-null Pattern is in the process of being set.  This method
+     * should fire property change events on any elements it removes.
+     */
+    protected void clearNonPatternFromChoice() {}
+
+    /**
+     * Should be called to remove any pattern child element if the pattern is
+     * part of a choice and some other element in the choice was set to a
+     * non-null value.  This will clear the pattern and send a property change
+     * event on the "pattern" property if the pattern was set.
+     */
+    protected void clearPatternFromChoice() {
+        Pattern pattern = getPattern();
+        if(pattern != null) {
+            ((XmlObjectBase)getXmlObject()).get_store().remove_element(new QName("http://geronimo.apache.org/xml/ns/naming-1.1",
"pattern"), 0);
+            pcs.firePropertyChange("pattern", pattern, null);
+        }
+    }
+
+    /**
+     * Gets the pattern child of this element, or null if there is none.
+     */
+    protected GerPatternType findPattern() {
+        XmlObject[] patterns = getXmlObject().selectChildren(new QName(GerPatternType.type.getName().getNamespaceURI(),
"pattern"));
+        if(patterns.length == 0) {
+            return null;
+        }
+        return (GerPatternType)patterns[0];
+    }
+}

Propchange: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/HasPattern.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceEnvRef.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceEnvRef.java?rev=406010&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceEnvRef.java
(added)
+++ geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceEnvRef.java
Fri May 12 21:06:15 2006
@@ -0,0 +1,103 @@
+/**
+ *
+ * Copyright 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.
+ */
+package org.apache.geronimo.naming.deployment.jsr88;
+
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceEnvRefType;
+
+/**
+ * Represents an element of the resource-env-refType in a Geronimo deployment
+ * plan.
+ *                                             <p>
+ * Has 4 JavaBean Properties                   <br />
+ *  - refName (type String)                    <br />
+ *  - pattern (type Pattern)                   <br />
+ *  - adminObjectModule (type String)          <br />
+ *  - adminObjectLink (type String)            </p>
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class ResourceEnvRef extends HasPattern {
+    public ResourceEnvRef() {
+        super(null);
+    }
+
+    public ResourceEnvRef(GerResourceEnvRefType xmlObject) {
+        super(xmlObject);
+    }
+
+    public void setRefName(String name) {
+        String old = getResourceRef().getRefName();
+        getResourceRef().setRefName(name);
+        pcs.firePropertyChange("refName", old, name);
+    }
+
+    public String getRefName() {
+        return getResourceRef().getRefName();
+    }
+
+    public String getAdminObjectLink() {
+        return getResourceRef().getAdminObjectLink();
+    }
+
+    public void setAdminObjectLink(String link) {
+        GerResourceEnvRefType ref = getResourceRef();
+        if(link != null && ref.isSetPattern()) {
+            clearPatternFromChoice();
+        }
+        String old = getAdminObjectLink();
+        ref.setAdminObjectLink(link);
+        pcs.firePropertyChange("adminObjectLink", old, link);
+    }
+
+    public String getAdminObjectModule() {
+        return getResourceRef().getAdminObjectModule();
+    }
+
+    public void setAdminObjectModule(String module) {
+        GerResourceEnvRefType ref = getResourceRef();
+        if(module != null && ref.isSetPattern()) {
+            clearPatternFromChoice();
+        }
+        String old = getAdminObjectModule();
+        ref.setAdminObjectModule(module);
+        pcs.firePropertyChange("adminObjectModule", old, module);
+    }
+
+
+    protected void clearNonPatternFromChoice() {
+        GerResourceEnvRefType ref = getResourceRef();
+        if(ref.isSetAdminObjectLink()) {
+            String temp = ref.getAdminObjectLink();
+            ref.unsetAdminObjectLink();
+            pcs.firePropertyChange("adminObjectLink", temp, null);
+        }
+        if(ref.isSetAdminObjectModule()) {
+            String temp = ref.getAdminObjectModule();
+            ref.unsetAdminObjectModule();
+            pcs.firePropertyChange("adminObjectModule", temp, null);
+        }
+    }
+
+    protected GerResourceEnvRefType getResourceRef() {
+        return (GerResourceEnvRefType) getXmlObject();
+    }
+
+    public void configure(GerResourceEnvRefType xml) {
+        setXmlObject(xml);
+    }
+}

Propchange: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceEnvRef.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceRef.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceRef.java?rev=406010&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceRef.java
(added)
+++ geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceRef.java
Fri May 12 21:06:15 2006
@@ -0,0 +1,116 @@
+/**
+ *
+ * Copyright 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.
+ */
+package org.apache.geronimo.naming.deployment.jsr88;
+
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
+
+/**
+ * Represents an element of the resource-refType in a Geronimo deployment
+ * plan.
+ *                                          <p>
+ * Has 4 JavaBean Properties                <br />
+ *  - refName (type String)                 <br />
+ *  - pattern (type Pattern)                <br />
+ *  - url (type String)                     <br />
+ *  - resourceLink (type String)            </p>
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class ResourceRef extends HasPattern {
+    public ResourceRef() {
+        super(null);
+    }
+
+    public ResourceRef(GerResourceRefType xmlObject) {
+        super(xmlObject);
+    }
+
+    public void setRefName(String name) {
+        String old = getResourceRef().getRefName();
+        getResourceRef().setRefName(name);
+        pcs.firePropertyChange("refName", old, name);
+    }
+
+    public String getRefName() {
+        return getResourceRef().getRefName();
+    }
+
+    public String getResourceLink() {
+        return getResourceRef().getResourceLink();
+    }
+
+    public void setResourceLink(String link) {
+        GerResourceRefType ref = getResourceRef();
+        if(link != null) {
+            if(ref.isSetPattern()) {
+                clearPatternFromChoice();
+            }
+            if(ref.isSetUrl()) {
+                String old = getUrl();
+                ref.unsetUrl();
+                pcs.firePropertyChange("url", old, null);
+            }
+        }
+        String old = getResourceLink();
+        ref.setResourceLink(link);
+        pcs.firePropertyChange("resourceLink", old, link);
+    }
+
+    public String getUrl() {
+        return getResourceRef().getResourceLink();
+    }
+
+    public void setUrl(String link) {
+        GerResourceRefType ref = getResourceRef();
+        if(link != null) {
+            if(ref.isSetPattern()) {
+                clearPatternFromChoice();
+            }
+            if(ref.isSetResourceLink()) {
+                String old = getResourceLink();
+                ref.unsetResourceLink();
+                pcs.firePropertyChange("resourceLink", old, null);
+            }
+        }
+        String old = getUrl();
+        ref.setUrl(link);
+        pcs.firePropertyChange("url", old, link);
+    }
+
+
+    protected void clearNonPatternFromChoice() {
+        GerResourceRefType ref = getResourceRef();
+        if(ref.isSetResourceLink()) {
+            String temp = ref.getResourceLink();
+            ref.unsetResourceLink();
+            pcs.firePropertyChange("resourceLink", temp, null);
+        }
+        if(ref.isSetUrl()) {
+            String temp = ref.getUrl();
+            ref.unsetUrl();
+            pcs.firePropertyChange("url", temp, null);
+        }
+    }
+
+    protected GerResourceRefType getResourceRef() {
+        return (GerResourceRefType) getXmlObject();
+    }
+
+    public void configure(GerResourceRefType xml) {
+        setXmlObject(xml);
+    }
+}

Propchange: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/jsr88/ResourceRef.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message