This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.beans.beancontext
class BeanContextServicesSupport

java.lang.Object extended by java.beans.beancontext.BeanContextChildSupport extended by java.beans.beancontext.BeanContextSupport extended by java.beans.beancontext.BeanContextServicesSupport
All Implemented Interfaces:
PropertyChangeListener, VetoableChangeListener, BeanContext, BeanContextChild, BeanContextServices, BeanContextServicesListener, Serializable

Most common way to construct:

BeanContextServicesSupport context = new BeanContextServicesSupport();

Based on 11 examples


public class BeanContextServicesSupport
extends BeanContextSupport
implements BeanContextServices

This helper class provides a utility implementation of the java.beans.beancontext.BeanContextServices interface.

Since this class directly implements the BeanContextServices interface, the class can, and is intended to be used either by subclassing this implementation, or via delegation of an instance of this class from another through the BeanContextProxy interface.


Nested Class Summary
protected class

          
protected class

          
protected static class

           subclasses may subclass this nested class to add behaviors for each BeanContextServicesProvider.
Nested classes/interfaces inherited from class java.beans.beancontext.BeanContextSupport
BeanContextSupport.BCSChild, BeanContextSupport.BCSIterator
   
Field Summary
protected transient ArrayList bcsListeners
          List of BeanContextServicesListener objects.
protected transient BeanContextServicesSupport.BCSSProxyServiceProvider proxy
          Delegate for the BeanContextServiceProvider.
protected transient int serializable
          The number of instances of a serializable BeanContextServceProvider.
protected transient HashMap services
          all accesses to the protected transient HashMap services field should be synchronized on that object
 
Fields inherited from class java.beans.beancontext.BeanContextSupport
bcmListeners, children, designTime, locale, okToUseGui
 
Fields inherited from class java.beans.beancontext.BeanContextChildSupport
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport
 
Constructor Summary

          Create an instance that is not a delegate of another object

          Create an instance with a peer

          Create an instance using the specified locale

          Create an instance using the specified Locale and design mode.
BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dTime, boolean visible)

           Construct a BeanContextServicesSupport instance
 
Method Summary
 void

          add a BeanContextServicesListener
 boolean

          add a service
protected boolean
addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent)

          add a service
protected void

          called from BeanContextSupport readObject before it deserializes the children ...
protected void

          called from BeanContextSupport writeObject before it serializes the children ...
protected void

          called from superclass child removal operations after a child has been successfully removed.
protected BeanContextSupport.BCSChild
createBCSChild(Object targetChild, Object peer)

           Subclasses can override this method to insert their own subclass of Child without having to override add() or the other Collection methods that add children to the set.
protected BeanContextServicesSupport.BCSSServiceProvider

          subclasses can override this method to create new subclasses of BCSSServiceProvider without having to overrride addService() in order to instantiate.
protected void

          Fires a BeanContextServiceAvailableEvent indicating that a new service has become available.
protected void
fireServiceAdded(Class serviceClass)

          Fires a BeanContextServiceEvent notifying of a new service.
protected void

          Fires a BeanContextServiceEvent notifying of a service being revoked.
protected void
fireServiceRevoked(Class serviceClass, boolean revokeNow)

          Fires a BeanContextServiceRevokedEvent indicating that a particular service is no longer available.
 BeanContextServices

          Gets the BeanContextServices associated with this BeanContextServicesSupport.
protected static BeanContextServicesListener

          Gets the BeanContextServicesListener (if any) of the specified child.
 Iterator

          
 Iterator

          
 Object
getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl)

          obtain a service which may be delegated
 boolean
hasService(Class serviceClass)

          has a service, which may be delegated
 void

          called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state.
protected void

          called from setBeanContext to notify a BeanContextChild to allocate resources obtained from the nesting BeanContext.
protected void

          called from setBeanContext to notify a BeanContextChild to release resources obtained from the nesting BeanContext.
 void
releaseService(BeanContextChild child, Object requestor, Object service)

          release a service
 void

          remove a BeanContextServicesListener
 void
revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow)

          remove a service
 void

          BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself.
 void

          BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself.
 
