|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.geronimo.kernel.KernelGBean
public class KernelGBean
Field Summary | |
---|---|
static GBeanInfo |
GBEAN_INFO
|
Fields inherited from interface org.apache.geronimo.kernel.Kernel |
---|
KERNEL, KERNEL_NAME |
Constructor Summary | |
---|---|
KernelGBean(Kernel kernel)
|
Method Summary | |
---|---|
void |
boot()
Brings the kernel online |
AbstractName |
getAbstractNameFor(Object service)
Assuming the argument represents a service running in the kernel, returns an AbstractName for it. |
Object |
getAttribute(AbstractName abstractName,
String attributeName)
Gets the value of an attribute on the specified gbean |
Object |
getAttribute(Class type,
String attributeName)
|
Object |
getAttribute(ObjectName objectName,
String attributeName)
|
Object |
getAttribute(String shortName,
Class type,
String attributeName)
|
Object |
getAttribute(String shortName,
String attributeName)
|
Date |
getBootTime()
Returns the time this kernel was last booted. |
ClassLoader |
getClassLoaderFor(AbstractName name)
Gets the ClassLoader used to register the specified GBean |
ClassLoader |
getClassLoaderFor(Class type)
|
ClassLoader |
getClassLoaderFor(String shortName)
|
ClassLoader |
getClassLoaderFor(String shortName,
Class type)
|
DependencyManager |
getDependencyManager()
Gets the dependency manager kernel service |
Object |
getGBean(AbstractName name)
Gets the specified GBean instance. |
Object |
getGBean(Class type)
|
Object |
getGBean(ObjectName name)
|
Object |
getGBean(String shortName)
|
Object |
getGBean(String shortName,
Class type)
|
GBeanData |
getGBeanData(AbstractName name)
Return the GBeanData for a GBean instance. |
GBeanData |
getGBeanData(Class type)
|
GBeanData |
getGBeanData(String shortName)
|
GBeanData |
getGBeanData(String shortName,
Class type)
|
static GBeanInfo |
getGBeanInfo()
|
GBeanInfo |
getGBeanInfo(AbstractName name)
Return the GBeanInfo for a registered GBean instance. |
GBeanInfo |
getGBeanInfo(Class type)
|
GBeanInfo |
getGBeanInfo(ObjectName name)
|
GBeanInfo |
getGBeanInfo(String shortName)
|
GBeanInfo |
getGBeanInfo(String shortName,
Class type)
|
long |
getGBeanStartTime(AbstractName name)
Gets the time the specified GBean was started |
long |
getGBeanStartTime(Class type)
|
long |
getGBeanStartTime(String shortName)
|
long |
getGBeanStartTime(String shortName,
Class type)
|
int |
getGBeanState(AbstractName name)
Gets the state of the specified GBean. |
int |
getGBeanState(Class type)
|
int |
getGBeanState(ObjectName name)
|
int |
getGBeanState(String shortName)
|
int |
getGBeanState(String shortName,
Class type)
|
String |
getKernelName()
Get the name of this kernel |
LifecycleMonitor |
getLifecycleMonitor()
Gets the lifecycle monitor kernel service |
Naming |
getNaming()
Gets the naming system used by this kernel. |
ProxyManager |
getProxyManager()
Gets the proxy manager kernel service |
String |
getShortNameFor(Object service)
Assuming the argument represents a service running in the kernel, returns the short name of the service. |
Object |
invoke(AbstractName abstractName,
String methodName)
Invokes a no-argument method on the specified GBean |
Object |
invoke(AbstractName abstractName,
String methodName,
Object[] args,
String[] types)
Invokes a method on the specified GBean with the specified arguments |
Object |
invoke(Class type,
String methodName)
|
Object |
invoke(Class type,
String methodName,
Object[] args,
String[] types)
|
Object |
invoke(ObjectName objectName,
String methodName)
|
Object |
invoke(ObjectName objectName,
String methodName,
Object[] args,
String[] types)
|
Object |
invoke(String shortName,
Class type,
String methodName)
|
Object |
invoke(String shortName,
Class type,
String methodName,
Object[] args,
String[] types)
|
Object |
invoke(String shortName,
String methodName)
|
Object |
invoke(String shortName,
String methodName,
Object[] args,
String[] types)
|
boolean |
isLoaded(AbstractName name)
Is there a GBean registered with the kernel under the specified name? |
boolean |
isLoaded(Class type)
|
boolean |
isLoaded(String shortName)
|
boolean |
isLoaded(String shortName,
Class type)
|
boolean |
isRunning()
Has the kernel been booted |
boolean |
isRunning(AbstractName name)
Is there a GBean registered with the kernel under the specified name and is it running? |
boolean |
isRunning(Class type)
|
boolean |
isRunning(String shortName)
|
boolean |
isRunning(String shortName,
Class type)
|
Set |
listGBeans(AbstractNameQuery refInfoQuery)
Gets the AbstractNames of all GBeans matching the abstractNameQuery. |
Set |
listGBeans(ObjectName pattern)
Returns a Set with elements of type ObjectName |
Set |
listGBeans(Set patterns)
Returns a Set of all GBeans matching the set of object name pattern |
void |
loadGBean(GBeanData gbeanData,
ClassLoader classLoader)
Load a specific GBean into this kernel. |
void |
registerShutdownHook(Runnable hook)
Registers a runnable to execute when the kernel is shutdown |
void |
setAttribute(AbstractName abstractName,
String attributeName,
Object attributeValue)
Sets the value of an attribute on the specified gbean |
void |
setAttribute(Class type,
String attributeName,
Object attributeValue)
|
void |
setAttribute(String shortName,
Class type,
String attributeName,
Object attributeValue)
|
void |
setAttribute(String shortName,
String attributeName,
Object attributeValue)
|
void |
shutdown()
Stops the kernel |
void |
startGBean(AbstractName name)
Start a specific GBean. |
void |
startGBean(Class type)
|
void |
startGBean(String shortName)
|
void |
startGBean(String shortName,
Class type)
|
void |
startRecursiveGBean(AbstractName name)
Start a specific GBean and its children. |
void |
startRecursiveGBean(Class type)
|
void |
startRecursiveGBean(String shortName)
|
void |
startRecursiveGBean(String shortName,
Class type)
|
void |
stopGBean(AbstractName name)
Stop a specific GBean. |
void |
stopGBean(Class type)
|
void |
stopGBean(String shortName)
|
void |
stopGBean(String shortName,
Class type)
|
void |
unloadGBean(AbstractName name)
Unload a specific GBean. |
void |
unloadGBean(Class type)
|
void |
unloadGBean(String shortName)
|
void |
unloadGBean(String shortName,
Class type)
|
void |
unregisterShutdownHook(Runnable hook)
Unregisters a runnable from the list to execute when the kernel is shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final GBeanInfo GBEAN_INFO
Constructor Detail |
---|
public KernelGBean(Kernel kernel)
Method Detail |
---|
public String getKernelName()
Kernel
getKernelName
in interface Kernel
public Naming getNaming()
Kernel
getNaming
in interface Kernel
public DependencyManager getDependencyManager()
Kernel
getDependencyManager
in interface Kernel
public LifecycleMonitor getLifecycleMonitor()
Kernel
getLifecycleMonitor
in interface Kernel
public ProxyManager getProxyManager()
Kernel
getProxyManager
in interface Kernel
public void loadGBean(GBeanData gbeanData, ClassLoader classLoader) throws GBeanAlreadyExistsException, InternalKernelException
Kernel
loadGBean
in interface Kernel
gbeanData
- the GBean to loadclassLoader
- the class loader to use to load the gbean
GBeanAlreadyExistsException
- if the name is already used
InternalKernelException
- if there is a problem during registrationpublic boolean isLoaded(AbstractName name)
Kernel
isLoaded
in interface Kernel
name
- the name to check
public boolean isLoaded(String shortName)
isLoaded
in interface Kernel
public boolean isLoaded(Class type)
isLoaded
in interface Kernel
public boolean isLoaded(String shortName, Class type)
isLoaded
in interface Kernel
public Object getGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
getGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public Object getGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
Kernel
getGBean
in interface Kernel
name
- the GBean instance to get
GBeanNotFoundException
- if the GBean could not be found
InternalKernelException
- if there is a general error
IllegalStateException
- If the gbean is disabledpublic Object getGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
getGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public Object getGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
getGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public Object getGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
getGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public void startGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
Kernel
startGBean
in interface Kernel
name
- the GBean to start
GBeanNotFoundException
- if the GBean could not be found
InternalKernelException
- if there GBean is not state manageable or if there is a general error
IllegalStateException
- If the gbean is disabledpublic void startGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
startGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public void startGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
startGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public void startGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
startGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public void startRecursiveGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
Kernel
startRecursiveGBean
in interface Kernel
name
- the GBean to start
GBeanNotFoundException
- if the GBean could not be found
InternalKernelException
- if there GBean is not state manageable or if there is a general error
IllegalStateException
- If the gbean is disabledpublic void startRecursiveGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
startRecursiveGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public void startRecursiveGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
startRecursiveGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public void startRecursiveGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
startRecursiveGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public boolean isRunning(AbstractName name)
Kernel
isRunning
in interface Kernel
name
- the name to check
public boolean isRunning(String shortName)
isRunning
in interface Kernel
public boolean isRunning(Class type)
isRunning
in interface Kernel
public boolean isRunning(String shortName, Class type)
isRunning
in interface Kernel
public void stopGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
Kernel
stopGBean
in interface Kernel
name
- the GBean to stop
GBeanNotFoundException
- if the GBean could not be found
InternalKernelException
- if there GBean is not state manageable or if there is a general error
IllegalStateException
- If the gbean is disabledpublic void stopGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
stopGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public void stopGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
stopGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public void stopGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
stopGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public void unloadGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
Kernel
unloadGBean
in interface Kernel
name
- the name of the GBean to unregister
GBeanNotFoundException
- if the GBean could not be found
InternalKernelException
- if there GBean is a problem while unloading the GBean
IllegalStateException
public void unloadGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
unloadGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public void unloadGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
unloadGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public void unloadGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException
unloadGBean
in interface Kernel
GBeanNotFoundException
InternalKernelException
IllegalStateException
public int getGBeanState(ObjectName name) throws GBeanNotFoundException
getGBeanState
in interface Kernel
GBeanNotFoundException
public int getGBeanState(AbstractName name) throws GBeanNotFoundException
Kernel
getGBeanState
in interface Kernel
name
- the name of the GBean
GBeanNotFoundException
- if the GBean could not be foundpublic int getGBeanState(String shortName) throws GBeanNotFoundException
getGBeanState
in interface Kernel
GBeanNotFoundException
public int getGBeanState(Class type) throws GBeanNotFoundException
getGBeanState
in interface Kernel
GBeanNotFoundException
public int getGBeanState(String shortName, Class type) throws GBeanNotFoundException
getGBeanState
in interface Kernel
GBeanNotFoundException
public long getGBeanStartTime(AbstractName name) throws GBeanNotFoundException
Kernel
getGBeanStartTime
in interface Kernel
name
- the name of the GBean
GBeanNotFoundException
- if the GBean could not be foundpublic long getGBeanStartTime(String shortName) throws GBeanNotFoundException
getGBeanStartTime
in interface Kernel
GBeanNotFoundException
public long getGBeanStartTime(Class type) throws GBeanNotFoundException
getGBeanStartTime
in interface Kernel
GBeanNotFoundException
public long getGBeanStartTime(String shortName, Class type) throws GBeanNotFoundException
getGBeanStartTime
in interface Kernel
GBeanNotFoundException
public ClassLoader getClassLoaderFor(AbstractName name) throws GBeanNotFoundException
Kernel
getClassLoaderFor
in interface Kernel
name
- the name of the gbean from which the class loader should be extracted
GBeanNotFoundException
- if the specified GBean is not registered with the kernelpublic ClassLoader getClassLoaderFor(String shortName) throws GBeanNotFoundException
getClassLoaderFor
in interface Kernel
GBeanNotFoundException
public ClassLoader getClassLoaderFor(Class type) throws GBeanNotFoundException
getClassLoaderFor
in interface Kernel
GBeanNotFoundException
public ClassLoader getClassLoaderFor(String shortName, Class type) throws GBeanNotFoundException
getClassLoaderFor
in interface Kernel
GBeanNotFoundException
public GBeanInfo getGBeanInfo(ObjectName name) throws GBeanNotFoundException
getGBeanInfo
in interface Kernel
GBeanNotFoundException
public GBeanInfo getGBeanInfo(AbstractName name) throws GBeanNotFoundException
Kernel
getGBeanInfo
in interface Kernel
name
- the name of the GBean whose info should be returned
GBeanNotFoundException
- if there is no instance with the supplied namepublic GBeanInfo getGBeanInfo(String shortName) throws GBeanNotFoundException
getGBeanInfo
in interface Kernel
GBeanNotFoundException
public GBeanInfo getGBeanInfo(Class type) throws GBeanNotFoundException
getGBeanInfo
in interface Kernel
GBeanNotFoundException
public GBeanInfo getGBeanInfo(String shortName, Class type) throws GBeanNotFoundException
getGBeanInfo
in interface Kernel
GBeanNotFoundException
public GBeanData getGBeanData(AbstractName name) throws GBeanNotFoundException, InternalKernelException
Kernel
getGBeanData
in interface Kernel
name
- the name of the GBean whose info should be returned
GBeanNotFoundException
- if there is no instance with the supplied name
InternalKernelException
public GBeanData getGBeanData(String shortName) throws GBeanNotFoundException, InternalKernelException
getGBeanData
in interface Kernel
GBeanNotFoundException
InternalKernelException
public GBeanData getGBeanData(Class type) throws GBeanNotFoundException, InternalKernelException
getGBeanData
in interface Kernel
GBeanNotFoundException
InternalKernelException
public GBeanData getGBeanData(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException
getGBeanData
in interface Kernel
GBeanNotFoundException
InternalKernelException
public Set listGBeans(ObjectName pattern)
Kernel
listGBeans
in interface Kernel
public Set listGBeans(Set patterns)
Kernel
listGBeans
in interface Kernel
patterns
- the queries to execute
public Object getAttribute(ObjectName objectName, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception
getAttribute
in interface Kernel
GBeanNotFoundException
NoSuchAttributeException
Exception
public Object getAttribute(AbstractName abstractName, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception
Kernel
getAttribute
in interface Kernel
abstractName
- the name of the gbean from which the attribute will be retrievedattributeName
- the name of the attribute to fetch
GBeanNotFoundException
- if there is not a gbean under the specified name
NoSuchAttributeException
- if the gbean does not contain the specified attribute
Exception
- if the gbean throws an exception from the getterpublic Object getAttribute(String shortName, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception
getAttribute
in interface Kernel
GBeanNotFoundException
NoSuchAttributeException
Exception
public Object getAttribute(Class type, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception
getAttribute
in interface Kernel
GBeanNotFoundException
NoSuchAttributeException
Exception
public Object getAttribute(String shortName, Class type, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception
getAttribute
in interface Kernel
GBeanNotFoundException
NoSuchAttributeException
Exception
public void setAttribute(AbstractName abstractName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception
Kernel
setAttribute
in interface Kernel
abstractName
- the name of the gbean from in which the new attribute value will be setattributeName
- the name of the attribute to setattributeValue
- the new value of the attribute
GBeanNotFoundException
- if there is not a gbean under the specified name
NoSuchAttributeException
- if the gbean does not contain the specified attribute
Exception
- if the gbean throws an exception from the setterpublic void setAttribute(String shortName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception
setAttribute
in interface Kernel
GBeanNotFoundException
NoSuchAttributeException
Exception
public void setAttribute(Class type, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception
setAttribute
in interface Kernel
GBeanNotFoundException
NoSuchAttributeException
Exception
public void setAttribute(String shortName, Class type, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception
setAttribute
in interface Kernel
GBeanNotFoundException
NoSuchAttributeException
Exception
public Object invoke(ObjectName objectName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception
invoke
in interface Kernel
GBeanNotFoundException
NoSuchOperationException
InternalKernelException
Exception
public Object invoke(AbstractName abstractName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception
Kernel
invoke
in interface Kernel
abstractName
- the name of the gbean from in which the new attribute value will be setmethodName
- the name of the method to invoke
GBeanNotFoundException
- if there is not a gbean under the specified name
NoSuchOperationException
- if the gbean does not have the specified operation
InternalKernelException
- if an error occurs within the kernel itself
Exception
- if the method throws an exceptionpublic Object invoke(String shortName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception
invoke
in interface Kernel
GBeanNotFoundException
NoSuchOperationException
InternalKernelException
Exception
public Object invoke(Class type, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception
invoke
in interface Kernel
GBeanNotFoundException
NoSuchOperationException
InternalKernelException
Exception
public Object invoke(String shortName, Class type, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception
invoke
in interface Kernel
GBeanNotFoundException
NoSuchOperationException
InternalKernelException
Exception
public Object invoke(ObjectName objectName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception
invoke
in interface Kernel
GBeanNotFoundException
NoSuchOperationException
InternalKernelException
Exception
public Object invoke(AbstractName abstractName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception
Kernel
invoke
in interface Kernel
abstractName
- the name of the gbean from in which the new attribute value will be setmethodName
- the name of the method to invokeargs
- the arguments to pass to the methodtypes
- the types of the arguments; the types are used to determine the signature of the mehod that should be invoked
GBeanNotFoundException
- if there is not a gbean under the specified name
NoSuchOperationException
- if the gbean does not have the specified operation
InternalKernelException
- if an error occurs within the kernel itself
Exception
- if the method throws an exceptionpublic Object invoke(String shortName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception
invoke
in interface Kernel
GBeanNotFoundException
NoSuchOperationException
InternalKernelException
Exception
public Object invoke(Class type, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception
invoke
in interface Kernel
GBeanNotFoundException
NoSuchOperationException
InternalKernelException
Exception
public Object invoke(String shortName, Class type, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception
invoke
in interface Kernel
GBeanNotFoundException
NoSuchOperationException
InternalKernelException
Exception
public AbstractName getAbstractNameFor(Object service)
Kernel
getAbstractNameFor
in interface Kernel
public String getShortNameFor(Object service)
Kernel
getShortNameFor
in interface Kernel
public void boot() throws Exception
Kernel
boot
in interface Kernel
Exception
- if the kernel can not bootpublic Date getBootTime()
Kernel
getBootTime
in interface Kernel
public void registerShutdownHook(Runnable hook)
Kernel
registerShutdownHook
in interface Kernel
hook
- a runnable to execute when the kernel is shutdownpublic void unregisterShutdownHook(Runnable hook)
Kernel
unregisterShutdownHook
in interface Kernel
hook
- the runnable that should be removedpublic void shutdown()
Kernel
shutdown
in interface Kernel
public boolean isRunning()
Kernel
isRunning
in interface Kernel
public Set listGBeans(AbstractNameQuery refInfoQuery)
Kernel
listGBeans
in interface Kernel
refInfoQuery
- the query to execute
public static GBeanInfo getGBeanInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |