Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 89560 invoked from network); 6 Mar 2006 21:45:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Mar 2006 21:45:38 -0000 Received: (qmail 35854 invoked by uid 500); 6 Mar 2006 21:45:37 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 35420 invoked by uid 500); 6 Mar 2006 21:45:35 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 35385 invoked by uid 99); 6 Mar 2006 21:45:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Mar 2006 13:45:34 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Mar 2006 13:45:30 -0800 Received: (qmail 89368 invoked by uid 65534); 6 Mar 2006 21:45:09 -0000 Message-ID: <20060306214509.89367.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r383682 [2/5] - in /geronimo/branches/1.1/modules: connector/src/test/org/apache/geronimo/connector/ connector/src/test/org/apache/geronimo/connector/outbound/ deployment/src/java/org/apache/geronimo/deployment/ j2ee/src/java/org/apache/ger... Date: Mon, 06 Mar 2006 21:44:37 -0000 To: scm@geronimo.apache.org From: djencks@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java Mon Mar 6 13:44:29 2006 @@ -28,6 +28,8 @@ import org.apache.geronimo.kernel.lifecycle.LifecycleAdapter; import org.apache.geronimo.kernel.lifecycle.LifecycleListener; import org.apache.geronimo.kernel.management.State; +import org.apache.geronimo.gbean.AbstractName; +import org.apache.geronimo.gbean.AbstractNameQuery; /** * @version $Rev$ $Date$ @@ -48,7 +50,7 @@ /** * The unique name of this service. */ - private final ObjectName objectName; + private final AbstractName abstractName; /** * The dependency manager @@ -70,8 +72,8 @@ // objects check if each other are in one state or another (i.e., classic A calls B while B calls A) private volatile State state = State.STOPPED; - GBeanInstanceState(ObjectName objectName, Kernel kernel, DependencyManager dependencyManager, GBeanInstance gbeanInstance, LifecycleBroadcaster lifecycleBroadcaster) { - this.objectName = objectName; + GBeanInstanceState(AbstractName abstractName, Kernel kernel, DependencyManager dependencyManager, GBeanInstance gbeanInstance, LifecycleBroadcaster lifecycleBroadcaster) { + this.abstractName = abstractName; this.kernel = kernel; this.dependencyManager = dependencyManager; this.gbeanInstance = gbeanInstance; @@ -132,19 +134,17 @@ start(); // startRecursive all of objects that depend on me - Set dependents = dependencyManager.getChildren(objectName); + Set dependents = dependencyManager.getChildren(abstractName); for (Iterator iterator = dependents.iterator(); iterator.hasNext();) { - ObjectName dependent = (ObjectName) iterator.next(); + AbstractName dependent = (AbstractName) iterator.next(); try { if (kernel.isGBeanEnabled(dependent)) { kernel.startRecursiveGBean(dependent); } } catch (GBeanNotFoundException e) { // this is ok the gbean died before we could start it - continue; } catch (Exception e) { - // the is something wrong with this gbean... skip it - continue; + // there is something wrong with this gbean... skip it } } } @@ -182,9 +182,9 @@ // Don't try to stop dependents from within a synchronized block... this should reduce deadlocks // stop all of my dependent objects - Set dependents = dependencyManager.getChildren(objectName); + Set dependents = dependencyManager.getChildren(abstractName); for (Iterator iterator = dependents.iterator(); iterator.hasNext();) { - ObjectName child = (ObjectName) iterator.next(); + AbstractName child = (AbstractName) iterator.next(); try { log.trace("Checking if child is running: child=" + child); if (kernel.getGBeanState(child) == State.RUNNING_INDEX) { @@ -253,25 +253,25 @@ } // check if an gbean is blocking us from starting - final ObjectName blocker = dependencyManager.checkBlocker(objectName); + final AbstractName blocker = dependencyManager.checkBlocker(abstractName); if (blocker != null) { blockerListener = new LifecycleAdapter() { - public void stopped(ObjectName objectName) { - checkBlocker(objectName); + public void stopped(AbstractName abstractName) { + checkBlocker(abstractName); } - public void failed(ObjectName objectName) { - checkBlocker(objectName); + public void failed(AbstractName abstractName) { + checkBlocker(abstractName); } - public void unloaded(ObjectName objectName) { - checkBlocker(objectName); + public void unloaded(AbstractName abstractName) { + checkBlocker(abstractName); } - private void checkBlocker(ObjectName objectName) { + private void checkBlocker(AbstractName abstractName) { synchronized (GBeanInstanceState.this) { - if (!objectName.equals(blocker)) { + if (!abstractName.equals(blocker)) { // it did not start so just exit this method return; } @@ -289,14 +289,15 @@ } }; // register the listener and return - kernel.getLifecycleMonitor().addLifecycleListener(blockerListener, blocker); + AbstractNameQuery blockerPattern = new AbstractNameQuery(blocker.getArtifact(), blocker.getName(), blocker.getInterfaceTypes()); + kernel.getLifecycleMonitor().addLifecycleListener(blockerListener, blockerPattern); return; } // check if all of the gbeans we depend on are running - Set parents = dependencyManager.getParents(objectName); + Set parents = dependencyManager.getParents(abstractName); for (Iterator i = parents.iterator(); i.hasNext();) { - ObjectName parent = (ObjectName) i.next(); + AbstractName parent = (AbstractName) i.next(); if (!kernel.isLoaded(parent)) { log.trace("Cannot run because parent is not registered: parent=" + parent); return; @@ -331,7 +332,7 @@ } } catch (Throwable t) { // oops there was a problem and the gbean failed - log.error("Error while starting; GBean is now in the FAILED state: objectName=\"" + objectName + "\"", t); + log.error("Error while starting; GBean is now in the FAILED state: abstractName=\"" + abstractName + "\"", t); setStateInstance(State.FAILED); lifecycleBroadcaster.fireFailedEvent(); @@ -368,7 +369,7 @@ } // check if all of the mbeans depending on us are stopped - Set children = dependencyManager.getChildren(objectName); + Set children = dependencyManager.getChildren(abstractName); for (Iterator i = children.iterator(); i.hasNext();) { ObjectName child = (ObjectName) i.next(); if (kernel.isLoaded(child)) { @@ -398,7 +399,7 @@ return; } } catch (Throwable t) { - log.error("Error while stopping; GBean is now in the FAILED state: objectName=\"" + objectName + "\"", t); + log.error("Error while stopping; GBean is now in the FAILED state: abstractName=\"" + abstractName + "\"", t); setStateInstance(State.FAILED); lifecycleBroadcaster.fireFailedEvent(); @@ -498,7 +499,7 @@ } public String toString() { - return "GBeanInstanceState for: " + objectName; + return "GBeanInstanceState for: " + abstractName; } } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java Mon Mar 6 13:44:29 2006 @@ -17,13 +17,11 @@ package org.apache.geronimo.gbean.runtime; -import java.util.Set; -import java.util.Iterator; -import javax.management.ObjectName; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.gbean.GReferenceInfo; +import org.apache.geronimo.gbean.AbstractNameQuery; import org.apache.geronimo.gbean.InvalidConfigurationException; import org.apache.geronimo.kernel.DependencyManager; import org.apache.geronimo.kernel.Kernel; @@ -31,6 +29,9 @@ import org.apache.geronimo.kernel.lifecycle.LifecycleListener; import org.apache.geronimo.kernel.management.State; +import java.util.Iterator; +import java.util.Set; + /** * @version $Rev$ $Date$ */ @@ -45,7 +46,7 @@ /** * The object to which the proxy is bound */ - private ObjectName proxyTarget; + private AbstractName proxyTarget; public GBeanSingleReference(GBeanInstance gbeanInstance, GReferenceInfo referenceInfo, Kernel kernel, DependencyManager dependencyManager) throws InvalidConfigurationException { super(gbeanInstance, referenceInfo, kernel, dependencyManager); @@ -57,28 +58,28 @@ // // We must have exactly one running target // - ObjectName objectName = getGBeanInstance().getObjectNameObject(); + AbstractName abstractName = getGBeanInstance().getAbstractName(); Set targets = getTargets(); if (targets.size() == 0) { waitingForMe = true; - log.debug("Waiting to start " + objectName + " because no targets are running for reference " + getName() +" matching the patterns " + getPatternsText()); + log.debug("Waiting to start " + abstractName + " because no targets are running for reference " + getName() +" matching the patterns " + 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 single valued reference " + getName() +" matching the patterns " + getPatternsText()); + log.debug("Waiting to start " + abstractName + " because more then one targets are running for the single valued reference " + getName() +" matching the patterns " + getPatternsText()); return false; } waitingForMe = false; // stop all gbeans that would match our patterns from starting DependencyManager dependencyManager = getDependencyManager(); - dependencyManager.addStartHolds(objectName, getPatterns()); + dependencyManager.addStartHolds(abstractName, getPatterns()); // add a dependency on our target and create the proxy - ObjectName target = (ObjectName) targets.iterator().next(); + AbstractName target = (AbstractName) targets.iterator().next(); setProxy(getKernel().getProxyManager().createProxy(target, getReferenceType())); proxyTarget = target; - dependencyManager.addDependency(objectName, target); + dependencyManager.addDependency(abstractName, target); } return true; @@ -88,31 +89,31 @@ StringBuffer buf = new StringBuffer(); Set patterns = getPatterns(); for (Iterator iterator = patterns.iterator(); iterator.hasNext();) { - ObjectName objectName = (ObjectName) iterator.next(); - buf.append(objectName.getCanonicalName()).append(" "); + AbstractNameQuery refInfo = (AbstractNameQuery) iterator.next(); + buf.append(refInfo).append(" "); } return buf.toString(); } public synchronized void stop() { waitingForMe = false; - ObjectName objectName = getGBeanInstance().getObjectNameObject(); + AbstractName abstractName = getGBeanInstance().getAbstractName(); Set patterns = getPatterns(); DependencyManager dependencyManager = getDependencyManager(); if (!patterns.isEmpty()) { - dependencyManager.removeStartHolds(objectName, patterns); + dependencyManager.removeStartHolds(abstractName, patterns); } Object proxy = getProxy(); if (proxy != null) { - dependencyManager.removeDependency(objectName, proxyTarget); + dependencyManager.removeDependency(abstractName, proxyTarget); getKernel().getProxyManager().destroyProxy(proxy); setProxy(null); proxyTarget = null; } } - protected synchronized void targetAdded(ObjectName target) { + protected synchronized void targetAdded(AbstractName 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) { @@ -129,7 +130,7 @@ } } - protected synchronized void targetRemoved(ObjectName target) { + protected synchronized void targetRemoved(AbstractName 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 @@ -159,20 +160,20 @@ protected LifecycleListener createLifecycleListener() { return new LifecycleAdapter() { - public void running(ObjectName objectName) { - addTarget(objectName); + public void running(AbstractName abstractName) { + addTarget(abstractName); } - public void stopped(ObjectName objectName) { - removeTarget(objectName); + public void stopped(AbstractName abstractName) { + removeTarget(abstractName); } - public void failed(ObjectName objectName) { - removeTarget(objectName); + public void failed(AbstractName abstractName) { + removeTarget(abstractName); } - public void unloaded(ObjectName objectName) { - removeTarget(objectName); + public void unloaded(AbstractName abstractName) { + removeTarget(abstractName); } }; } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java Mon Mar 6 13:44:29 2006 @@ -16,24 +16,24 @@ */ package org.apache.geronimo.gbean.runtime; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Set; -import java.util.HashMap; -import java.util.Map; - -import javax.management.ObjectName; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.gbean.ReferenceCollection; import org.apache.geronimo.gbean.ReferenceCollectionEvent; import org.apache.geronimo.gbean.ReferenceCollectionListener; -import org.apache.geronimo.kernel.proxy.ProxyManager; import org.apache.geronimo.kernel.proxy.ProxyFactory; +import org.apache.geronimo.kernel.proxy.ProxyManager; + +import javax.management.ObjectName; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; /** * @version $Rev$ $Date$ @@ -53,7 +53,7 @@ factory = proxyManager.createProxyFactory(type); for (Iterator iterator = targets.iterator(); iterator.hasNext();) { - addTarget((ObjectName) iterator.next()); + addTarget((AbstractName) iterator.next()); } } @@ -66,7 +66,7 @@ listeners.clear(); } - void addTarget(ObjectName target) { + void addTarget(AbstractName target) { Object proxy; ArrayList listenerCopy; synchronized (this) { @@ -94,7 +94,7 @@ } } - void removeTarget(ObjectName target) { + void removeTarget(AbstractName target) { Object proxy; ArrayList listenerCopy; synchronized (this) { Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/DependencyManager.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/DependencyManager.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/DependencyManager.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/DependencyManager.java Mon Mar 6 13:44:29 2006 @@ -17,6 +17,8 @@ package org.apache.geronimo.kernel; +import org.apache.geronimo.gbean.AbstractName; + import java.util.Collection; import java.util.Set; import javax.management.ObjectName; @@ -43,7 +45,7 @@ * @param child the dependent component * @param parent the component the child is depending on */ - public void addDependency(ObjectName child, ObjectName parent); + public void addDependency(AbstractName child, AbstractName parent); /** * Removes a dependency from a child to a parent @@ -51,14 +53,14 @@ * @param child the dependnet component * @param parent the component that the child wil no longer depend on */ - public void removeDependency(ObjectName child, ObjectName parent); + public void removeDependency(AbstractName child, AbstractName parent); /** * Removes all dependencies for a child * * @param child the component that will no longer depend on anything */ - public void removeAllDependencies(ObjectName child); + public void removeAllDependencies(AbstractName child); /** * Adds dependencies from the child to every parent in the parents set @@ -66,7 +68,7 @@ * @param child the dependent component * @param parents the set of components the child is depending on */ - public void addDependencies(ObjectName child, Set parents); + public void addDependencies(AbstractName child, Set parents); /** * Gets the set of parents that the child is depending on @@ -74,7 +76,7 @@ * @param child the dependent component * @return a collection containing all of the components the child depends on; will never be null */ - public Set getParents(ObjectName child); + public Set getParents(AbstractName child); /** * Gets all of the MBeans that have a dependency on the specified startParent. @@ -82,37 +84,37 @@ * @param parent the component the returned childen set depend on * @return a collection containing all of the components that depend on the parent; will never be null */ - public Set getChildren(ObjectName parent); + public Set getChildren(AbstractName parent); /** * Adds a hold on a collection of object name patterns. If the name of a component matches an object name * pattern in the collection, the component should not start. * - * @param objectName the name of the component placing the holds + * @param abstractName * @param holds a collection of object name patterns which should not start */ - public void addStartHolds(ObjectName objectName, Collection holds); + public void addStartHolds(AbstractName abstractName, Collection holds); /** * Removes a collection of holds. * - * @param objectName the object name of the components owning the holds + * @param abstractName * @param holds a collection of the holds to remove */ - public void removeStartHolds(ObjectName objectName, Collection holds); + public void removeStartHolds(AbstractName abstractName, Collection holds); /** * Removes all of the holds owned by a component. * - * @param objectName the object name of the component that will no longer have any holds + * @param abstractName */ - public void removeAllStartHolds(ObjectName objectName); + public void removeAllStartHolds(AbstractName abstractName); /** * Gets the object name of the bean blocking the start specified bean. * - * @param objectName the bean to check for blockers + * @param abstractName * @return the bean blocking the specified bean, or null if there are no blockers */ - public ObjectName checkBlocker(ObjectName objectName); + public AbstractName checkBlocker(AbstractName abstractName); } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java Mon Mar 6 13:44:29 2006 @@ -16,6 +16,8 @@ */ package org.apache.geronimo.kernel; +import org.apache.geronimo.gbean.AbstractName; + import javax.management.ObjectName; @@ -33,6 +35,10 @@ public GBeanNotFoundException(ObjectName gBeanName, Throwable cause) { super(gBeanName+" not found", cause); this.gBeanName = gBeanName; + } + + public GBeanNotFoundException(AbstractName abstractName) { + super(abstractName + " not found"); } public ObjectName getGBeanName() { Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java Mon Mar 6 13:44:29 2006 @@ -18,14 +18,18 @@ import java.util.Date; import java.util.Set; +import java.util.Collections; import javax.management.ObjectName; import org.apache.geronimo.gbean.GBeanData; import org.apache.geronimo.gbean.GBeanInfo; import org.apache.geronimo.gbean.GBeanQuery; +import org.apache.geronimo.gbean.AbstractNameQuery; +import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.kernel.jmx.JMXUtil; import org.apache.geronimo.kernel.lifecycle.LifecycleMonitor; import org.apache.geronimo.kernel.proxy.ProxyManager; +import org.apache.geronimo.kernel.repository.Artifact; /** * @version $Rev$ $Date$ @@ -35,6 +39,7 @@ * The JMX name used by a Kernel to register itself when it boots. */ ObjectName KERNEL = JMXUtil.getObjectName(":role=Kernel"); + AbstractName KERNEL_NAME = new AbstractName(new Artifact("geronimo", "boot", "none", "car"), Collections.EMPTY_MAP, Kernel.class.getName(), KERNEL); /** * Get the name of this kernel @@ -78,6 +83,7 @@ * @return true if there is a gbean registered under the specified name; false otherwise */ boolean isLoaded(ObjectName name); + boolean isLoaded(AbstractName name); /** * Start a specific GBean. @@ -88,6 +94,7 @@ * @throws IllegalStateException If the gbean is disabled */ void startGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException; + void startGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException; /** * Start a specific GBean and its children. @@ -98,6 +105,7 @@ * @throws IllegalStateException If the gbean is disabled */ void startRecursiveGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException; + void startRecursiveGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException; /** * Stop a specific GBean. @@ -108,6 +116,7 @@ * @throws IllegalStateException If the gbean is disabled */ void stopGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException; + void stopGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException; /** * Unload a specific GBean. @@ -118,6 +127,7 @@ * @throws InternalKernelException if there GBean is a problem while unloading the GBean */ void unloadGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException; + void unloadGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException; /** * Gets the state of the specified GBean. @@ -126,6 +136,7 @@ * @throws GBeanNotFoundException if the GBean could not be found */ int getGBeanState(ObjectName name) throws GBeanNotFoundException; + int getGBeanState(AbstractName name) throws GBeanNotFoundException; /** * Gets the time the specified GBean was started @@ -134,6 +145,7 @@ * @throws GBeanNotFoundException if the GBean could not be found */ long getGBeanStartTime(ObjectName name) throws GBeanNotFoundException; + long getGBeanStartTime(AbstractName name) throws GBeanNotFoundException; /** * Is the specified GBean enabled? @@ -142,6 +154,7 @@ * @throws GBeanNotFoundException if the GBean could not be found */ boolean isGBeanEnabled(ObjectName name) throws GBeanNotFoundException; + boolean isGBeanEnabled(AbstractName name) throws GBeanNotFoundException; /** * Sets the eneabled status of the specified GBean. A disabled gbean can not be started, and @@ -151,6 +164,7 @@ * @throws GBeanNotFoundException if the GBean could not be found */ void setGBeanEnabled(ObjectName name, boolean enabled) throws GBeanNotFoundException; + void setGBeanEnabled(AbstractName name, boolean enabled) throws GBeanNotFoundException; /** * Gets the ClassLoader used to register the specified GBean @@ -167,6 +181,7 @@ * @throws GBeanNotFoundException if there is no instance with the supplied name */ GBeanInfo getGBeanInfo(ObjectName name) throws GBeanNotFoundException; + GBeanInfo getGBeanInfo(AbstractName name) throws GBeanNotFoundException; /** * Return the GBeanData for a GBean instance. @@ -175,6 +190,7 @@ * @throws GBeanNotFoundException if there is no instance with the supplied name */ GBeanData getGBeanData(ObjectName name) throws GBeanNotFoundException, InternalKernelException; + GBeanData getGBeanData(AbstractName name) throws GBeanNotFoundException, InternalKernelException; /** * Returns a Set of all GBeans matching the object name pattern @@ -204,6 +220,7 @@ * @throws Exception if the gbean throws an exception from the getter */ Object getAttribute(ObjectName objectName, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception; + Object getAttribute(AbstractName abstractName, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception; /** * Sets the value of an attribute on the specified gbean @@ -215,6 +232,7 @@ * @throws Exception if the gbean throws an exception from the setter */ void setAttribute(ObjectName objectName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception; + void setAttribute(AbstractName abstractName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception; /** * Invokes a no-argument method on the specified GBean @@ -227,6 +245,7 @@ * @throws Exception if the method throws an exception */ Object invoke(ObjectName objectName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception; + Object invoke(AbstractName abstractName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception; /** * Invokes a method on the specified GBean with the specified arguments @@ -241,6 +260,7 @@ * @throws Exception if the method throws an exception */ Object invoke(ObjectName objectName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception; + Object invoke(AbstractName abstractName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception; /** * Assuming the argument represents a service running in the kernel, @@ -284,4 +304,5 @@ */ boolean isRunning(); + Set listGBeans(AbstractNameQuery refInfoQuery); } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java Mon Mar 6 13:44:29 2006 @@ -24,6 +24,8 @@ import org.apache.geronimo.gbean.GBeanInfo; import org.apache.geronimo.gbean.GBeanInfoBuilder; import org.apache.geronimo.gbean.GBeanQuery; +import org.apache.geronimo.gbean.AbstractNameQuery; +import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.kernel.lifecycle.LifecycleMonitor; import org.apache.geronimo.kernel.proxy.ProxyManager; @@ -69,38 +71,74 @@ kernel.startGBean(name); } + public void startGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { + kernel.startGBean(name); + } + public void startRecursiveGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { kernel.startRecursiveGBean(name); } + public void startRecursiveGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { + kernel.startRecursiveGBean(name); + } + public void stopGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { kernel.stopGBean(name); } + public void stopGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { + kernel.stopGBean(name); + } + public void unloadGBean(ObjectName name) throws GBeanNotFoundException { kernel.unloadGBean(name); } + public void unloadGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { + kernel.unloadGBean(name); + } + public int getGBeanState(ObjectName name) throws GBeanNotFoundException { return kernel.getGBeanState(name); } + public int getGBeanState(AbstractName name) throws GBeanNotFoundException { + return kernel.getGBeanState(name); + } + public long getGBeanStartTime(ObjectName name) throws GBeanNotFoundException { return kernel.getGBeanStartTime(name); } + public long getGBeanStartTime(AbstractName name) throws GBeanNotFoundException { + return kernel.getGBeanStartTime(name); + } + public boolean isGBeanEnabled(ObjectName name) throws GBeanNotFoundException { return kernel.isGBeanEnabled(name); } + public boolean isGBeanEnabled(AbstractName name) throws GBeanNotFoundException { + return kernel.isGBeanEnabled(name); + } + public void setGBeanEnabled(ObjectName name, boolean enabled) throws GBeanNotFoundException { kernel.setGBeanEnabled(name, enabled); } + public void setGBeanEnabled(AbstractName name, boolean enabled) throws GBeanNotFoundException { + kernel.setGBeanEnabled(name, enabled); + } + public boolean isRunning() { return kernel.isRunning(); } + public Set listGBeans(AbstractNameQuery refInfoQuery) { + return kernel.listGBeans(refInfoQuery); + } + public ClassLoader getClassLoaderFor(ObjectName name) throws GBeanNotFoundException, InternalKernelException { return kernel.getClassLoaderFor(name); } @@ -109,27 +147,55 @@ return kernel.getGBeanData(name); } + public GBeanData getGBeanData(AbstractName name) throws GBeanNotFoundException, InternalKernelException { + return kernel.getGBeanData(name); + } + public Object getAttribute(ObjectName objectName, String attributeName) throws Exception { return kernel.getAttribute(objectName, attributeName); } + public Object getAttribute(AbstractName abstractName, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception { + return kernel.getAttribute(abstractName, attributeName); + } + public void setAttribute(ObjectName objectName, String attributeName, Object attributeValue) throws Exception { kernel.setAttribute(objectName, attributeName, attributeValue); } + public void setAttribute(AbstractName abstractName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception { + kernel.setAttribute(abstractName, attributeName, attributeValue); + } + public Object invoke(ObjectName objectName, String methodName) throws Exception { return kernel.invoke(objectName, methodName); } + public Object invoke(AbstractName abstractName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception { + return kernel.invoke(abstractName, methodName); + } + public Object invoke(ObjectName objectName, String methodName, Object[] args, String[] types) throws Exception { return kernel.invoke(objectName, methodName, args, types); } + public Object invoke(AbstractName abstractName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception { + return kernel.invoke(abstractName, methodName, args, types); + } + public boolean isLoaded(ObjectName name) { return kernel.isLoaded(name); } + public boolean isLoaded(AbstractName name) { + return kernel.isLoaded(name); + } + public GBeanInfo getGBeanInfo(ObjectName name) throws GBeanNotFoundException { + return kernel.getGBeanInfo(name); + } + + public GBeanInfo getGBeanInfo(AbstractName name) throws GBeanNotFoundException { return kernel.getGBeanInfo(name); } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicDependencyManager.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicDependencyManager.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicDependencyManager.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicDependencyManager.java Mon Mar 6 13:44:29 2006 @@ -32,6 +32,8 @@ import org.apache.geronimo.kernel.lifecycle.LifecycleListener; import org.apache.geronimo.kernel.lifecycle.LifecycleMonitor; import org.apache.geronimo.kernel.DependencyManager; +import org.apache.geronimo.gbean.AbstractName; +import org.apache.geronimo.gbean.AbstractNameQuery; /** * DependencyManager is the record keeper of the dependencies in Geronimo. The DependencyManager @@ -76,7 +78,7 @@ public BasicDependencyManager(LifecycleMonitor lifecycleMonitor) throws Exception { assert lifecycleMonitor != null; this.lifecycleMonitor = lifecycleMonitor; - lifecycleMonitor.addLifecycleListener(lifecycleListener, new ObjectName("*:*")); + lifecycleMonitor.addLifecycleListener(lifecycleListener, new AbstractNameQuery(Collections.EMPTY_LIST, Collections.EMPTY_MAP, Collections.EMPTY_SET)); } public synchronized void close() { @@ -92,7 +94,7 @@ * @param child the dependent component * @param parent the component the child is depending on */ - public synchronized void addDependency(ObjectName child, ObjectName parent) { + public synchronized void addDependency(AbstractName child, AbstractName parent) { Set parents = (Set) childToParentMap.get(child); if (parents == null) { parents = new HashSet(); @@ -114,7 +116,7 @@ * @param child the dependnet component * @param parent the component that the child wil no longer depend on */ - public synchronized void removeDependency(ObjectName child, ObjectName parent) { + public synchronized void removeDependency(AbstractName child, AbstractName parent) { Set parents = (Set) childToParentMap.get(child); if (parents != null) { parents.remove(parent); @@ -131,7 +133,7 @@ * * @param child the component that will no longer depend on anything */ - public synchronized void removeAllDependencies(ObjectName child) { + public synchronized void removeAllDependencies(AbstractName child) { Set parents = (Set) childToParentMap.remove(child); if (parents == null) { return; @@ -152,7 +154,7 @@ * @param child the dependent component * @param parents the set of components the child is depending on */ - public synchronized void addDependencies(ObjectName child, Set parents) { + public synchronized void addDependencies(AbstractName child, Set parents) { Set existingParents = (Set) childToParentMap.get(child); if (existingParents == null) { existingParents = new HashSet(parents); @@ -178,7 +180,7 @@ * @param child the dependent component * @return a collection containing all of the components the child depends on; will never be null */ - public synchronized Set getParents(ObjectName child) { + public synchronized Set getParents(AbstractName child) { Set parents = (Set) childToParentMap.get(child); if (parents == null) { return Collections.EMPTY_SET; @@ -192,7 +194,7 @@ * @param parent the component the returned childen set depend on * @return a collection containing all of the components that depend on the parent; will never be null */ - public synchronized Set getChildren(ObjectName parent) { + public synchronized Set getChildren(AbstractName parent) { Set children = (Set) parentToChildMap.get(parent); if (children == null) { return Collections.EMPTY_SET; @@ -204,14 +206,14 @@ * Adds a hold on a collection of object name patterns. If the name of a component matches an object name * pattern in the collection, the component should not start. * - * @param objectName the name of the component placing the holds + * @param abstractName * @param holds a collection of object name patterns which should not start */ - public synchronized void addStartHolds(ObjectName objectName, Collection holds) { - Collection currentHolds = (Collection) startHoldsMap.get(objectName); + public synchronized void addStartHolds(AbstractName abstractName, Collection holds) { + Collection currentHolds = (Collection) startHoldsMap.get(abstractName); if (currentHolds == null) { currentHolds = new LinkedList(holds); - startHoldsMap.put(objectName, currentHolds); + startHoldsMap.put(abstractName, currentHolds); } else { currentHolds.addAll(holds); } @@ -220,11 +222,11 @@ /** * Removes a collection of holds. * - * @param objectName the object name of the components owning the holds + * @param abstractName * @param holds a collection of the holds to remove */ - public synchronized void removeStartHolds(ObjectName objectName, Collection holds) { - Collection currentHolds = (Collection) startHoldsMap.get(objectName); + public synchronized void removeStartHolds(AbstractName abstractName, Collection holds) { + Collection currentHolds = (Collection) startHoldsMap.get(abstractName); if (currentHolds != null) { currentHolds.removeAll(holds); } @@ -233,26 +235,26 @@ /** * Removes all of the holds owned by a component. * - * @param objectName the object name of the component that will no longer have any holds + * @param abstractName */ - public synchronized void removeAllStartHolds(ObjectName objectName) { - startHoldsMap.remove(objectName); + public synchronized void removeAllStartHolds(AbstractName abstractName) { + startHoldsMap.remove(abstractName); } /** * Gets the object name of the mbean blocking the start specified mbean. * - * @param objectName the mbean to check for blockers + * @param abstractName * @return the mbean blocking the specified mbean, or null if there are no blockers */ - public synchronized ObjectName checkBlocker(ObjectName objectName) { + public synchronized AbstractName checkBlocker(AbstractName abstractName) { // check if objectName name is on one of the hold lists for (Iterator iterator = startHoldsMap.keySet().iterator(); iterator.hasNext();) { - ObjectName blocker = (ObjectName) iterator.next(); + AbstractName blocker = (AbstractName) iterator.next(); List holds = (List) startHoldsMap.get(blocker); for (Iterator holdsIterator = holds.iterator(); holdsIterator.hasNext();) { - ObjectName pattern = (ObjectName) holdsIterator.next(); - if (pattern.apply(objectName)) { + AbstractNameQuery pattern = (AbstractNameQuery) holdsIterator.next(); + if (pattern.matches(abstractName)) { return blocker; } } @@ -261,10 +263,10 @@ } private class DependencyManagerLifecycleListener extends LifecycleAdapter { - public void unloaded(ObjectName objectName) { + public void unloaded(AbstractName abstractName) { synchronized (BasicDependencyManager.this) { - removeAllDependencies(objectName); - removeAllStartHolds(objectName); + removeAllDependencies(abstractName); + removeAllStartHolds(abstractName); } } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java Mon Mar 6 13:44:29 2006 @@ -31,6 +31,8 @@ import org.apache.geronimo.gbean.GBeanInfo; import org.apache.geronimo.gbean.GBeanName; import org.apache.geronimo.gbean.GBeanQuery; +import org.apache.geronimo.gbean.AbstractNameQuery; +import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.gbean.runtime.GBeanInstance; import org.apache.geronimo.kernel.DependencyManager; import org.apache.geronimo.kernel.GBeanAlreadyExistsException; @@ -101,7 +103,7 @@ /** * Listeners for when the kernel shutdown */ - private LinkedList shutdownHooks = new LinkedList(); + private final LinkedList shutdownHooks = new LinkedList(); /** * This manager is used by the kernel to manage dependencies between gbeans @@ -164,36 +166,69 @@ return gbeanInstance.getAttribute(attributeName); } + public Object getAttribute(AbstractName abstractName, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception { + GBeanInstance gbeanInstance = registry.getGBeanInstance(abstractName); + return gbeanInstance.getAttribute(attributeName); + } + public void setAttribute(ObjectName objectName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception { GBeanInstance gbeanInstance = registry.getGBeanInstance(createGBeanName(objectName)); gbeanInstance.setAttribute(attributeName, attributeValue); } + public void setAttribute(AbstractName abstractName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception { + GBeanInstance gbeanInstance = registry.getGBeanInstance(abstractName); + gbeanInstance.setAttribute(attributeName, attributeValue); + } + public Object invoke(ObjectName objectName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception { return invoke(objectName, methodName, NO_ARGS, NO_TYPES); } + public Object invoke(AbstractName abstractName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception { + return invoke(abstractName, methodName, NO_ARGS, NO_TYPES); + } + public Object invoke(ObjectName objectName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception { GBeanInstance gbeanInstance = registry.getGBeanInstance(createGBeanName(objectName)); return gbeanInstance.invoke(methodName, args, types); } + public Object invoke(AbstractName abstractName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception { + GBeanInstance gbeanInstance = registry.getGBeanInstance(abstractName); + return gbeanInstance.invoke(methodName, args, types); + } + public boolean isLoaded(ObjectName name) { return registry.isRegistered(createGBeanName(name)); } + public boolean isLoaded(AbstractName name) { + return registry.isRegistered(name); + } + public GBeanInfo getGBeanInfo(ObjectName name) throws GBeanNotFoundException { GBeanInstance gbeanInstance = registry.getGBeanInstance(createGBeanName(name)); return gbeanInstance.getGBeanInfo(); } + public GBeanInfo getGBeanInfo(AbstractName name) throws GBeanNotFoundException { + GBeanInstance gbeanInstance = registry.getGBeanInstance(name); + return gbeanInstance.getGBeanInfo(); + } + public GBeanData getGBeanData(ObjectName name) throws GBeanNotFoundException, InternalKernelException { GBeanInstance gbeanInstance = registry.getGBeanInstance(createGBeanName(name)); return gbeanInstance.getGBeanData(); } + public GBeanData getGBeanData(AbstractName name) throws GBeanNotFoundException, InternalKernelException { + GBeanInstance gbeanInstance = registry.getGBeanInstance(name); + return gbeanInstance.getGBeanData(); + } + public void loadGBean(GBeanData gbeanData, ClassLoader classLoader) throws GBeanAlreadyExistsException, InternalKernelException { - ObjectName objectName = gbeanData.getName(); + AbstractName objectName = gbeanData.getAbstractName(); GBeanInstance gbeanInstance = new GBeanInstance(gbeanData, this, dependencyManager, lifecycleMonitor.createLifecycleBroadcaster(objectName), classLoader); registry.register(gbeanInstance); } @@ -203,16 +238,31 @@ gbeanInstance.start(); } + public void startGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { + GBeanInstance gbeanInstance = registry.getGBeanInstance(name); + gbeanInstance.start(); + } + public void startRecursiveGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { GBeanInstance gbeanInstance = registry.getGBeanInstance(createGBeanName(name)); gbeanInstance.startRecursive(); } + public void startRecursiveGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { + GBeanInstance gbeanInstance = registry.getGBeanInstance(name); + gbeanInstance.startRecursive(); + } + public void stopGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { GBeanInstance gbeanInstance = registry.getGBeanInstance(createGBeanName(name)); gbeanInstance.stop(); } + public void stopGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { + GBeanInstance gbeanInstance = registry.getGBeanInstance(name); + gbeanInstance.stop(); + } + public void unloadGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { GBeanName gbeanName = createGBeanName(name); GBeanInstance gbeanInstance = registry.getGBeanInstance(gbeanName); @@ -220,26 +270,52 @@ registry.unregister(gbeanName); } + public void unloadGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { + GBeanInstance gbeanInstance = registry.getGBeanInstance(name); + gbeanInstance.die(); + registry.unregister(name); + } + public int getGBeanState(ObjectName name) throws GBeanNotFoundException { GBeanInstance gbeanInstance = registry.getGBeanInstance(createGBeanName(name)); return gbeanInstance.getState(); } + public int getGBeanState(AbstractName name) throws GBeanNotFoundException { + GBeanInstance gbeanInstance = registry.getGBeanInstance(name); + return gbeanInstance.getState(); + } + public long getGBeanStartTime(ObjectName name) throws GBeanNotFoundException { GBeanInstance gbeanInstance = registry.getGBeanInstance(createGBeanName(name)); return gbeanInstance.getStartTime(); } + public long getGBeanStartTime(AbstractName name) throws GBeanNotFoundException { + GBeanInstance gbeanInstance = registry.getGBeanInstance(name); + return gbeanInstance.getStartTime(); + } + public boolean isGBeanEnabled(ObjectName name) throws GBeanNotFoundException { GBeanInstance gbeanInstance = registry.getGBeanInstance(createGBeanName(name)); return gbeanInstance.isEnabled(); } + public boolean isGBeanEnabled(AbstractName name) throws GBeanNotFoundException { + GBeanInstance gbeanInstance = registry.getGBeanInstance(name); + return gbeanInstance.isEnabled(); + } + public void setGBeanEnabled(ObjectName name, boolean enabled) throws GBeanNotFoundException { GBeanInstance gbeanInstance = registry.getGBeanInstance(createGBeanName(name)); gbeanInstance.setEnabled(enabled); } + public void setGBeanEnabled(AbstractName name, boolean enabled) throws GBeanNotFoundException { + GBeanInstance gbeanInstance = registry.getGBeanInstance(name); + gbeanInstance.setEnabled(enabled); + } + public Set listGBeans(ObjectName pattern) { String domain = (pattern == null || pattern.isDomainPattern()) ? null : pattern.getDomain(); if (domain != null && domain.length() == 0) { @@ -259,8 +335,12 @@ public Set listGBeans(Set patterns) { Set gbeans = new HashSet(); for (Iterator iterator = patterns.iterator(); iterator.hasNext();) { - ObjectName pattern = (ObjectName) iterator.next(); - gbeans.addAll(listGBeans(pattern)); + Object pattern = iterator.next(); + if (pattern instanceof ObjectName) { + gbeans.addAll(listGBeans((ObjectName)pattern)); + } else if (pattern instanceof AbstractNameQuery) { + gbeans.addAll(listGBeans((AbstractNameQuery)pattern)); + } } return gbeans; } @@ -277,9 +357,19 @@ return gbeans; } + public Set listGBeans(AbstractNameQuery refInfoQuery) { + Set gbeans = registry.listGBeans(refInfoQuery); + Set result = new HashSet(gbeans.size()); + for (Iterator i = gbeans.iterator(); i.hasNext();) { + GBeanInstance instance = (GBeanInstance) i.next(); + result.add(instance.getAbstractName()); + } + return result; + } + public Set listGBeansByInterface(String[] interfaces) { Set gbeans = new HashSet(); - Set all = null; + Set all; try { all = listGBeans(ObjectName.getInstance("*:*")); } catch (MalformedObjectNameException e) { @@ -348,9 +438,9 @@ proxyManager = new BasicProxyManager(this); // load and start the kernel gbean - GBeanData kernelGBeanData = new GBeanData(KERNEL, KernelGBean.GBEAN_INFO); + GBeanData kernelGBeanData = new GBeanData(KERNEL_NAME, KernelGBean.GBEAN_INFO); loadGBean(kernelGBeanData, getClass().getClassLoader()); - startGBean(KERNEL); + startGBean(KERNEL_NAME); running = true; log.debug("Booted"); Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java Mon Mar 6 13:44:29 2006 @@ -23,7 +23,6 @@ import java.util.Iterator; import java.util.Map; import java.util.Set; -import javax.management.ObjectName; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -31,6 +30,8 @@ import org.apache.geronimo.kernel.lifecycle.LifecycleMonitor; import org.apache.geronimo.kernel.lifecycle.LifecycleListener; import org.apache.geronimo.gbean.runtime.LifecycleBroadcaster; +import org.apache.geronimo.gbean.AbstractNameQuery; +import org.apache.geronimo.gbean.AbstractName; /** * @version $Rev$ $Date$ @@ -38,19 +39,17 @@ public class BasicLifecycleMonitor implements LifecycleMonitor { private static final Log log = LogFactory.getLog(BasicLifecycleMonitor.class); - private final Kernel kernel; // todo we should only hold weak references to the listeners private final Map boundListeners = new HashMap(); private final Map listenerPatterns = new HashMap(); public BasicLifecycleMonitor(Kernel kernel) { - this.kernel = kernel; // register for state change notifications with all mbeans that match the target patterns - Set names = this.kernel.listGBeans((ObjectName)null); + Set names = kernel.listGBeans((AbstractNameQuery)null); for (Iterator objectNameIterator = names.iterator(); objectNameIterator.hasNext();) { - addSource((ObjectName) objectNameIterator.next()); + addSource((AbstractName) objectNameIterator.next()); } } @@ -59,7 +58,7 @@ listenerPatterns.clear(); } - private synchronized void addSource(ObjectName source) { + private synchronized void addSource(AbstractName source) { if (boundListeners.containsKey(source)) { // already registered return; @@ -71,8 +70,8 @@ Map.Entry entry = (Map.Entry) listenerIterator.next(); Set patterns = (Set) entry.getValue(); for (Iterator patternIterator = patterns.iterator(); patternIterator.hasNext();) { - ObjectName pattern = (ObjectName) patternIterator.next(); - if (pattern.apply(source)) { + AbstractNameQuery pattern = (AbstractNameQuery) patternIterator.next(); + if (pattern.matches(source)) { LifecycleListener listener = (LifecycleListener) entry.getKey(); listeners.add(listener); } @@ -82,21 +81,21 @@ boundListeners.put(source, listeners); } - private synchronized void removeSource(ObjectName source) { + private synchronized void removeSource(AbstractName source) { boundListeners.remove(source); } - public synchronized void addLifecycleListener(LifecycleListener listener, ObjectName pattern) { + public synchronized void addLifecycleListener(LifecycleListener listener, AbstractNameQuery pattern) { addLifecycleListener(listener, Collections.singleton(pattern)); } public synchronized void addLifecycleListener(LifecycleListener listener, Set patterns) { for (Iterator patternIterator = patterns.iterator(); patternIterator.hasNext();) { - ObjectName pattern = (ObjectName) patternIterator.next(); + AbstractNameQuery pattern = (AbstractNameQuery) patternIterator.next(); for (Iterator iterator = boundListeners.entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); - ObjectName source = (ObjectName) entry.getKey(); - if (pattern.apply(source)) { + AbstractName source = (AbstractName) entry.getKey(); + if (pattern.matches(source)) { Set listeners = (Set) entry.getValue(); listeners.add(listener); } @@ -113,7 +112,7 @@ listenerPatterns.remove(listener); } - private synchronized Set getTargets(ObjectName source) { + private synchronized Set getTargets(AbstractName source) { Set targets = (Set) boundListeners.get(source); if (targets == null) { // no one is interested in this event @@ -123,19 +122,19 @@ } } - private void fireLoadedEvent(ObjectName objectName) { - Set targets = getTargets(objectName); + private void fireLoadedEvent(AbstractName refInfoName) { + Set targets = getTargets(refInfoName); for (Iterator iterator = targets.iterator(); iterator.hasNext();) { LifecycleListener listener = (LifecycleListener) iterator.next(); try { - listener.loaded(objectName); + listener.loaded(refInfoName); } catch (Throwable e) { log.warn("Exception occured while notifying listener", e); } } } - private void fireStartingEvent(ObjectName source) { + private void fireStartingEvent(AbstractName source) { Set targets = getTargets(source); for (Iterator iterator = targets.iterator(); iterator.hasNext();) { LifecycleListener listener = (LifecycleListener) iterator.next(); @@ -147,7 +146,7 @@ } } - private void fireRunningEvent(ObjectName source) { + private void fireRunningEvent(AbstractName source) { Set targets = getTargets(source); for (Iterator iterator = targets.iterator(); iterator.hasNext();) { LifecycleListener listener = (LifecycleListener) iterator.next(); @@ -159,7 +158,7 @@ } } - private void fireStoppingEvent(ObjectName source) { + private void fireStoppingEvent(AbstractName source) { Set targets = getTargets(source); for (Iterator iterator = targets.iterator(); iterator.hasNext();) { LifecycleListener listener = (LifecycleListener) iterator.next(); @@ -171,7 +170,7 @@ } } - private void fireStoppedEvent(ObjectName source) { + private void fireStoppedEvent(AbstractName source) { Set targets = getTargets(source); for (Iterator iterator = targets.iterator(); iterator.hasNext();) { LifecycleListener listener = (LifecycleListener) iterator.next(); @@ -183,7 +182,7 @@ } } - private void fireFailedEvent(ObjectName source) { + private void fireFailedEvent(AbstractName source) { Set targets = getTargets(source); for (Iterator iterator = targets.iterator(); iterator.hasNext();) { LifecycleListener listener = (LifecycleListener) iterator.next(); @@ -195,7 +194,7 @@ } } - private void fireUnloadedEvent(ObjectName source) { + private void fireUnloadedEvent(AbstractName source) { Set targets = getTargets(source); for (Iterator iterator = targets.iterator(); iterator.hasNext();) { LifecycleListener listener = (LifecycleListener) iterator.next(); @@ -207,45 +206,47 @@ } } - public LifecycleBroadcaster createLifecycleBroadcaster(ObjectName objectName) { - return new RawLifecycleBroadcaster(objectName); + public LifecycleBroadcaster createLifecycleBroadcaster(AbstractName abstractName) { + return new RawLifecycleBroadcaster(abstractName); } private class RawLifecycleBroadcaster implements LifecycleBroadcaster { - private final ObjectName objectName; + private final AbstractName abstractName; - public RawLifecycleBroadcaster(ObjectName objectName) { - this.objectName = objectName; + public RawLifecycleBroadcaster(AbstractName abstractName) { + this.abstractName = abstractName; } public void fireLoadedEvent() { - addSource(objectName); - BasicLifecycleMonitor.this.fireLoadedEvent(objectName); + addSource(abstractName); + BasicLifecycleMonitor.this.fireLoadedEvent(abstractName); } public void fireStartingEvent() { - BasicLifecycleMonitor.this.fireStartingEvent(objectName); + BasicLifecycleMonitor.this.fireStartingEvent(abstractName); } public void fireRunningEvent() { - BasicLifecycleMonitor.this.fireRunningEvent(objectName); + BasicLifecycleMonitor.this.fireRunningEvent(abstractName); } public void fireStoppingEvent() { - BasicLifecycleMonitor.this.fireStoppingEvent(objectName); + BasicLifecycleMonitor.this.fireStoppingEvent(abstractName); } public void fireStoppedEvent() { - BasicLifecycleMonitor.this.fireStoppedEvent(objectName); + BasicLifecycleMonitor.this.fireStoppedEvent(abstractName); } public void fireFailedEvent() { - BasicLifecycleMonitor.this.fireFailedEvent(objectName); + BasicLifecycleMonitor.this.fireFailedEvent(abstractName); } public void fireUnloadedEvent() { - BasicLifecycleMonitor.this.fireUnloadedEvent(objectName); - removeSource(objectName); + BasicLifecycleMonitor.this.fireUnloadedEvent(abstractName); + removeSource(abstractName); } } + + } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java Mon Mar 6 13:44:29 2006 @@ -23,6 +23,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.geronimo.gbean.GBeanInfo; +import org.apache.geronimo.gbean.AbstractName; +import org.apache.geronimo.gbean.GBeanData; import org.apache.geronimo.kernel.GBeanNotFoundException; import org.apache.geronimo.kernel.Kernel; import org.apache.geronimo.kernel.proxy.ProxyFactory; @@ -105,8 +107,15 @@ if (type == null) throw new NullPointerException("type is null"); ProxyFactory proxyFactory = createProxyFactory(type); - Object proxy = proxyFactory.createProxy(target); - return proxy; + return proxyFactory.createProxy(target); + } + + public Object createProxy(AbstractName target, Class type) { + if (target == null) throw new NullPointerException("target is null"); + if (type == null) throw new NullPointerException("type is null"); + + ProxyFactory proxyFactory = createProxyFactory(type); + return proxyFactory.createProxy(target); } public Object createProxy(ObjectName target, ClassLoader classLoader) { @@ -135,6 +144,27 @@ } } + public Object createProxy(AbstractName target, ClassLoader classLoader) { + if (target == null) throw new NullPointerException("target is null"); + if (classLoader == null) throw new NullPointerException("classLoader is null"); + + Set interfaces = target.getInterfaceTypes(); + if(interfaces.size() == 0) { + log.warn("No interfaces found for " + target + " ("+target+")"); + return null; + } + String[] names = (String[]) interfaces.toArray(new String[0]); + List intfs = new ArrayList(); + for (int i = 0; i < names.length; i++) { + try { + intfs.add(classLoader.loadClass(names[i])); + } catch (ClassNotFoundException e) { + log.warn("Could not load interface "+names[i]+" in provided ClassLoader for "+target); + } + } + return createProxyFactory((Class[]) intfs.toArray(new Class[intfs.size()]), classLoader).createProxy(target); + } + public Object[] createProxies(String[] objectNameStrings, ClassLoader classLoader) throws MalformedObjectNameException { Object[] result = new Object[objectNameStrings.length]; for (int i = 0; i < result.length; i++) { @@ -163,7 +193,7 @@ if (methodInterceptor == null) { return null; } - return getObjectName(methodInterceptor); + return getAbstractName(methodInterceptor).getObjectName(); } private class ManagedProxyFactory implements ProxyFactory { @@ -204,7 +234,13 @@ public Object createProxy(ObjectName target) { assert target != null: "target is null"; - Callback callback = getMethodInterceptor(proxyType, kernel, target); + Callback callback; + try { + AbstractName targetName = getAbstractName(target, kernel); + callback = getMethodInterceptor(proxyType, kernel, targetName); + } catch (GBeanNotFoundException e) { + throw new ProxyCreationException(e); + } Enhancer.registerCallbacks(proxyType, new Callback[]{callback}); try { @@ -216,7 +252,30 @@ if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else if (cause instanceof Error) { + throw (Error) cause; + } else if (cause != null) { + throw new ProxyCreationException(cause); + } else { + throw new ProxyCreationException(e); + } + } + } + public Object createProxy(AbstractName target) { + assert target != null: "target is null"; + + Callback callback = getMethodInterceptor(proxyType, kernel, target); + + Enhancer.registerCallbacks(proxyType, new Callback[]{callback}); + try { + Object proxy = fastClass.newInstance(); + interceptors.put(proxy, callback); + return proxy; + } catch (InvocationTargetException e) { + Throwable cause = e.getCause(); + if (cause instanceof RuntimeException) { throw (RuntimeException) cause; + } else if (cause instanceof Error) { + throw (Error) cause; } else if (cause != null) { throw new ProxyCreationException(cause); } else { @@ -301,7 +360,11 @@ } } - protected Callback getMethodInterceptor(Class proxyType, Kernel kernel, ObjectName target) { + protected Callback getMethodInterceptor(Class proxyType, Kernel kernel, ObjectName target) throws GBeanNotFoundException { + AbstractName targetName = getAbstractName(target, kernel); + return new ProxyMethodInterceptor(proxyType, kernel, targetName); + } + protected Callback getMethodInterceptor(Class proxyType, Kernel kernel, AbstractName target) { return new ProxyMethodInterceptor(proxyType, kernel, target); } @@ -309,7 +372,12 @@ ((ProxyMethodInterceptor)methodInterceptor).destroy(); } - protected ObjectName getObjectName(MethodInterceptor methodInterceptor) { - return ((ProxyMethodInterceptor)methodInterceptor).getObjectName(); + protected AbstractName getAbstractName(MethodInterceptor methodInterceptor) { + return ((ProxyMethodInterceptor)methodInterceptor).getAbstractName(); + } + + private AbstractName getAbstractName(ObjectName objectName, Kernel kernel) throws GBeanNotFoundException { + GBeanData gBeanData = kernel.getGBeanData(objectName); + return gBeanData.getAbstractName(); } } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java Mon Mar 6 13:44:29 2006 @@ -30,17 +30,20 @@ import org.apache.geronimo.kernel.GBeanNotFoundException; import org.apache.geronimo.kernel.InternalKernelException; import org.apache.geronimo.gbean.GBeanName; +import org.apache.geronimo.gbean.AbstractNameQuery; +import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.gbean.runtime.GBeanInstance; /** * @version $Rev$ $Date$ */ public class BasicRegistry { - private final Map registry = new HashMap(); + private final Map objectNameRegistry = new HashMap(); + private final Map infoRegistry = new HashMap(); private String kernelName = ""; /** - * Start the registry and associate it with a kernel. + * Start the objectNameRegistry and associate it with a kernel. * * @param kernel the kernel to associate with */ @@ -49,10 +52,10 @@ } /** - * Shut down the registry and unregister any GBeans + * Shut down the objectNameRegistry and unregister any GBeans */ public synchronized void stop() { - registry.clear(); + objectNameRegistry.clear(); kernelName = ""; } @@ -63,7 +66,11 @@ * @return true if there is a GBean registered with that name */ public synchronized boolean isRegistered(GBeanName name) { - return registry.containsKey(name); + return objectNameRegistry.containsKey(name); + } + + public synchronized boolean isRegistered(AbstractName refInfo) { + return infoRegistry.containsKey(refInfo); } /** @@ -74,10 +81,11 @@ */ public synchronized void register(GBeanInstance gbeanInstance) throws GBeanAlreadyExistsException { GBeanName name = createGBeanName(gbeanInstance.getObjectNameObject()); - if (registry.containsKey(name)) { + if (objectNameRegistry.containsKey(name)) { throw new GBeanAlreadyExistsException("GBean already registered: " + name); } - registry.put(name, gbeanInstance); + objectNameRegistry.put(name, gbeanInstance); + infoRegistry.put(gbeanInstance.getAbstractName(), gbeanInstance); } /** @@ -87,13 +95,24 @@ * @throws GBeanNotFoundException if there is no GBean registered with the supplied name */ public synchronized void unregister(GBeanName name) throws GBeanNotFoundException, InternalKernelException { - if (registry.remove(name) == null) { + GBeanInstance gbeanInstance = (GBeanInstance) objectNameRegistry.remove(name); + if (gbeanInstance == null) { try { throw new GBeanNotFoundException(name.getObjectName()); } catch (MalformedObjectNameException e) { throw new InternalKernelException(e); } } + infoRegistry.remove(gbeanInstance.getAbstractName()); + } + + public synchronized void unregister(AbstractName abstractName) throws GBeanNotFoundException { + GBeanInstance gbeanInstance = (GBeanInstance) infoRegistry.remove(abstractName); + if (gbeanInstance == null) { + throw new GBeanNotFoundException(abstractName); + } + GBeanName name = createGBeanName(gbeanInstance.getObjectNameObject()); + objectNameRegistry.remove(name); } /** @@ -104,7 +123,7 @@ * @throws GBeanNotFoundException if there is no GBean registered with the supplied name */ public synchronized GBeanInstance getGBeanInstance(GBeanName name) throws GBeanNotFoundException { - GBeanInstance instance = (GBeanInstance) registry.get(name); + GBeanInstance instance = (GBeanInstance) objectNameRegistry.get(name); if (instance == null) { try { throw new GBeanNotFoundException(name.getObjectName()); @@ -115,25 +134,49 @@ return instance; } + public synchronized GBeanInstance getGBeanInstance(AbstractName abstractName) throws GBeanNotFoundException { + GBeanInstance instance = (GBeanInstance) infoRegistry.get(abstractName); + if (instance == null) { + throw new GBeanNotFoundException(abstractName); + } + return instance; + } + /** - * Search the registry for GBeans matching a name pattern. + * Search the objectNameRegistry for GBeans matching a name pattern. * - * @param domain the domain to query in; null indicates all + * @param domain the domain to query in; null indicates all * @param properties the properties the GBeans must have * @return an unordered Set of GBeans that matched the pattern */ public Set listGBeans(String domain, Map properties) { // fairly dumb implementation that iterates the list of all registered GBeans Map clone; - synchronized(this) { - clone = new HashMap(registry); + synchronized (this) { + clone = new HashMap(objectNameRegistry); } Set result = new HashSet(clone.size()); for (Iterator i = clone.entrySet().iterator(); i.hasNext();) { Map.Entry entry = (Map.Entry) i.next(); GBeanName name = (GBeanName) entry.getKey(); if (name.matches(domain, properties)) { + result.add(entry.getValue()); + } + } + return result; + } + + public Set listGBeans(AbstractNameQuery query) { + Map clone; + synchronized (this) { + clone = new HashMap(infoRegistry); + } + Set result = new HashSet(clone.size()); + for (Iterator i = clone.entrySet().iterator(); i.hasNext();) { + Map.Entry entry = (Map.Entry) i.next(); + AbstractName name = (AbstractName) entry.getKey(); + if (query == null || query.matches(name)) { result.add(entry.getValue()); } } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelGetAttributeInvoker.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelGetAttributeInvoker.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelGetAttributeInvoker.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelGetAttributeInvoker.java Mon Mar 6 13:44:29 2006 @@ -17,9 +17,8 @@ package org.apache.geronimo.kernel.basic; -import javax.management.ObjectName; - import org.apache.geronimo.kernel.Kernel; +import org.apache.geronimo.gbean.AbstractName; /** * @version $Rev$ $Date$ @@ -33,7 +32,7 @@ this.name = name; } - public Object invoke(ObjectName objectName, Object[] arguments) throws Throwable { - return kernel.getAttribute(objectName, name); + public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable { + return kernel.getAttribute(abstractName, name); } } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelOperationInvoker.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelOperationInvoker.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelOperationInvoker.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelOperationInvoker.java Mon Mar 6 13:44:29 2006 @@ -18,9 +18,9 @@ package org.apache.geronimo.kernel.basic; import java.lang.reflect.Method; -import javax.management.ObjectName; import org.apache.geronimo.kernel.Kernel; +import org.apache.geronimo.gbean.AbstractName; /** * @version $Rev$ $Date$ @@ -42,7 +42,7 @@ } } - public Object invoke(ObjectName objectName, Object[] arguments) throws Throwable { - return kernel.invoke(objectName, name, arguments, argumentTypes); + public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable { + return kernel.invoke(abstractName, name, arguments, argumentTypes); } } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelSetAttributeInvoker.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelSetAttributeInvoker.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelSetAttributeInvoker.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/KernelSetAttributeInvoker.java Mon Mar 6 13:44:29 2006 @@ -17,9 +17,8 @@ package org.apache.geronimo.kernel.basic; -import javax.management.ObjectName; - import org.apache.geronimo.kernel.Kernel; +import org.apache.geronimo.gbean.AbstractName; /** * @version $Rev$ $Date$ @@ -33,8 +32,8 @@ this.name = name; } - public Object invoke(ObjectName objectName, Object[] arguments) throws Throwable { - kernel.setAttribute(objectName, name, arguments[0]); + public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable { + kernel.setAttribute(abstractName, name, arguments[0]); return null; } } Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/LifecycleMonitorFlyweight.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/LifecycleMonitorFlyweight.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/LifecycleMonitorFlyweight.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/LifecycleMonitorFlyweight.java Mon Mar 6 13:44:29 2006 @@ -16,11 +16,11 @@ */ package org.apache.geronimo.kernel.basic; -import java.util.Set; -import javax.management.ObjectName; - -import org.apache.geronimo.kernel.lifecycle.LifecycleMonitor; +import org.apache.geronimo.gbean.AbstractNameQuery; import org.apache.geronimo.kernel.lifecycle.LifecycleListener; +import org.apache.geronimo.kernel.lifecycle.LifecycleMonitor; + +import java.util.Set; /** * @version $Rev$ $Date$ @@ -32,8 +32,7 @@ this.lifecycleMonitor = lifecycleMonitor; } - public void addLifecycleListener(LifecycleListener listener, ObjectName pattern) { - lifecycleMonitor.addLifecycleListener(listener, pattern); + public void addLifecycleListener(LifecycleListener listener, AbstractNameQuery pattern) { } public void addLifecycleListener(LifecycleListener listener, Set patterns) { Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyInvoker.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyInvoker.java?rev=383682&r1=383681&r2=383682&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyInvoker.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyInvoker.java Mon Mar 6 13:44:29 2006 @@ -16,11 +16,11 @@ */ package org.apache.geronimo.kernel.basic; -import javax.management.ObjectName; +import org.apache.geronimo.gbean.AbstractName; /** * @version $Rev$ $Date$ */ public interface ProxyInvoker { - Object invoke(ObjectName objectName, Object[] arguments) throws Throwable; + Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable; }