protected Object getControlService ( Class serviceClass , Object selector ) throws TooManyListenersException { // // Get the associated context object, then use it to locate the (parent) bean context. // Services are always provided by the parent context. // ControlBeanContext cbc = getControlBeanContext ( ) ; BeanContext bc = cbc . getBeanContext ( ) ; if ( bc == null || ! ( bc instanceof BeanContextServices ) ) throw new ControlException ( "Can't locate service context: " + bc ) ; // // Call getService on the parent context, using this bean as the requestor and the // associated peer context instance as the child and event listener parameters. // return ( ( BeanContextServices ) bc ) . getService ( cbc , this , serviceClass , selector , cbc ) ; }
Locates and obtains a context service from the BeanContextServices instance supporting this bean .