org.apache.beehive.controls.test.container
Class ControlTestContainerContext

Object
  extended by ControlBeanContext
      extended by ControlContainerContext
          extended by ControlTestContainerContext
All Implemented Interfaces:
BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServices, BeanContextServicesListener, DesignMode, PropertyChangeListener, VetoableChangeListener, Visibility, Serializable, Iterable, Collection, EventListener, ControlBeanContext, ControlContainerContext, EventDispatcher

public class ControlTestContainerContext
extends ControlContainerContext

ControlContainerContext implementation used to test controls in a standalone JVM.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface ControlBeanContext
ControlBeanContext.LifeCycle
 
Field Summary
 
Fields inherited from interface BeanContext
globalHierarchyLock
 
Fields inherited from interface DesignMode
PROPERTYNAME
 
Constructor Summary
ControlTestContainerContext()
           
 
Method Summary
 InputStream getResourceAsStream(String name, BeanContextChild bcc)
           
<T> T
getService(Class<T> serviceClass, Object selector)
          Override ControlBeanContext.getService().
 void initialize()
          Called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state
 
Methods inherited from class ControlContainerContext
addResourceContext, beginContext, dispatchEvent, endContext, getControlHandle, isSingleThreadedContainer, releaseResources, removeResourceContext
 
Methods inherited from class ControlBeanContext
add, addAll, addBeanContextMembershipListener, addBeanContextServicesListener, addLifeCycleListener, addPropertyChangeListener, addService, addVetoableChangeListener, avoidingGui, clear, contains, containsAll, dontUseGui, equals, generateUniqueID, getAnnotationMap, getBean, getBeanAnnotationMap, getBeanContext, getBeanContextServicesFactory, getClassLoader, getControlBean, getControlHandle, getControlInterface, getControlPropertyMap, getControlPropertySet, getCurrentServiceClasses, getCurrentServiceSelectors, getDefaultControlBinding, getMethodPropertySet, getParameterNames, getParameterPropertySet, getParameterValue, getResource, getService, hashCode, hasService, hasSingleThreadedParent, initializeControl, instantiateChild, isDesignTime, isEmpty, iterator, needsGui, okToUseGui, prioritizeInterceptors, propertyChange, releaseService, remove, removeAll, removeBeanContextMembershipListener, removeBeanContextServicesListener, removeLifeCycleListener, removePropertyChangeListener, removeVetoableChangeListener, resolveDefaultBinding, retainAll, revokeService, serviceAvailable, serviceRevoked, setBeanContext, setDelegateMap, setDesignTime, size, toArray, toArray, vetoableChange
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ControlBeanContext
addLifeCycleListener, getAnnotationMap, getBean, getClassLoader, getControlBean, getControlHandle, getControlInterface, getControlPropertyMap, getControlPropertySet, getMethodPropertySet, getParameterNames, getParameterPropertySet, getParameterValue, removeLifeCycleListener
 
Methods inherited from interface BeanContextServices
addBeanContextServicesListener, addService, getCurrentServiceClasses, getCurrentServiceSelectors, getService, hasService, releaseService, removeBeanContextServicesListener, revokeService
 
Methods inherited from interface BeanContext
addBeanContextMembershipListener, getResource, instantiateChild, removeBeanContextMembershipListener
 
Methods inherited from interface BeanContextChild
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext
 
Methods inherited from interface Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface DesignMode
isDesignTime, setDesignTime
 
Methods inherited from interface Visibility
avoidingGui, dontUseGui, needsGui, okToUseGui
 
Methods inherited from interface BeanContextServicesListener
serviceAvailable
 
Methods inherited from interface BeanContextServiceRevokedListener
serviceRevoked
 

Constructor Detail

ControlTestContainerContext

public ControlTestContainerContext()
Method Detail

initialize

public void initialize()
Called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state

Overrides:
initialize in class ControlContainerContext

getService

public <T> T getService(Class<T> serviceClass,
                        Object selector)
Override ControlBeanContext.getService(). A control bean creates its bean context using the ControlBeanContextFactory service provided by this context. A control bean will attempt to create its context before adding its self to this context as a child. This creates a chicken/egg problem since only a child of a context may request a service from it. This method provides a way to crack the chicken/egg problem by first trying to get the service using the control bean context's getService() method, and if that call returns null and the requested service is the ControlBeanContextFactory then returning an instance of the service provider.

Specified by:
getService in interface ControlBeanContext
Overrides:
getService in class ControlBeanContext
Parameters:
serviceClass -
selector -
Returns:
See Also:
BeanContextServices.getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener)

getResourceAsStream

public InputStream getResourceAsStream(String name,
                                       BeanContextChild bcc)
Specified by:
getResourceAsStream in interface BeanContext
Overrides:
getResourceAsStream in class ControlBeanContext