* @return the KernelControllerContext
* @throws Throwable for any error
*/
protected KernelControllerContext deployBean(KernelController controller, KernelDeployment deployment, BeanMetaData bean) throws Throwable
{
KernelControllerContext context = new AbstractKernelControllerContext(null, bean, null);
if (requiredState != null)
context.setRequiredState(requiredState);
if (mode != null)
context.setMode(mode);
// Use any deployment classloader if present and the bean doesn't have one
ClassLoaderMetaData beanClassLoader = bean.getClassLoader();
if (beanClassLoader == null && deployment != null)
{
ClassLoaderMetaData deploymentClassLoader = deployment.getClassLoader();