|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xbean.kernel.KernelFactory
public abstract class KernelFactory
The Kernel factory is used to construct and locate Kernels. This class is loosly based on the SAXParserFactory and the JMX MBeanServerFactory. To constuct a kernel use the following:
Kernel kernel = KernelFactory.newInstance().createKernel(name);
Field Summary | |
---|---|
static String |
KERNEL_FACTORY_KEY
The name of the system property and META-INF/services used to locate the kernel factory class. |
Constructor Summary | |
---|---|
KernelFactory()
|
Method Summary | |
---|---|
Kernel |
createKernel(String name)
Creates a new kernel instance and registers it with the static KernelFactory registry. |
protected abstract Kernel |
createKernelInternal(String name)
Creates the actual kernel instance which will be registerd in the KernelFactory. |
static void |
destroyInstance(Kernel kernel)
Removes the kernel instance from the internal kernel registry. |
static Kernel |
getKernel(String name)
Gets the kernel registered under the specified name. |
static Map |
getKernels()
Gets a map of the existing kernels by kernel name. |
static KernelFactory |
newInstance()
Creates a kernel with the specified name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String KERNEL_FACTORY_KEY
Constructor Detail |
---|
public KernelFactory()
Method Detail |
---|
public static Kernel getKernel(String name)
name
- the name of the kernel to return
public static Map getKernels()
public static KernelFactory newInstance() throws KernelFactoryError
KernelFactoryError
- if the specified kernel factory can not be createdpublic static void destroyInstance(Kernel kernel) throws KernelFactoryError
kernel
- the kernel to destroy
KernelFactoryError
- if the kernel is still runningpublic final Kernel createKernel(String name) throws KernelAlreadyExistsException
getKernel(String)
method.
name
- the name of the kernel to create
KernelAlreadyExistsException
- is a kernel already exists with the specified nameprotected abstract Kernel createKernelInternal(String name)
name
- the kernel name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |