org.jboss.beans.metadata.plugins.factory
Class GenericBeanFactory

java.lang.Object
  extended by org.jboss.beans.metadata.spi.factory.AbstractBeanFactory
      extended by org.jboss.beans.metadata.plugins.factory.GenericBeanFactory
All Implemented Interfaces:
BeanFactory, KernelControllerContextAware
Direct Known Subclasses:
ClassLoaderAwareGenericBeanFactory

public class GenericBeanFactory
extends AbstractBeanFactory
implements KernelControllerContextAware

Bean factory metadata.

Version:
$Revision: 83467 $
Author:
Ales Justin, Adrian Brock

Field Summary
protected  KernelControllerContext context
          Our context
 
Fields inherited from class org.jboss.beans.metadata.spi.factory.AbstractBeanFactory
accessMode, bean, classLoader, configurator, constructor, create, properties, start
 
Constructor Summary
GenericBeanFactory(KernelConfigurator configurator)
          Create a new generic bean factory
 
Method Summary
 Object createBean()
          Create a new bean
protected  Object createBean(ClassLoader cl)
          Create a new bean
 void setKernelControllerContext(KernelControllerContext context)
          Set the controller context.
 void unsetKernelControllerContext(KernelControllerContext context)
          Unset the controller context.
 
Methods inherited from class org.jboss.beans.metadata.spi.factory.AbstractBeanFactory
getAccessMode, getBean, getClassLoader, getConfigurator, getConstructor, getCreate, getProperties, getStart, invokeLifecycle, setAccessMode, setBean, setClassLoader, setConstructor, setCreate, setProperties, setStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected KernelControllerContext context
Our context

Constructor Detail

GenericBeanFactory

public GenericBeanFactory(KernelConfigurator configurator)
Create a new generic bean factory

Parameters:
configurator - the configurator
Method Detail

createBean

public Object createBean()
                  throws Throwable
Create a new bean

Specified by:
createBean in interface BeanFactory
Returns:
the bean
Throws:
Throwable - for any error

setKernelControllerContext

public void setKernelControllerContext(KernelControllerContext context)
                                throws Exception
Description copied from interface: KernelControllerContextAware
Set the controller context.

This is invoked after construction with the controller context.

WARNING: This protocol is subject to change with the classadapter implementation.

Specified by:
setKernelControllerContext in interface KernelControllerContextAware
Parameters:
context - the context
Throws:
Exception - for any error

unsetKernelControllerContext

public void unsetKernelControllerContext(KernelControllerContext context)
                                  throws Exception
Description copied from interface: KernelControllerContextAware
Unset the controller context.

This is before uninstallation with null.

WARNING: This protocol is subject to change with the classadapter implementation.

Specified by:
unsetKernelControllerContext in interface KernelControllerContextAware
Parameters:
context - the context
Throws:
Exception - for any error

createBean

protected Object createBean(ClassLoader cl)
                     throws Throwable
Create a new bean

Parameters:
cl - the classloader to use
Returns:
the bean
Throws:
Throwable - for any error


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.