Methods inherited from class java.beans.beancontext.BeanContextSupport
add, addAll, addBeanContextMembershipListener, avoidingGui, bcsChildren, bcsPreDeserializationHook, bcsPreSerializationHook, childDeserializedHook, childJustAddedHook, childJustRemovedHook, classEquals, clear, contains, containsAll, containsKey, copyChildren, createBCSChild, deserialize, dontUseGui, fireChildrenAdded, fireChildrenRemoved, getBeanContextPeer, getChildBeanContextChild, getChildBeanContextMembershipListener, getChildPropertyChangeListener, getChildSerializable, getChildVetoableChangeListener, getChildVisibility, getLocale, getResource, getResourceAsStream, initialize, instantiateChild, isDesignTime, isEmpty, isSerializing, iterator, needsGui, okToUseGui, propertyChange, readChildren, remove, remove, removeAll, removeBeanContextMembershipListener, retainAll, serialize, setDesignTime, setLocale, size, toArray, toArray, validatePendingAdd, validatePendingRemove, vetoableChange, writeChildren
 
Methods inherited from class java.beans.beancontext.BeanContextChildSupport
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, initializeBeanContextResources, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bcsListeners

protected transient ArrayList bcsListeners
List of BeanContextServicesListener objects.

proxy

protected transient BeanContextServicesSupport.BCSSProxyServiceProvider proxy
Delegate for the BeanContextServiceProvider.

serializable

protected transient int serializable
The number of instances of a serializable BeanContextServceProvider.

services

protected transient HashMap services
all accesses to the protected transient HashMap services field should be synchronized on that object
Constructor Detail

BeanContextServicesSupport

public BeanContextServicesSupport()
Create an instance that is not a delegate of another object


BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer)
Create an instance with a peer

Parameters:
peer - The peer BeanContext we are supplying an implementation for, if null the this object is its own peer

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale lcle)
Create an instance using the specified locale

Parameters:
peer - The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
lcle - The current Locale for this BeanContext.

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale lcle,
                                  boolean dtime)
Create an instance using the specified Locale and design mode.

Parameters:
peer - The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
lcle - The current Locale for this BeanContext.
dtime - The initial state, true if in design mode, false if runtime.

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale lcle,
                                  boolean dTime,
                                  boolean visible)

Construct a BeanContextServicesSupport instance

Parameters:
peer - The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
lcle - The current Locale for this BeanContext.
dTime - The initial state, true if in design mode, false if runtime.
visible - The initial visibility.
Method Detail

addBeanContextServicesListener

public void addBeanContextServicesListener(BeanContextServicesListener bcsl)
add a BeanContextServicesListener

Parameters:
bcsl

addService

public boolean addService(Class serviceClass,
                          BeanContextServiceProvider bcsp)
add a service

Parameters:
serviceClass
bcsp

addService

protected boolean addService(Class serviceClass,
                             BeanContextServiceProvider bcsp,
                             boolean fireEvent)
add a service

Parameters:
serviceClass
bcsp
fireEvent

bcsPreDeserializationHook

protected synchronized void bcsPreDeserializationHook(ObjectInputStream ois)
                                               throws IOException,
                                                      ClassNotFoundException
called from BeanContextSupport readObject before it deserializes the children ... This class will deserialize any Serializable BeanContextServiceProviders serialized earlier thus making them available to the children when they deserialized. subclasses may envelope this method to insert their own serialization processing that has to occur prior to serialization of the children

Overrides:
bcsPreDeserializationHook in class BeanContextSupport
Parameters:
ois
Throws:
IOException
ClassNotFoundException

bcsPreSerializationHook

protected synchronized void bcsPreSerializationHook(ObjectOutputStream oos)
                                             throws IOException
called from BeanContextSupport writeObject before it serializes the children ... This class will serialize any Serializable BeanContextServiceProviders herein. subclasses may envelope this method to insert their own serialization processing that has to occur prior to serialization of the children

Overrides:
bcsPreSerializationHook in class BeanContextSupport
Parameters:
oos
Throws:
IOException

childJustRemovedHook

protected void childJustRemovedHook(Object child,
                                    BeanContextSupport.BCSChild bcsc)
called from superclass child removal operations after a child has been successfully removed. called with child synchronized. This subclass uses this hook to immediately revoke any services being used by this child if it is a BeanContextChild. subclasses may envelope this method in order to implement their own child removal side-effects.

Overrides:
childJustRemovedHook in class BeanContextSupport
Parameters:
child
bcsc

createBCSChild

protected BeanContextSupport.BCSChild createBCSChild(Object targetChild,
                                                     Object peer)

Subclasses can override this method to insert their own subclass of Child without having to override add() or the other Collection methods that add children to the set.

