Top Description Fields Methods
java.beans.beancontext

public Interface BeanContext

extends BeanContextChild, Collection, DesignMode, Visibility
Known Direct Subinterfaces
java.beans.beancontext.BeanContextServices
Known Direct Implementers
java.beans.beancontext.BeanContextSupport
Annotations
@SuppressWarnings:rawtypes
Imports
java.beans.DesignMode, .Visibility, java.io.InputStream, .IOException, java.net.URL, java.util.Collection, .Locale

The BeanContext acts a logical hierarchical container for JavaBeans.

Author
Laurence P. G. Cable
Since
1.2
See Also
java.beans.Beans, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.beans.PropertyChangeEvent, java.beans.DesignMode, java.beans.Visibility, java.util.Collection

Field Summary

Modifier and TypeField and Description
public static final Object
globalHierarchyLock

This global lock is used by both BeanContext and BeanContextServices implementors to serialize changes in a BeanContext hierarchy and any service requests etc.

Inherited from java.beans.DesignMode:
PROPERTYNAME

Method Summary

Modifier and TypeMethod and Description
public void
addBeanContextMembershipListener(BeanContextMembershipListener
the BeanContextMembershipListener to be added
bcml
)

Adds the specified BeanContextMembershipListener to receive BeanContextMembershipEvents from this BeanContext whenever it adds or removes a child Component(s).

public URL

Returns:

a URL for the named resource for the specified child
getResource
(String
the resource name
name
,
BeanContextChild
the specified child
bcc
)

Analogous to java.lang.ClassLoader.getResource(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader.

public InputStream

Returns:

an InputStream for reading the resource, or null if the resource could not be found.
getResourceAsStream
(String
the resource name
name
,
BeanContextChild
the specified child
bcc
)

Analogous to java.lang.ClassLoader.getResourceAsStream(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader.

public Object

Returns:

a javaBean named as a child of this BeanContext
instantiateChild
(String
The name of the JavaBean to instantiate as a child of this BeanContext
beanName
)

Instantiate the javaBean named as a child of this BeanContext.

public void
removeBeanContextMembershipListener(BeanContextMembershipListener
the BeanContextMembershipListener to be removed
bcml
)

Removes the specified BeanContextMembershipListener so that it no longer receives BeanContextMembershipEvents when the child Component(s) are added or removed.

Inherited from java.beans.beancontext.BeanContextChild:
addPropertyChangeListeneraddVetoableChangeListenergetBeanContextremovePropertyChangeListenerremoveVetoableChangeListenersetBeanContext
Inherited from java.beans.DesignMode:
isDesignTimesetDesignTime
Inherited from java.beans.Visibility:
avoidingGuidontUseGuineedsGuiokToUseGui
Inherited from java.util.Collection:
addaddAllclearcontainscontainsAllequalshashCodeisEmptyiteratorparallelStreamremoveremoveAllremoveIfretainAllsizespliteratorstreamtoArraytoArraytoArray

Field Detail

globalHierarchyLockback to summary
public static final Object globalHierarchyLock

This global lock is used by both BeanContext and BeanContextServices implementors to serialize changes in a BeanContext hierarchy and any service requests etc.

Method Detail

addBeanContextMembershipListenerback to summary
public void addBeanContextMembershipListener(BeanContextMembershipListener bcml)

Adds the specified BeanContextMembershipListener to receive BeanContextMembershipEvents from this BeanContext whenever it adds or removes a child Component(s).

Parameters
bcml:BeanContextMembershipListener

the BeanContextMembershipListener to be added

getResourceback to summary
public URL getResource(String name, BeanContextChild bcc) throws IllegalArgumentException

Analogous to java.lang.ClassLoader.getResource(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader.

Parameters
name:String

the resource name

bcc:BeanContextChild

the specified child

Returns:URL

a URL for the named resource for the specified child

Exceptions
IllegalArgumentException:
if the resource is not valid
getResourceAsStreamback to summary
public InputStream getResourceAsStream(String name, BeanContextChild bcc) throws IllegalArgumentException

Analogous to java.lang.ClassLoader.getResourceAsStream(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader.

Parameters
name:String

the resource name

bcc:BeanContextChild

the specified child

Returns:InputStream

an InputStream for reading the resource, or null if the resource could not be found.

Exceptions
IllegalArgumentException:
if the resource is not valid
instantiateChildback to summary
public Object instantiateChild(String beanName) throws IOException, ClassNotFoundException

Instantiate the javaBean named as a child of this BeanContext. The implementation of the JavaBean is derived from the value of the beanName parameter, and is defined by the java.beans.Beans.instantiate() method.

Parameters
beanName:String

The name of the JavaBean to instantiate as a child of this BeanContext

Returns:Object

a javaBean named as a child of this BeanContext

Exceptions
IOException:
if an IO problem occurs
ClassNotFoundException:
if the class identified by the beanName parameter is not found
removeBeanContextMembershipListenerback to summary
public void removeBeanContextMembershipListener(BeanContextMembershipListener bcml)

Removes the specified BeanContextMembershipListener so that it no longer receives BeanContextMembershipEvents when the child Component(s) are added or removed.

Parameters
bcml:BeanContextMembershipListener

the BeanContextMembershipListener to be removed