// annotation, else downstream requirements (such as having a valid control init
// class) will not be met.
//
if (_implClass.getAnnotation(ControlImplementation.class) == null)
{
throw new ControlException("@org.apache.beehive.controls.api.bean.ControlImplementation annotation is missing from control implementation class: " + _implClass.getName());
}
}
catch (ClassNotFoundException cnfe)
{
throw new ControlException("Unable to load control implementation: " + implBinding, cnfe);
}
//
// Cache the threading policy associated with the impl
//
Threading thr = (Threading)_implClass.getAnnotation(Threading.class);
if ( thr != null )
_threadingPolicy = thr.value();
else
_threadingPolicy = ThreadingPolicy.SINGLE_THREADED; // default to single-threaded
ensureThreadingBehaviour();
try
{
//
// Create and initialize the new instance
//
_control = _implClass.newInstance();
try
{
getImplInitializer().initialize(this, _control);
_hasServices = true;
}
catch (Exception e)
{
throw new ControlException("Control initialization failure", e);
}
//
// Once the control is initialized, then allow the associated context
// to do any initialization.
//
ControlBeanContext cbcs = (ControlBeanContext)getBeanContextProxy();
cbcs.initializeControl();
}
catch (RuntimeException re) { throw re; } // never mask RuntimeExceptions
catch (Exception e)
{
throw new ControlException("Unable to create control instance", e);
}
}
//
// If the implementation instance does not currently have contextual services, they