|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.geronimo.kernel.basic.BasicKernel
The core of a Geronimo instance. A Kernel is responsible for managing the Configurations that comprise a Geronimo system and exposing them using JMX. Each Kernel is associated with an MBeanServer that is used to register the Configurations themselves and the MBeans they define.
Dependencies between MBeans are handled by a dedicated DependencyManager that is responsible for tracking those dependencies and ensuring that the dependent objects follow the appropriate lifecycle and receive appropriate notifications. The Kernel also provides a ConfigurationStore which is used to stage installed Configurations (providing a local filesystem based classpath) and used hold the persistent state of each Configuration. This allows Configurations to restart in the event of system failure. TODO: Describe the order of method invocation (e.g. if loadGbean may be before boot)
| Field Summary | |
private java.util.Date |
bootTime
The timestamp when the kernel was started |
private DependencyManager |
dependencyManager
This manager is used by the kernel to manage dependencies between gbeans |
private java.lang.String |
kernelName
Name of this kernel |
private BasicLifecycleMonitor |
lifecycleMonitor
Monitors the lifecycle of all gbeans. |
private Log |
log
The log |
private static java.lang.Object[] |
NO_ARGS
|
private static java.lang.String[] |
NO_TYPES
Helper objects for invoke and getAttribute |
private ProxyManager |
proxyManager
This factory gbean proxies, and tracks all proxies in the system |
private LifecycleMonitor |
publicLifecycleMonitor
|
private BasicRegistry |
registry
The registry |
private boolean |
running
Is this kernel running? |
private java.util.LinkedList |
shutdownHooks
Listeners for when the kernel shutdown |
| Fields inherited from interface org.apache.geronimo.kernel.Kernel |
KERNEL |
| Constructor Summary | |
BasicKernel(java.lang.String kernelName)
Construct a Kernel with the specified name. |
|
| Method Summary | |
void |
boot()
Boot this Kernel, triggering the instantiation of the MBeanServer and DependencyManager, and the registration of ConfigurationStore |
private GBeanName |
createGBeanName(javax.management.ObjectName objectName)
|
java.lang.Object |
getAttribute(javax.management.ObjectName objectName,
java.lang.String attributeName)
Gets the value of an attribute on the specified gbean |
java.util.Date |
getBootTime()
Returns the time this kernel was last booted. |
java.lang.ClassLoader |
getClassLoaderFor(javax.management.ObjectName name)
Gets the ClassLoader used to register the specified GBean |
DependencyManager |
getDependencyManager()
Gets the dependency manager kernel service |
GBeanData |
getGBeanData(javax.management.ObjectName name)
Return the GBeanData for a GBean instance. |
GBeanInfo |
getGBeanInfo(javax.management.ObjectName name)
Return the GBeanInfo for a registered GBean instance. |
long |
getGBeanStartTime(javax.management.ObjectName name)
Gets the time the specified GBean was started |
int |
getGBeanState(javax.management.ObjectName name)
Gets the state of the specified GBean. |
java.lang.String |
getKernelName()
Get the name of this kernel |
LifecycleMonitor |
getLifecycleMonitor()
Deprecated. don't use this yet... it may change or go away |
ProxyManager |
getProxyManager()
Deprecated. don't use this yet... it may change or go away |
java.lang.Object |
invoke(javax.management.ObjectName objectName,
java.lang.String methodName)
Invokes a no-argument method on the specified GBean |
java.lang.Object |
invoke(javax.management.ObjectName objectName,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.String[] types)
Invokes a method on the specified GBean with the specified arguments |
boolean |
isGBeanEnabled(javax.management.ObjectName name)
Is the specified GBean enabled? |
boolean |
isLoaded(javax.management.ObjectName name)
Is there a GBean registered with the kernel under the specified name? |
boolean |
isRunning()
Has the kernel been booted |
java.util.Set |
listGBeans(javax.management.ObjectName pattern)
Returns a Set of all GBeans matching the object name pattern |
java.util.Set |
listGBeans(java.util.Set patterns)
Returns a Set of all GBeans matching the set of object name pattern |
void |
loadGBean(GBeanData gbeanData,
java.lang.ClassLoader classLoader)
Load a specific GBean into this kernel. |
private void |
notifyShutdownHooks()
|
void |
registerShutdownHook(java.lang.Runnable hook)
Registers a runnable to execute when the kernel is shutdown |
void |
setAttribute(javax.management.ObjectName objectName,
java.lang.String attributeName,
java.lang.Object attributeValue)
Sets the value of an attribute on the specified gbean |
void |
setGBeanEnabled(javax.management.ObjectName name,
boolean enabled)
Sets the eneabled status of the specified GBean. |
void |
shutdown()
Shut down this kernel instance, unregistering the MBeans and releasing the MBeanServer. |
void |
startGBean(javax.management.ObjectName name)
Start a specific GBean. |
void |
startRecursiveGBean(javax.management.ObjectName name)
Start a specific GBean and its children. |
void |
stopGBean(javax.management.ObjectName name)
Stop a specific GBean. |
void |
unloadGBean(javax.management.ObjectName name)
Unload a specific GBean. |
void |
unregisterShutdownHook(java.lang.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 |
private static final java.lang.String[] NO_TYPES
private static final java.lang.Object[] NO_ARGS
private final java.lang.String kernelName
private Log log
private boolean running
private java.util.Date bootTime
private final BasicRegistry registry
private java.util.LinkedList shutdownHooks
private DependencyManager dependencyManager
private BasicLifecycleMonitor lifecycleMonitor
private LifecycleMonitor publicLifecycleMonitor
private ProxyManager proxyManager
| Constructor Detail |
public BasicKernel(java.lang.String kernelName)
kernelName - the name of the kernel| Method Detail |
public java.lang.String getKernelName()
Kernel
getKernelName in interface Kernelpublic DependencyManager getDependencyManager()
Kernel
getDependencyManager in interface Kernelpublic LifecycleMonitor getLifecycleMonitor()
getLifecycleMonitor in interface Kernelpublic ProxyManager getProxyManager()
getProxyManager in interface Kernel
public java.lang.Object getAttribute(javax.management.ObjectName objectName,
java.lang.String attributeName)
throws GBeanNotFoundException,
NoSuchAttributeException,
java.lang.Exception
Kernel
getAttribute in interface KernelobjectName - the name of the gbean from which the attribute will be retrievedattributeName - the name of the attribute to fetch
NoSuchAttributeException - if the gbean does not contain the specified attribute
java.lang.Exception - if the gbean throws an exception from the getter
GBeanNotFoundException - if there is not a gbean under the specified name
public void setAttribute(javax.management.ObjectName objectName,
java.lang.String attributeName,
java.lang.Object attributeValue)
throws GBeanNotFoundException,
NoSuchAttributeException,
java.lang.Exception
Kernel
setAttribute in interface KernelobjectName - 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
java.lang.Exception - if the gbean throws an exception from the setter
NoSuchAttributeException - if the gbean does not contain the specified attribute
GBeanNotFoundException - if there is not a gbean under the specified name
public java.lang.Object invoke(javax.management.ObjectName objectName,
java.lang.String methodName)
throws GBeanNotFoundException,
NoSuchOperationException,
InternalKernelException,
java.lang.Exception
Kernel
invoke in interface KernelobjectName - the name of the gbean from in which the new attribute value will be setmethodName - the name of the method to invoke
java.lang.Exception - if the method throws an exception
InternalKernelException - if an error occurs within the kernel itself
NoSuchOperationException - if the gbean does not have the specified operation
GBeanNotFoundException - if there is not a gbean under the specified name
public java.lang.Object invoke(javax.management.ObjectName objectName,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.String[] types)
throws GBeanNotFoundException,
NoSuchOperationException,
InternalKernelException,
java.lang.Exception
Kernel
invoke in interface KernelobjectName - 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
java.lang.Exception - if the method throws an exceptionpublic boolean isLoaded(javax.management.ObjectName name)
Kernel
isLoaded in interface Kernelname - the name to check
public GBeanInfo getGBeanInfo(javax.management.ObjectName name)
throws GBeanNotFoundException
Kernel
getGBeanInfo in interface Kernelname - the name of the GBean whose info should be returned
GBeanNotFoundException - if there is no instance with the supplied name
public GBeanData getGBeanData(javax.management.ObjectName name)
throws GBeanNotFoundException,
InternalKernelException
Kernel
getGBeanData in interface Kernelname - the name of the GBean whose info should be returned
GBeanNotFoundException - if there is no instance with the supplied name
InternalKernelException
public void loadGBean(GBeanData gbeanData,
java.lang.ClassLoader classLoader)
throws GBeanAlreadyExistsException,
InternalKernelException
Kernel
loadGBean in interface KernelgbeanData - 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 registration
public void startGBean(javax.management.ObjectName name)
throws GBeanNotFoundException,
InternalKernelException,
java.lang.IllegalStateException
Kernel
startGBean in interface Kernelname - the GBean to start
java.lang.IllegalStateException - If the gbean is disabled
GBeanNotFoundException - if the GBean could not be found
InternalKernelException - if there GBean is not state manageable or if there is a general error
public void startRecursiveGBean(javax.management.ObjectName name)
throws GBeanNotFoundException,
InternalKernelException,
java.lang.IllegalStateException
Kernel
startRecursiveGBean in interface Kernelname - the GBean to start
java.lang.IllegalStateException - If the gbean is disabled
GBeanNotFoundException - if the GBean could not be found
InternalKernelException - if there GBean is not state manageable or if there is a general error
public void stopGBean(javax.management.ObjectName name)
throws GBeanNotFoundException,
InternalKernelException,
java.lang.IllegalStateException
Kernel
stopGBean in interface Kernelname - 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
java.lang.IllegalStateException - If the gbean is disabled
public void unloadGBean(javax.management.ObjectName name)
throws GBeanNotFoundException,
InternalKernelException,
java.lang.IllegalStateException
Kernel
unloadGBean in interface Kernelname - the name of the GBean to unregister
InternalKernelException - if there GBean is a problem while unloading the GBean
GBeanNotFoundException - if the GBean could not be found
java.lang.IllegalStateException
public int getGBeanState(javax.management.ObjectName name)
throws GBeanNotFoundException
Kernel
getGBeanState in interface Kernelname - the name of the GBean
GBeanNotFoundException - if the GBean could not be found
public long getGBeanStartTime(javax.management.ObjectName name)
throws GBeanNotFoundException
Kernel
getGBeanStartTime in interface Kernelname - the name of the GBean
GBeanNotFoundException - if the GBean could not be found
public boolean isGBeanEnabled(javax.management.ObjectName name)
throws GBeanNotFoundException
Kernel
isGBeanEnabled in interface Kernelname - the name if the GBean
GBeanNotFoundException - if the GBean could not be found
public void setGBeanEnabled(javax.management.ObjectName name,
boolean enabled)
throws GBeanNotFoundException
Kernel
setGBeanEnabled in interface Kernelname - the name if the GBeanenabled - the new enabled status
GBeanNotFoundException - if the GBean could not be foundpublic java.util.Set listGBeans(javax.management.ObjectName pattern)
Kernel
listGBeans in interface Kernelpublic java.util.Set listGBeans(java.util.Set patterns)
Kernel
listGBeans in interface Kernel
public void boot()
throws java.lang.Exception
boot in interface Kerneljava.lang.Exception - if the boot failspublic java.util.Date getBootTime()
Kernel
getBootTime in interface Kernelpublic void registerShutdownHook(java.lang.Runnable hook)
Kernel
registerShutdownHook in interface Kernelhook - a runnable to execute when the kernel is shutdownpublic void unregisterShutdownHook(java.lang.Runnable hook)
Kernel
unregisterShutdownHook in interface Kernelhook - the runnable that should be removedpublic void shutdown()
shutdown in interface Kernelprivate void notifyShutdownHooks()
public boolean isRunning()
Kernel
isRunning in interface Kernel
public java.lang.ClassLoader getClassLoaderFor(javax.management.ObjectName name)
throws GBeanNotFoundException
Kernel
getClassLoaderFor in interface Kernelname - the name of the gbean from which the class loader should be extracted
GBeanNotFoundException - if the specified GBean is not registered with the kernelprivate GBeanName createGBeanName(javax.management.ObjectName objectName)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||