geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r328519 - in /geronimo/trunk/modules: kernel/src/java/org/apache/geronimo/gbean/ kernel/src/java/org/apache/geronimo/gbean/runtime/ kernel/src/test/org/apache/geronimo/gbean/runtime/ service-builder/src/java/org/apache/geronimo/deployment/s...
Date Wed, 26 Oct 2005 01:25:54 GMT
Author: djencks
Date: Tue Oct 25 18:25:48 2005
New Revision: 328519

URL: http://svn.apache.org/viewcvs?rev=328519&view=rev
Log:
GERONIMO-512 non-reference dependencies

Added:
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java
    geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java
Modified:
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanData.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
    geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
    geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
    geronimo/trunk/modules/service-builder/src/schema/geronimo-config-1.0.xsd

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanData.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanData.java?rev=328519&r1=328518&r2=328519&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanData.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanData.java Tue Oct
25 18:25:48 2005
@@ -36,23 +36,23 @@
     private GBeanInfo gbeanInfo;
     private final Map attributes;
     private final Map references;
+    private final Set dependencies;
 
     public GBeanData() {
         attributes = new HashMap();
         references = new HashMap();
+        dependencies = new HashSet();
     }
 
     public GBeanData(GBeanInfo gbeanInfo) {
+        this();
         this.gbeanInfo = gbeanInfo;
-        attributes = new HashMap();
-        references = new HashMap();
     }
 
     public GBeanData(ObjectName name, GBeanInfo gbeanInfo) {
+        this();
         this.name = name;
         this.gbeanInfo = gbeanInfo;
-        attributes = new HashMap();
-        references = new HashMap();
     }
 
     public GBeanData(GBeanData gbeanData) {
@@ -60,6 +60,7 @@
         gbeanInfo = gbeanData.gbeanInfo;
         attributes = new HashMap(gbeanData.attributes);
         references = new HashMap(gbeanData.references);
+        dependencies = new HashSet(gbeanData.dependencies);
     }
 
     public ObjectName getName() {
@@ -114,6 +115,10 @@
         references.put(name, patterns);
     }
 
+    public Set getDependencies() {
+        return dependencies;
+    }
+
     public void writeExternal(ObjectOutput out) throws IOException {
         // write the gbean info
         out.writeObject(gbeanInfo);
@@ -148,6 +153,13 @@
                 throw (IOException) new IOException("Unable to write reference pattern: "
+ name).initCause(e);
             }
         }
+        //write the dependencies
+        out.writeInt(dependencies.size());
+        for (Iterator iterator = dependencies.iterator(); iterator.hasNext();) {
+            ObjectName objectName = (ObjectName) iterator.next();
+            out.writeObject(objectName);
+        }
+
     }
 
 
