Services provided by Geronimo

We will look at some of the low-level services provided by Geronimo.

Kernel

The Kernel interface provides methods to obtain various services such as LifecycleMonitor, DependencyManager, ProxyManager, and so on. It also provides methods to query GBeans, load, start, stop, unload GBeans, set, and get GBean attributes, and invoke methods on GBeans. You can instantiate a kernel instance by using the KernelRegistry.getSingleKernel() API. We will now look at some of the APIs in the Kernel, and their uses:

  • getDependencyManager(): Returns the DependencyManager kernel service. The DependencyManager uses the nomenclature of parent-child, where a child is dependent on a parent. DependencyManager is used to manage dependencies between GBeans.

  • getLifecycleMonitor(): Returns the LifecycleMonitor kernel service.

  • getNaming(): Returns the naming system used by the kernel.

  • getProxyManager(): Returns the ProxyManager kernel service. ProxyManager manages kernel proxies. All proxies include an implementation of GeronimoManagedBean.

  • loadGBean(): Loads a specific GBean into the kernel, using a specified class loader.

  • isLoaded(): Returns true if a GBean is registered in the kernel under the specified name.

  • getGBean(): Returns the GBean registered in the kernel with the specified name.

  • startGBean(): Starts the GBean registered in the kernel with the specified name.

  • startRecursiveGBean():Starts the GBean registered in the kernel with the specified name, along with and all of its child GBeans as registered in the DependencyManager.

  • isRunning(): Returns true if the specified GBean is running.

  • stopGBean(): Stops the GBean with the specified name.

  • unloadGBean(): Unloads the GBean with the specified name.

  • getGBeanState(): Returns the state of the GBean with the specific name.

  • getGBeanStartTime(): Returns the starting time of the GBean with the specified name.

  • getClassLoaderFor(): Returns the class loader used to register the specified GBean.

  • getGBeanInfo(): Returns the GBeanInfo of a specified GBean instance.

  • getGBeanData(): Returns the GBeanData of a specified GBean instance.

  • listGBeans(): Returns a list of GBean names loaded in the kernel that match a specified abstract name query.

  • getAttribute(): Returns the value of a specific attribute in a specified GBean instance.

  • setAttribute(): Sets the value of a specific attribute in a specified GBean instance.

  • invoke(): Invokes a specified method on a specified GBean instance.

  • getAbstractNameFor(): Returns the abstract name for the service represented by the specified object.

  • getShortNameFor(): Returns the short name for the service represented by the specified object.

  • boot(): Boots the kernel.

  • getBootTime(): Returns the boot time of the kernel.

  • registerShutdownHook(): Registers a runnable object to run at kernel shutdown.

  • unregisterShutdownHook(): Unregisters a runnable object registered earlier using the registerShutdownHook() API.

  • shutdown(): Shuts down the kernel.

  • isRunning(): Returns true if the kernel is booted.

  • getStateReason(): Returns the state message associated with a specified GBean.

ServerInfo

The ServerInfo contains information about the server, and functions to resolve pathnames. The interface definition is given below:

public interface ServerInfo {
public File resolve(final String filename);
public File resolveServer(final String filename);
public String resolvePath(final String filename);
public String resolveServerPath(final String filename);
public URI resolve(final URI uri);
public URI resolveServer(final URI uri);
public String getBaseDirectory();
public String getCurrentBaseDirectory();
public String getVersion();
public String getBuildDate();
public String getBuildTime();
public String getCopyright();
}

We will now look at the APIs in ServerInfo, and their uses:

  • resolve(): Resolves a specified relative path name to a file relative to the server installation directory. For example, "foo" resolves to <GERONIMO_HOME>/foo.

  • resolveServer(): Resolves a specified relative path name to a file relative to the server instance directory. For the default instance, the server instance directory is the same as the server installation directory. For an instance started by specifying the org.apache.geronimo.server.name system property, this resolves to a path under the <GERONIMO_HOME>/<INSTANCE_NAME> directory. For example, for a server instance with a name of instance2, "foo" resolves to <GERONIMO_HOME>/instance2/foo.

  • resolvePath(): Returns an absolute path relative to the server installation directory.

  • resolveServerPath(): Returns an absolute path relative to the server instance directory.

  • resolve(URI): Resolves the specified URI relative to the server installation directory.

  • resolveServer(URI): Resolves the specified URI relative to the server instance directory.

  • getBaseDirectory(): Returns the server base directory. By default, this is the server installation directory. The base directory can be overridden by using the org.apache.geronimo.home.dir system property.

  • getCurrentBaseDirectory(): Returns the absolute path name of the server base directory.

  • getVersion(): Returns the server version information.

  • getBuildDate(): Returns the server build date.

  • getBuildTime(): Returns the server build time.

  • getCopyright(): Returns the server copyright information.

You can obtain a ServerInfo object by calling the Kernel API getGBean() with ServerInfo.class as a parameter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset