| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
|
BeanContextServicesSupport(BeanContextServices peer, Locale lcle) Create an instance using the specified locale |
|
BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dtime) 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 |
addService(Class serviceClass, BeanContextServiceProvider bcsp) 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 |
childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc) 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 |
getCurrentServiceSelectors(Class serviceClass) |
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.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient ArrayList bcsListeners
protected transient BeanContextServicesSupport.BCSSProxyServiceProvider proxy
protected transient int serializable
protected transient HashMap services
protected transient HashMap services
field should be synchronized on that object
Constructor Detail |
---|
public BeanContextServicesSupport()
public BeanContextServicesSupport(BeanContextServices peer)
peer
- The peer BeanContext we are supplying an implementation for, if null the this object is its own peerpublic BeanContextServicesSupport(BeanContextServices peer, Locale lcle)
peer
- The peer BeanContext we are supplying an implementation for, if null the this object is its own peerlcle
- The current Locale for this BeanContext.public BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dtime)
peer
- The peer BeanContext we are supplying an implementation for, if null the this object is its own peerlcle
- The current Locale for this BeanContext.dtime
- The initial state, true if in design mode, false if runtime.public BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dTime, boolean visible)
Construct a BeanContextServicesSupport instance
peer
- The peer BeanContext we are supplying an implementation for, if null the this object is its own peerlcle
- The current Locale for this BeanContext.dTime
- The initial state, true if in design mode, false if runtime.visible
- The initial visibility.Method Detail |
---|
public void addBeanContextServicesListener(BeanContextServicesListener bcsl)
bcsl
public boolean addService(Class serviceClass, BeanContextServiceProvider bcsp)
serviceClass
bcsp
protected boolean addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent)
serviceClass
bcsp
fireEvent
protected synchronized void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException
bcsPreDeserializationHook
in class BeanContextSupport
ois
IOException
ClassNotFoundException
protected synchronized void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException
bcsPreSerializationHook
in class BeanContextSupport
oos
IOException
protected void childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
childJustRemovedHook
in class BeanContextSupport
child
bcsc
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.
createBCSChild
in class BeanContextSupport
targetChild
- the child to create the Child on behalf ofpeer
- the peer if the targetChild and peer are related by BeanContextProxyprotected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp)
sc
bcsp
protected final void fireServiceAdded(BeanContextServiceAvailableEvent bcssae)
bcssae
- the BeanContextServiceAvailableEventprotected final void fireServiceAdded(Class serviceClass)
serviceClass
protected final void fireServiceRevoked(BeanContextServiceRevokedEvent bcsre)
bcsre
- the BeanContextServiceRevokedEventprotected final void fireServiceRevoked(Class serviceClass, boolean revokeNow)
serviceClass
revokeNow
public BeanContextServices getBeanContextServicesPeer()
protected static final BeanContextServicesListener getChildBeanContextServicesListener(Object child)
child
- the specified childpublic Iterator getCurrentServiceClasses()
public Iterator getCurrentServiceSelectors(Class serviceClass)
serviceClass
public Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException
child
requestor
serviceClass
serviceSelector
bcsrl
TooManyListenersException
public synchronized boolean hasService(Class serviceClass)
serviceClass
public void initialize()
initialize
in class BeanContextSupport
protected synchronized void initializeBeanContextResources()
initializeBeanContextResources
in class BeanContextChildSupport
protected synchronized void releaseBeanContextResources()
releaseBeanContextResources
in class BeanContextChildSupport
public void releaseService(BeanContextChild child, Object requestor, Object service)
child
requestor
service
public void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
bcsl
public void revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow)
serviceClass
bcsp
revokeCurrentServicesNow
public void serviceAvailable(BeanContextServiceAvailableEvent bcssae)
serviceAvailable
in class BeanContextChildSupport
bcssae
public void serviceRevoked(BeanContextServiceRevokedEvent bcssre)
serviceRevoked
in class BeanContextChildSupport
bcssre
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |