code: private ControlBeanContextFactory lookupControlBeanContextFactory
          (org.apache.beehive.controls.api.context.ControlBeanContext context) {
  
          // first, try to find the CBCFactory from the container
          if(context != null) {
              ControlBeanContextFactory cbcFactory = context.getService(ControlBeanContextFactory.class, null);
  
              if(cbcFactory != null) {
                  return cbcFactory;
              }
          }
  
          // Create the context that acts as the BeanContextProxy for this bean (the context that this bean _defines_).
          try
          {
              DiscoverClass discoverer = new DiscoverClass();
              Class factoryClass =
                  discoverer.find(ControlBeanContextFactory.class, DefaultControlBeanContextFactory.class.getName());
  
              return (ControlBeanContextFactory)factoryClass.newInstance();
          }
          catch (Exception e) {
              throw new ControlException("Exception creating ControlBeanContext", e);
          }
      }
docs: Internal method used to lookup a ControlBeanContextFactory.  This factory is used to create the
  ControlBeanContext object for this ControlBean.  The factory is discoverable from either the containing
  ControlBeanContext object or from the environment.  If the containing CBC object exposes a
  contextual service of type {@link ControlBeanContextFactory}, the factory returned from this will
  be used to create a ControlBeanContext object.
  
  @param context
  @return the ControlBeanContextFactory discovered in the environment or a default one if no factory is configured