Overrides:
createBCSChild in class BeanContextSupport
Parameters:
targetChild - the child to create the Child on behalf of
peer - the peer if the targetChild and peer are related by BeanContextProxy

createBCSSServiceProvider

protected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(Class sc,
                                                                                   BeanContextServiceProvider bcsp)
subclasses can override this method to create new subclasses of BCSSServiceProvider without having to overrride addService() in order to instantiate.

Parameters:
sc
bcsp

fireServiceAdded

protected final void fireServiceAdded(BeanContextServiceAvailableEvent bcssae)
Fires a BeanContextServiceAvailableEvent indicating that a new service has become available.

Parameters:
bcssae - the BeanContextServiceAvailableEvent

fireServiceAdded

protected final void fireServiceAdded(Class serviceClass)
Fires a BeanContextServiceEvent notifying of a new service.

Parameters:
serviceClass

fireServiceRevoked

protected final void fireServiceRevoked(BeanContextServiceRevokedEvent bcsre)
Fires a BeanContextServiceEvent notifying of a service being revoked.

Parameters:
bcsre - the BeanContextServiceRevokedEvent

fireServiceRevoked

protected final void fireServiceRevoked(Class serviceClass,
                                        boolean revokeNow)
Fires a BeanContextServiceRevokedEvent indicating that a particular service is no longer available.

Parameters:
serviceClass
revokeNow

getBeanContextServicesPeer

public BeanContextServices getBeanContextServicesPeer()
Gets the BeanContextServices associated with this BeanContextServicesSupport.

Returns:
the instance of BeanContext this object is providing the implementation for.

getChildBeanContextServicesListener

protected static final BeanContextServicesListener getChildBeanContextServicesListener(Object child)
Gets the BeanContextServicesListener (if any) of the specified child.

Parameters:
child - the specified child
Returns:
the BeanContextServicesListener (if any) of the specified child

getCurrentServiceClasses

public Iterator getCurrentServiceClasses()
Returns:
an iterator for all the currently registered service classes.

getCurrentServiceSelectors

public Iterator getCurrentServiceSelectors(Class serviceClass)
Parameters:
serviceClass
Returns:
an iterator for all the currently available service selectors (if any) available for the specified service.

getService

public Object getService(BeanContextChild child,
                         Object requestor,
                         Class serviceClass,
                         Object serviceSelector,
                         BeanContextServiceRevokedListener bcsrl)
                  throws TooManyListenersException
obtain a service which may be delegated

Parameters:
child
requestor
serviceClass
serviceSelector
bcsrl
Throws:
TooManyListenersException

hasService

public synchronized boolean hasService(Class serviceClass)
has a service, which may be delegated

Parameters:
serviceClass

initialize

public void initialize()
called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state. subclasses may envelope this method, but should not override it or call it directly.

Overrides:
initialize in class BeanContextSupport

initializeBeanContextResources

protected synchronized void initializeBeanContextResources()
called from setBeanContext to notify a BeanContextChild to allocate resources obtained from the nesting BeanContext. subclasses may envelope this method to implement their own semantics.

Overrides:
initializeBeanContextResources in class BeanContextChildSupport

releaseBeanContextResources

protected synchronized void releaseBeanContextResources()
called from setBeanContext to notify a BeanContextChild to release resources obtained from the nesting BeanContext. This method revokes any services obtained from its parent. subclasses may envelope this method to implement their own semantics.

Overrides:
releaseBeanContextResources in class BeanContextChildSupport

releaseService

public void releaseService(BeanContextChild child,
                           Object requestor,
                           Object service)
release a service

Parameters:
child
requestor
service

removeBeanContextServicesListener

public void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
remove a BeanContextServicesListener

Parameters:
bcsl

revokeService

public void revokeService(Class serviceClass,
                          BeanContextServiceProvider bcsp,
                          boolean revokeCurrentServicesNow)
remove a service

Parameters:
serviceClass
bcsp
revokeCurrentServicesNow

serviceAvailable

public void serviceAvailable(BeanContextServiceAvailableEvent bcssae)
BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself. subclasses may override or envelope this method to implement their own propagation semantics.

Overrides:
serviceAvailable in class BeanContextChildSupport
Parameters:
bcssae

serviceRevoked

public void serviceRevoked(BeanContextServiceRevokedEvent bcssre)
BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself. subclasses may override or envelope this method to implement their own propagation semantics.

Overrides:
serviceRevoked in class BeanContextChildSupport
Parameters:
bcssre


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.