@@ -173,6 +185,13 @@
             int endpointCount = in.readInt();
             for (int i = 0; i < endpointCount; i++) {
                 setReferencePatterns((String) in.readObject(), (Set) in.readObject());
+            }
+
+            //read the dependencies
+            int dependencyCount = in.readInt();
+            for (int i = 0; i < dependencyCount; i++) {
+                ObjectName objectName = (ObjectName) in.readObject();
+                dependencies.add(objectName);
             }
         } catch (IOException e) {
             throw (IOException) new IOException("Unable to deserialize GBeanData " + name).initCause(e);

Added: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java?rev=328519&view=auto
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java
(added)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java
Tue Oct 25 18:25:48 2005
@@ -0,0 +1,322 @@
+/**
+ *
+ * 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.
+ */
+package org.apache.geronimo.gbean.runtime;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import javax.management.ObjectName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.gbean.InvalidConfigurationException;
+import org.apache.geronimo.kernel.DependencyManager;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.lifecycle.LifecycleAdapter;
+import org.apache.geronimo.kernel.lifecycle.LifecycleListener;
+import org.apache.geronimo.kernel.management.State;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class GBeanDependency {
+    /**
+     * The GBeanInstance to which this reference belongs.
+     */
+    private final GBeanInstance gbeanInstance;
+
+    /**
+     * The target objectName patterns to watch for a connection.
+     */
+    private Set patterns = Collections.EMPTY_SET;
+
+    /**
+     * Our listener for lifecycle events
+     */
+    private final LifecycleListener listener;
+
+    /**
+     * Current set of targets
+     */
+    private final Set targets = new HashSet();
+
+    /**
+     * The kernel to which the reference is bound.
+     */
+    private final Kernel kernel;
+
+    /**
+     * The dependency manager of the kernel.
+     */
+    private final DependencyManager dependencyManager;
+
+    /**
+     * is this reference online
+     */
+    private boolean isOnline = false;
+
+    public GBeanDependency(GBeanInstance gbeanInstance, ObjectName pattern, Kernel kernel,
DependencyManager dependencyManager) throws InvalidConfigurationException {
+        this.gbeanInstance = gbeanInstance;
+        this.kernel = kernel;
+        this.dependencyManager = dependencyManager;
+        patterns = Collections.singleton(pattern);
+        listener = createLifecycleListener();
+    }
+
+    private static final Log log = LogFactory.getLog(GBeanSingleReference.class);
+
+    /**
+     * Is the GBeanMBean waitng for me to start?
+     */
+    private boolean waitingForMe = false;
+
+    /**
+     * The object to which the proxy is bound
+     */
+    private ObjectName proxyTarget;
+
+
+    public synchronized boolean start() {
+        // We only need to start if there are patterns and we don't already have a proxy
+        if (proxyTarget == null) {
+            //
+            // We must have exactally one running target
+            //
+            ObjectName objectName = getGBeanInstance().getObjectNameObject();
+            Set targets = getTargets();
+            if (targets.size() == 0) {
+                waitingForMe = true;
+                log.debug("Waiting to start " + objectName + " because no targets are running
for the dependency matching the patternspatterns " + getPatternsText());
+                return false;
+            } else if (targets.size() > 1) {
+                waitingForMe = true;
+                log.debug("Waiting to start " + objectName + " because more then one targets
are running for the dependency matching the patternspatterns " + getPatternsText());
+                return false;
+            }
+            waitingForMe = false;
+
+            // stop all gbeans that would match our patterns from starting
+            DependencyManager dependencyManager = getDependencyManager();
+            dependencyManager.addStartHolds(objectName, getPatterns());
+
+            // add a dependency on our target and create the proxy
+            ObjectName target = (ObjectName) targets.iterator().next();
+            proxyTarget = target;
+            dependencyManager.addDependency(objectName, target);
+        }
+
+        return true;
+    }
+
+    private String getPatternsText() {
+        StringBuffer buf = new StringBuffer();
+        Set patterns = getPatterns();
+        for (Iterator iterator = patterns.iterator(); iterator.hasNext();) {
+            ObjectName objectName = (ObjectName) iterator.next();
+            buf.append(objectName.getCanonicalName()).append(" ");
+        }
+        return buf.toString();
+    }
+
+    public synchronized void stop() {
+        waitingForMe = false;
+        ObjectName objectName = getGBeanInstance().getObjectNameObject();
+        Set patterns = getPatterns();
+        DependencyManager dependencyManager = getDependencyManager();
+        if (!patterns.isEmpty()) {
+            dependencyManager.removeStartHolds(objectName, patterns);
+        }
+
+        if (proxyTarget != null) {
+            dependencyManager.removeDependency(objectName, proxyTarget);
+            proxyTarget = null;
+        }
+    }
+
+    protected synchronized void targetAdded(ObjectName target) {
+        // if we are running, and we now have two valid targets, which is an illegal state
so we need to fail
+        GBeanInstance gbeanInstance = getGBeanInstance();
+        if (gbeanInstance.getStateInstance() == State.RUNNING) {
+            log.error("Illegal state: two or more targets are not running for a signle valued
reference: " + getDescription() +
+                    ", currentTarget=" + proxyTarget +
+                    ", newTarget=" + target);
+            gbeanInstance.referenceFailed();
+        } else if (waitingForMe) {
+            Set targets = getTargets();
+            if (targets.size() == 1) {
+                // the gbean was waiting for me and not there is now just one target
+                attemptFullStart();
+            }
+        }
+    }
+
+    protected synchronized void targetRemoved(ObjectName target) {
+        GBeanInstance gbeanInstance = getGBeanInstance();
+        if (gbeanInstance.getStateInstance() == State.RUNNING) {
+            // we no longer have a valid target, which is an illegal state so we need to
fail
+            log.error("Illegal state: current target for a signle valued reference stopped:
" + getDescription() +
+                    ", currentTarget=" + target);
+            gbeanInstance.referenceFailed();
+        } else if (waitingForMe) {
+            Set targets = getTargets();
+            if (targets.size() == 1) {
+                // the gbean was waiting for me and not there is now just one target
+                attemptFullStart();
+            }
+        }
+    }
+
+    private synchronized void attemptFullStart() {
+        try {
+            // there could be an issue with really badly written components holding up a
stop when the
+            // component never reached the starting phase... then a target registers and
we automatically
+            // attempt to restart
+            waitingForMe = false;
+            getGBeanInstance().start();
+        } catch (Exception e) {
+            log.warn("Exception occured while attempting to fully start: objectName=" + getGBeanInstance().getObjectName(),
e);
+        }
+    }
+
+    protected LifecycleListener createLifecycleListener() {
+        return new LifecycleAdapter() {
+                    public void running(ObjectName objectName) {
+                        addTarget(objectName);
+                    }
+
+                    public void stopped(ObjectName objectName) {
+                        removeTarget(objectName);
+                    }
+
+                    public void failed(ObjectName objectName) {
+                        removeTarget(objectName);
+                    }
+
+                    public void unloaded(ObjectName objectName) {
+                        removeTarget(objectName);
+                    }
+                };
+    }
+
+    protected final Kernel getKernel() {
+        return kernel;
+    }
+
+    protected final DependencyManager getDependencyManager() {
+        return dependencyManager;
+    }
+
+    public final GBeanInstance getGBeanInstance() {
+        return gbeanInstance;
+    }
+
+    public final Set getPatterns() {
+        return patterns;
+    }
+
+    public final void setPatterns(Set patterns) {
+        if (isOnline) {
+            throw new IllegalStateException("Pattern set can not be modified while online");
+        }
+
+        if (patterns == null || patterns.isEmpty() || (patterns.size() == 1 && patterns.iterator().next()
== null)) {
+            this.patterns = Collections.EMPTY_SET;
+        } else {
+            patterns = new HashSet(patterns);
+            for (Iterator iterator = this.patterns.iterator(); iterator.hasNext();) {
+                if (iterator.next() == null) {
+                    iterator.remove();
+                    //there can be at most one null value in a set.
+                    break;
+                }
+            }
+            this.patterns = Collections.unmodifiableSet(patterns);
+        }
+    }
+
+    public final synchronized void online() {
+        Set gbeans = kernel.listGBeans(patterns);
+        for (Iterator objectNameIterator = gbeans.iterator(); objectNameIterator.hasNext();)
{
+            ObjectName target = (ObjectName) objectNameIterator.next();
+            if (!targets.contains(target)) {
+
+                // if the bean is running add it to the runningTargets list
+                if (isRunning(kernel, target)) {
+                    targets.add(target);
+                }
+            }
+        }
+
+        kernel.getLifecycleMonitor().addLifecycleListener(listener, patterns);
+        isOnline = true;
+    }
+
+    public final synchronized void offline() {
+        // make sure we are stoped
+        stop();
+
+        kernel.getLifecycleMonitor().removeLifecycleListener(listener);
+
+        targets.clear();
+        isOnline = false;
+    }
+
+    protected final Set getTargets() {
+        return targets;
+    }
+
+    protected final void addTarget(ObjectName objectName) {
+        if (!targets.contains(objectName)) {
+            targets.add(objectName);
+            targetAdded(objectName);
+        }
+    }
+
+    protected final void removeTarget(ObjectName objectName) {
+        boolean wasTarget = targets.remove(objectName);
+        if (wasTarget) {
+            targetRemoved(objectName);
+        }
+    }
+
+
+    /**
+     * Is the component in the Running state
+     *
+     * @param objectName name of the component to check
+     * @return true if the component is running; false otherwise
+     */
+    private boolean isRunning(Kernel kernel, ObjectName objectName) {
+        try {
+            final int state = kernel.getGBeanState(objectName);
+            return state == State.RUNNING_INDEX;
+        } catch (GBeanNotFoundException e) {
+            // mbean is no longer registerd
+            return false;
+        } catch (Exception e) {
+            // problem getting the attribute, mbean has most likely failed
+            return false;
+        }
+    }
+
+    protected final String getDescription() {
+        return "\n    GBeanInstance: " + gbeanInstance.getName() +
+                "\n    Pattern Name: " + getPatterns();
+    }
+}

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=328519&r1=328518&r2=328519&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
Tue Oct 25 18:25:48 2005
@@ -120,6 +120,11 @@
     private final Map referenceIndex = new HashMap();
 
     /**
+     * Dependencies supported by this GBean.
+     */
+    private final GBeanDependency[] dependencies;
+
+    /**
      * Operations lookup table
      */
     private final GBeanOperation[] operations;
@@ -179,7 +184,7 @@
      * fail when it returns from usercode.  This is set when a
      * reference has gone offline during construction.
      */
-    private boolean shouldFail = false; 
+    private boolean shouldFail = false;
 
     /**
      * Construct a GBeanMBean using the supplied GBeanData and class loader
@@ -239,6 +244,14 @@
             referenceIndex.put(references[i].getName(), new Integer(i));
         }
 
+        dependencies = new GBeanDependency[gbeanData.getDependencies().size()];
+        int j = 0;
+        for (Iterator iterator = gbeanData.getDependencies().iterator(); iterator.hasNext();)
{
+            ObjectName dependencyName = (ObjectName) iterator.next();
+            GBeanDependency dependency = new GBeanDependency(this, dependencyName, kernel,
dependencyManager);
+            dependencies[j++] = dependency;
+        }
+
         // framework operations -- all framework operations have currently been removed
 
         // operations
@@ -321,6 +334,9 @@
         for (int i = 0; i < references.length; i++) {
             references[i].online();
         }
+        for (int i = 0; i < dependencies.length; i++) {
+            dependencies[i].online();
+        }
         lifecycleBroadcaster.fireLoadedEvent();
     }
 
@@ -344,6 +360,9 @@
         for (int i = 0; i < references.length; i++) {
             references[i].offline();
         }
+        for (int i = 0; i < dependencies.length; i++) {
+            dependencies[i].offline();
+        }
 
         // tell everyone we are done
         lifecycleBroadcaster.fireUnloadedEvent();
@@ -822,6 +841,9 @@
             for (int i = 0; i < references.length; i++) {
                 allStarted = references[i].start() && allStarted;
             }
+            for (int i = 0; i < dependencies.length; i++) {
+                allStarted = dependencies[i].start() && allStarted;
+            }
             if (!allStarted) {
                 return false;
             }
@@ -919,6 +941,9 @@
                 for (int i = 0; i < references.length; i++) {
                     references[i].stop();
                 }
+                for (int i = 0; i < dependencies.length; i++) {
+                    dependencies[i].stop();
+                }
 
                 target = null;
                 instanceState = DESTROYED;
@@ -1041,6 +1066,9 @@
             // stop all of the references
             for (int i = 0; i < references.length; i++) {
                 references[i].stop();
+            }
+            for (int i = 0; i < dependencies.length; i++) {
+                dependencies[i].stop();
             }
 
             target = null;

Added: geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java?rev=328519&view=auto
==============================================================================
--- geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java
(added)
+++ geronimo/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java
Tue Oct 25 18:25:48 2005
@@ -0,0 +1,60 @@
+/**
+ *
+ * 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.gbean.runtime;
+
+import javax.management.ObjectName;
+
+import junit.framework.TestCase;
+import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.MockGBean;
+import org.apache.geronimo.kernel.MockDynamicGBean;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.management.State;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GAttributeInfo;
+
+/**
+ * @version $Rev:  $ $Date:  $
+ */
+public class GBeanDependencyTest extends TestCase {
+
+    private Kernel kernel;
+    
+    public void testGBeanDependency() throws Exception {
+        ObjectName parentName = new ObjectName("test:MockGBean=parent");
+        GBeanData gbeanDataParent = new GBeanData(parentName, MockGBean.getGBeanInfo());
+        GBeanData gbeanDataChild = new GBeanData(new ObjectName("test:MockGBean=child"),
MockGBean.getGBeanInfo());
+        gbeanDataChild.getDependencies().add(parentName);
+        kernel.loadGBean(gbeanDataChild, MockGBean.class.getClassLoader());
+        kernel.startGBean(gbeanDataChild.getName());
+        assertEquals(State.STARTING_INDEX, kernel.getGBeanState(gbeanDataChild.getName()));
+        kernel.loadGBean(gbeanDataParent, MockGBean.class.getClassLoader());
+        assertEquals(State.STARTING_INDEX, kernel.getGBeanState(gbeanDataChild.getName()));
+        kernel.startGBean(parentName);
+        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(gbeanDataChild.getName()));
+    }
+
+    protected void setUp() throws Exception {
+        kernel = KernelFactory.newInstance().createKernel("test");
+        kernel.boot();
+    }
+
+    protected void tearDown() throws Exception {
+        kernel.shutdown();
+    }
+
+}

Modified: geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java?rev=328519&r1=328518&r2=328519&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
(original)
+++ geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
Tue Oct 25 18:25:48 2005
@@ -135,6 +135,15 @@
         gbean.setReferencePatterns(name, patternNames);
     }
 
+    public void addDependency(PatternType patternType, J2eeContext j2eeContext) throws DeploymentException
{
+        try {
+            ObjectName objectName = buildObjectName(null, patternType, j2eeContext);
+            gbean.getDependencies().add(objectName);
+        } catch (MalformedObjectNameException e) {
+            throw new DeploymentException("Invalid pattern for dependency: " + patternType,
e);
+        }
+    }
+
     private ObjectName buildObjectName(String refName, PatternType pattern, J2eeContext j2eeContext)
throws MalformedObjectNameException, DeploymentException {
         if (pattern.isSetGbeanName()) {
             String gbeanName = pattern.getGbeanName();
@@ -150,6 +159,9 @@
 
         //get the type from the gbean info if not supplied explicitly
         if (type == null) {
+            if (refName == null) {
+                throw new DeploymentException("No type specified in dependency pattern "
+ pattern + " for gbean " + gbean.getName());
+            }
             boolean found = false;
             Set referenceInfos = gbean.getGBeanInfo().getReferences();
             for (Iterator iterator = referenceInfos.iterator(); iterator.hasNext();) {
@@ -170,4 +182,5 @@
     public GBeanData getGBeanData() {
         return gbean;
     }
+
 }

Modified: geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?rev=328519&r1=328518&r2=328519&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
(original)
+++ geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
Tue Oct 25 18:25:48 2005
@@ -53,6 +53,7 @@
 import org.apache.geronimo.deployment.xbeans.ReferencesType;
 import org.apache.geronimo.deployment.xbeans.ServiceDocument;
 import org.apache.geronimo.deployment.xbeans.XmlAttributeType;
+import org.apache.geronimo.deployment.xbeans.PatternType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -383,6 +384,14 @@
                     throw new DeploymentException("Unexpected count of xs:any elements in
xml-attribute " + anys.length + " qnameset: " + XmlAttributeType.type.qnameSetForWildcardElements());
                 }
                 builder.setXmlReference(name, anys[0]);
+            }
+        }
+
+        PatternType[] dependencyArray = gbean.getDependencyArray();
+        if (dependencyArray != null) {
+            for (int i = 0; i < dependencyArray.length; i++) {
+                PatternType patternType = dependencyArray[i];
+                builder.addDependency(patternType, j2eeContext);
             }
         }
 

Modified: geronimo/trunk/modules/service-builder/src/schema/geronimo-config-1.0.xsd
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/schema/geronimo-config-1.0.xsd?rev=328519&r1=328518&r2=328519&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/schema/geronimo-config-1.0.xsd (original)
+++ geronimo/trunk/modules/service-builder/src/schema/geronimo-config-1.0.xsd Tue Oct 25 18:25:48
2005
@@ -88,6 +88,7 @@
             <xs:element name="reference" type="sys:referenceType"/>
             <xs:element name="references" type="sys:referencesType"/>
             <xs:element name="xml-reference" type="sys:xml-attributeType"/>
+            <xs:element name="dependency" type="sys:patternType"/>
         </xs:choice>
         <xs:attribute name="gbeanName" type="xs:string"/>
         <xs:attribute name="name" type="xs:string"/>



Mime
View raw message