dain 2004/06/05 09:07:04
Modified: modules/kernel/src/java/org/apache/geronimo/gbean/jmx
GBeanMBean.java
modules/kernel/src/test/org/apache/geronimo/kernel
GBeanTest.java MockEndpoint.java MockGBean.java
modules/security/src/java/org/apache/geronimo/security/jaas
ConfigurationEntry.java
Added: modules/kernel/src/java/org/apache/geronimo/gbean
GBeanLifecycleController.java
modules/kernel/src/java/org/apache/geronimo/gbean/jmx
GBeanMBeanLifecycleController.java
Removed: modules/kernel/src/java/org/apache/geronimo/gbean
GBeanContext.java
modules/kernel/src/java/org/apache/geronimo/gbean/jmx
GBeanMBeanContext.java
Log:
Renamed GBeanContext to GBeanLifecycleController
Revision Changes Path
1.1
incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanLifecycleController.java
Index: GBeanLifecycleController.java
===================================================================
/**
*
* Copyright 2003-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;
/**
* Context handle for a GBean which allows the bean to determin the current
state, and to change the
* current state.
*
* @version $Revision: 1.1 $ $Date: 2004/06/05 16:07:04 $
*/
public interface GBeanLifecycleController {
/**
* Gets the state of this component as an int.
* The int return is required by the JSR77 specification.
*
* @return the current state of this component
*/
int getState();
/**
* Attempts to bring the component into the fully running state. If an
Exception occurs while
* starting the component, the component is automaticaly failed.
* <p/>
* There is no guarantee that the Geronimo MBean will be running when the
method returns.
*
* @throws Exception if a problem occurs while starting the component
*/
void start() throws Exception;
/**
* Attempt to bring the component into the fully stopped state. If an
exception occurs while
* stopping the component, tthe component is automaticaly failed.
* <p/>
* There is no guarantee that the Geronimo MBean will be stopped when the
method returns.
*
* @throws Exception if a problem occurs while stopping the component
*/
void stop() throws Exception;
/**
* Moves this component to the FAILED state.
* <p/>
* The component is guaranteed to be in the failed state when the method
returns.
*/
void fail();
}
1.25 +9 -9
incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java
Index: GBeanMBean.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- GBeanMBean.java 5 Jun 2004 07:53:22 -0000 1.24
+++ GBeanMBean.java 5 Jun 2004 16:07:04 -0000 1.25
@@ -45,9 +45,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.gbean.GAttributeInfo;
-import org.apache.geronimo.gbean.GBeanContext;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.GBeanLifecycleController;
import org.apache.geronimo.gbean.GConstructorInfo;
import org.apache.geronimo.gbean.GOperationInfo;
import org.apache.geronimo.gbean.GOperationSignature;
@@ -72,7 +72,7 @@
private static final Log log = LogFactory.getLog(GBeanMBean.class);
private final Constructor constructor;
- private final GBeanMBeanContext gbeanContext;
+ private final GBeanLifecycleController gbeanLifecycleController;
/**
* Gets the context class loader from the thread or the system class
loader if there is no context class loader.
@@ -262,7 +262,7 @@
rawInvoker = new RawInvoker(this);
- gbeanContext = new GBeanMBeanContext(this);
+ gbeanLifecycleController = new GBeanMBeanLifecycleController(this);
}
/**
@@ -478,7 +478,7 @@
ObjectName returnValue = super.preRegister(server, objectName);
setAttribute("objectName", getObjectName());
- setAttribute("gbeanContext", gbeanContext);
+ setAttribute("gbeanLifecycleController", gbeanLifecycleController);
setAttribute("classLoader", classLoader);
try {
String kernelName = (String) server.getAttribute(Kernel.KERNEL,
"KernelName");
@@ -816,11 +816,11 @@
ClassLoader.class,
null));
- attributesMap.put("gbeanContext",
- new GBeanMBeanAttribute((GBeanMBeanAttribute)
attributesMap.get("gbeanContext"),
+ attributesMap.put("gbeanLifecycleController",
+ new GBeanMBeanAttribute((GBeanMBeanAttribute)
attributesMap.get("gbeanLifecycleController"),
this,
- "gbeanContext",
- GBeanContext.class,
+ "gbeanLifecycleController",
+ GBeanLifecycleController.class,
null));
attributesMap.put("kernel",
1.1
incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBeanLifecycleController.java
Index: GBeanMBeanLifecycleController.java
===================================================================
/**
*
* Copyright 2003-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.jmx;
import org.apache.geronimo.gbean.GBeanLifecycleController;
import org.apache.geronimo.kernel.management.State;
/**
* @version $Revision: 1.1 $ $Date: 2004/06/05 16:07:04 $
*/
public final class GBeanMBeanLifecycleController implements
GBeanLifecycleController {
/**
* The GeronimoMBean which owns the target.
*/
private final GBeanMBean gmbean;
/**
* Creates a new context for a target.
*
* @param gmbean the Geronimo Mbean the contains the target
*/
public GBeanMBeanLifecycleController(GBeanMBean gmbean) {
this.gmbean = gmbean;
}
/**
* Gets the state of this component as an int.
* The int return is required by the JSR77 specification.
*
* @return the current state of this component
*/
public int getState() {
return gmbean.getState();
}
/**
* Attempts to bring the component into the fully running state. If an
Exception occurs while
* starting the component, the component is automaticaly failed.
* <p/>
* There is no guarantee that the Geronimo MBean will be running when the
method returns.
*
* @throws Exception if a problem occurs while starting the component
*/
public void start() throws Exception {
gmbean.attemptFullStart();
}
/**
* Attempt to bring the component into the fully stopped state. If an
exception occurs while
* stopping the component, tthe component is automaticaly failed.
* <p/>
* There is no guarantee that the Geronimo MBean will be stopped when the
method returns.
*
* @throws Exception if a problem occurs while stopping the component
*/
public void stop() throws Exception {
final int state = gmbean.getState();
if (state == State.RUNNING_INDEX || state == State.STARTING_INDEX) {
gmbean.stop();
} else if (state == State.STOPPING_INDEX) {
gmbean.attemptFullStop();
}
}
/**
* Moves this component to the FAILED state.
* <p/>
* The component is guaranteed to be in the failed state when the method
returns.
*/
public void fail() {
gmbean.fail();
}
}
1.10 +5 -5
incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java
Index: GBeanTest.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- GBeanTest.java 4 Jun 2004 22:31:56 -0000 1.9
+++ GBeanTest.java 5 Jun 2004 16:07:04 -0000 1.10
@@ -23,7 +23,7 @@
import javax.management.ObjectName;
import junit.framework.TestCase;
-import org.apache.geronimo.gbean.GBeanContext;
+import org.apache.geronimo.gbean.GBeanLifecycleController;
import org.apache.geronimo.gbean.jmx.GBeanMBean;
import org.apache.geronimo.kernel.management.State;
@@ -55,9 +55,9 @@
// return ClassLoader.getSystemClassLoader()
assertSame(ClassLoader.getSystemClassLoader(),
kernel.getAttribute(name, "classLoader"));
- GBeanContext gbeanContext = (GBeanContext) kernel.getAttribute(name,
"gbeanContext");
- assertNotNull(gbeanContext);
- assertEquals(State.RUNNING_INDEX, gbeanContext.getState());
+ GBeanLifecycleController gbeanLifecycleController =
(GBeanLifecycleController) kernel.getAttribute(name,
"gbeanLifecycleController");
+ assertNotNull(gbeanLifecycleController);
+ assertEquals(State.RUNNING_INDEX,
gbeanLifecycleController.getState());
assertNotSame(kernel, kernel.getAttribute(name, "kernel"));
assertSame(kernel, kernel.getAttribute(name, "actualKernel"));
1.8 +3 -3
incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/MockEndpoint.java
Index: MockEndpoint.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/MockEndpoint.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- MockEndpoint.java 4 Jun 2004 22:31:56 -0000 1.7
+++ MockEndpoint.java 5 Jun 2004 16:07:04 -0000 1.8
@@ -17,7 +17,7 @@
package org.apache.geronimo.kernel;
-import org.apache.geronimo.gbean.GBeanContext;
+import org.apache.geronimo.gbean.GBeanLifecycleController;
/**
* @version $Revision$ $Date$
@@ -36,5 +36,5 @@
String echo(String message);
- GBeanContext getGBeanContext();
+ GBeanLifecycleController getGBeanLifecycleController();
}
1.20 +9 -9
incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/MockGBean.java
Index: MockGBean.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/kernel/src/test/org/apache/geronimo/kernel/MockGBean.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- MockGBean.java 4 Jun 2004 22:31:56 -0000 1.19
+++ MockGBean.java 5 Jun 2004 16:07:04 -0000 1.20
@@ -22,9 +22,9 @@
import java.util.Collections;
import java.util.Iterator;
-import org.apache.geronimo.gbean.GBeanContext;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoFactory;
+import org.apache.geronimo.gbean.GBeanLifecycleController;
/**
* @version $Revision$ $Date$
@@ -52,7 +52,7 @@
private MockEndpoint endpoint;
private Collection endpointCollection = Collections.EMPTY_SET;
- private GBeanContext gbeanContext;
+ private GBeanLifecycleController gbeanLifecycleController;
public static GBeanInfo getGBeanInfo() {
return GBEAN_INFO;
@@ -63,7 +63,7 @@
infoFactory.addAttribute("Name", String.class, true);
infoFactory.addAttribute("actualObjectName", String.class, false);
infoFactory.addAttribute("objectName", String.class, false);
- infoFactory.addAttribute("gbeanContext", GBeanContext.class, false);
+ infoFactory.addAttribute("gbeanLifecycleController",
GBeanLifecycleController.class, false);
infoFactory.addAttribute("actualClassLoader", ClassLoader.class,
false);
infoFactory.addAttribute("classLoader", ClassLoader.class, false);
infoFactory.addAttribute("actualKernel", Kernel.class, false);
@@ -84,7 +84,7 @@
infoFactory.addReference("MockEndpoint", MockEndpoint.class);
infoFactory.addReference("EndpointCollection", MockEndpoint.class);
- infoFactory.setConstructor(new String[]{"Name", "FinalInt",
"objectName", "classLoader", "gbeanContext", "kernel"});
+ infoFactory.setConstructor(new String[]{"Name", "FinalInt",
"objectName", "classLoader", "gbeanLifecycleController", "kernel"});
GBEAN_INFO = infoFactory.getBeanInfo();
}
@@ -94,12 +94,12 @@
this.finalInt = finalInt;
}
- public MockGBean(String name, int finalInt, String objectName,
ClassLoader classLoader, GBeanContext gbeanContext, Kernel kernel) {
+ public MockGBean(String name, int finalInt, String objectName,
ClassLoader classLoader, GBeanLifecycleController gbeanLifecycleController,
Kernel kernel) {
this.name = name;
this.finalInt = finalInt;
this.objectName = objectName;
this.classLoader = classLoader;
- this.gbeanContext = gbeanContext;
+ this.gbeanLifecycleController = gbeanLifecycleController;
this.kernel = kernel;
}
@@ -119,8 +119,8 @@
return ClassLoader.getSystemClassLoader();
}
- public GBeanContext getGBeanContext() {
- return gbeanContext;
+ public GBeanLifecycleController getGBeanLifecycleController() {
+ return gbeanLifecycleController;
}
public Kernel getActualKernel() {
1.11 +3 -3
incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/jaas/ConfigurationEntry.java
Index: ConfigurationEntry.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/security/src/java/org/apache/geronimo/security/jaas/ConfigurationEntry.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ConfigurationEntry.java 5 Jun 2004 07:53:22 -0000 1.10
+++ ConfigurationEntry.java 5 Jun 2004 16:07:04 -0000 1.11
@@ -24,7 +24,7 @@
import org.apache.geronimo.gbean.GBeanInfoFactory;
import org.apache.geronimo.gbean.GBeanLifecycle;
import org.apache.geronimo.gbean.WaitingException;
-import org.apache.geronimo.gbean.jmx.GBeanMBeanContext;
+import org.apache.geronimo.gbean.jmx.GBeanMBeanLifecycleController;
import org.apache.geronimo.kernel.Kernel;
@@ -45,7 +45,7 @@
*/
public abstract class ConfigurationEntry implements GBeanLifecycle {
protected final Kernel kernel;
- protected GBeanMBeanContext context;
+ protected GBeanMBeanLifecycleController context;
protected String applicationConfigName;
protected LoginModuleControlFlag controlFlag;
protected Properties options = new Properties();