{
org.apache.beehive.controls.system.ejb.EJBControlImpl __bc_impl = (org.apache.beehive.controls.system.ejb.EJBControlImpl)target;
super.initServices(bean, __bc_impl);
ControlBeanContext __bc_beanContext = bean.getControlBeanContext();
try
{
org.apache.beehive.controls.api.context.ControlBeanContext _context = __bc_beanContext;
if (_context == null)
throw new ControlException("Contextual service org.apache.beehive.controls.api.context.ControlBeanContext is not available");
_context.addLifeCycleListener(new ContextLifeCycleEventAdaptor(__bc_impl));
__bc_impl.context = _context;
org.apache.beehive.controls.api.context.ResourceContext _resourceContext = (org.apache.beehive.controls.api.context.ResourceContext)__bc_beanContext.getService(org.apache.beehive.controls.api.context.ResourceContext.class, null);
if (_resourceContext == null)
throw new ControlException("Contextual service org.apache.beehive.controls.api.context.ResourceContext is not available");
_resourceContext.addResourceEventsListener(new ResourceContextResourceEventsEventAdaptor(__bc_impl));
__bc_impl.resourceContext = _resourceContext;
}