public class BeanContextServicesSupport extends BeanContextSupport implements BeanContextServices, Serializable
BeanContextServices interface.
This class can be used directly, or be a super class of your class, or be a
delegate of your implementation that needs to support
BeanContextServices interface.beanContextChildPeerglobalHierarchyLockPROPERTYNAME| Constructor and Description |
|---|
BeanContextServicesSupport()
Constructs a standard
BeanContextServicesSupport. |
BeanContextServicesSupport(BeanContextServices peer)
Constructs a
BeanContextServicesSupport which is a
delegate of the given peer. |
BeanContextServicesSupport(BeanContextServices peer,
Locale locale)
Constructs a
BeanContextServicesSupport which is a
delegate of the given peer. |
BeanContextServicesSupport(BeanContextServices peer,
Locale locale,
boolean designTime)
Constructs a
BeanContextServicesSupport which is a
delegate of the given peer. |
BeanContextServicesSupport(BeanContextServices peer,
Locale locale,
boolean designTime,
boolean okToUseGui)
Constructs a
BeanContextServicesSupport which is a
delegate of the given peer. |
| Modifier and Type | Method and Description |
|---|---|
void |
addBeanContextServicesListener(BeanContextServicesListener listener) |
boolean |
addService(Class serviceClass,
BeanContextServiceProvider provider)
Add a service to this context.
|
BeanContextServices |
getBeanContextServicesPeer()
Returns the peer of this context casted as
BeanContextServices. |
Iterator |
getCurrentServiceClasses()
Returns an iterator of all registered service classes, with
removed() disabled. |
Iterator |
getCurrentServiceSelectors(Class serviceClass)
Returns the service selectors of the specified service.
|
Object |
getService(BeanContextChild child,
Object requestor,
Class serviceClass,
Object serviceSelector,
BeanContextServiceRevokedListener bcsrl)
Get a service instance on behalf of the specified child of this context,
by calling the registered service provider, or by delegating to the
parent context.
|
boolean |
hasService(Class serviceClass)
Checks whether a service is registed in this context or the parent
context.
|
void |
initialize()
Initializes all transient fields of this instance, called by
constructors and
readObject(). |
void |
releaseService(BeanContextChild child,
Object requestor,
Object service)
Release a service which has been requested previously.
|
void |
removeBeanContextServicesListener(BeanContextServicesListener listener) |
void |
revokeService(Class serviceClass,
BeanContextServiceProvider serviceProvider,
boolean revokeCurrentServicesNow)
Revokes a service in this bean context.
|
void |
serviceAvailable(BeanContextServiceAvailableEvent event)
Notify all listeners and children that implements
BeanContextServices of the event. |
void |
serviceRevoked(BeanContextServiceRevokedEvent event)
Notify all listeners and children that implements
BeanContextServices of the event. |
add, addAll, addBeanContextMembershipListener, avoidingGui, clear, contains, containsAll, containsKey, dontUseGui, getBeanContextPeer, getLocale, getResource, getResourceAsStream, instantiateChild, isDesignTime, isEmpty, isSerializing, iterator, needsGui, okToUseGui, propertyChange, readChildren, remove, removeAll, removeBeanContextMembershipListener, retainAll, setDesignTime, setLocale, size, toArray, toArray, vetoableChange, writeChildrenaddPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, isDelegated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, validatePendingSetBeanContextequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddBeanContextMembershipListener, getResource, getResourceAsStream, instantiateChild, removeBeanContextMembershipListeneraddPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContextadd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArrayisDesignTime, setDesignTimeavoidingGui, dontUseGui, needsGui, okToUseGuipublic BeanContextServicesSupport()
BeanContextServicesSupport.public BeanContextServicesSupport(BeanContextServices peer)
BeanContextServicesSupport which is a
delegate of the given peer.peer - the peer of this contextpublic BeanContextServicesSupport(BeanContextServices peer, Locale locale)
BeanContextServicesSupport which is a
delegate of the given peer.peer - the peer of this contextlocale - the locale of this contextpublic BeanContextServicesSupport(BeanContextServices peer, Locale locale, boolean designTime)
BeanContextServicesSupport which is a
delegate of the given peer.peer - the peer of this contextlocale - the locale of this contextdesignTime - whether in design mode or notpublic BeanContextServicesSupport(BeanContextServices peer, Locale locale, boolean designTime, boolean okToUseGui)
BeanContextServicesSupport which is a
delegate of the given peer.peer - the peer of this contextlocale - the locale of this contextdesignTime - whether in design mode or notokToUseGui - whether GUI is usable or notpublic void addBeanContextServicesListener(BeanContextServicesListener listener)
addBeanContextServicesListener in interface BeanContextServicespublic boolean addService(Class serviceClass, BeanContextServiceProvider provider)
Delegate to addService(serviceClass, provider, true).
addService in interface BeanContextServicesBeanContextServices.addService(java.lang.Class,
jadex.commons.beans.beancontext.BeanContextServiceProvider)public BeanContextServices getBeanContextServicesPeer()
BeanContextServices.BeanContextServicespublic Iterator getCurrentServiceClasses()
removed() disabled.getCurrentServiceClasses in interface BeanContextServicesBeanContextServices.getCurrentServiceClasses()public Iterator getCurrentServiceSelectors(Class serviceClass)
remove() operation is disabled.getCurrentServiceSelectors in interface BeanContextServicesBeanContextServices.getCurrentServiceSelectors(java.lang.Class)public Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException
getService in interface BeanContextServiceschild - the child that request servicerequestor - the requestor objectserviceClass - the service classserviceSelector - the service selectorsbcsrl - the BeanContextServiceRevokedListenerIllegalArgumentException - if child is not a child of this contextTooManyListenersExceptionBeanContextServices.getService(jadex.commons.beans.beancontext.BeanContextChild,
java.lang.Object, java.lang.Class, java.lang.Object,
jadex.commons.beans.beancontext.BeanContextServiceRevokedListener)public boolean hasService(Class serviceClass)
hasService in interface BeanContextServicesserviceClass - the service classBeanContextServices.hasService(java.lang.Class)public void initialize()
BeanContextSupportreadObject().public void releaseService(BeanContextChild child, Object requestor, Object service)
releaseService in interface BeanContextServiceschild - the child that request the servicerequestor - the requestor objectservice - the service instanceIllegalArgumentException - if child is not a child of this contextpublic void removeBeanContextServicesListener(BeanContextServicesListener listener)
removeBeanContextServicesListener in interface BeanContextServicespublic void revokeService(Class serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow)
The given service provider is unregistered and a
BeanContextServiceRevokedEvent is fired. All registered
service listeners and current service users get notified.
revokeService in interface BeanContextServicesserviceClass - the service classserviceProvider - the service providerrevokeCurrentServicesNow - true if service should be terminated immediantlyBeanContextServices.revokeService(java.lang.Class,
jadex.commons.beans.beancontext.BeanContextServiceProvider, boolean)public void serviceAvailable(BeanContextServiceAvailableEvent event)
BeanContextServices of the event.serviceAvailable in interface BeanContextServicesListenerserviceAvailable in class BeanContextChildSupportBeanContextServicesListener.serviceAvailable(jadex.commons.beans.beancontext.BeanContextServiceAvailableEvent)public void serviceRevoked(BeanContextServiceRevokedEvent event)
BeanContextServices of the event.serviceRevoked in interface BeanContextServiceRevokedListenerserviceRevoked in class BeanContextChildSupportBeanContextServiceRevokedListener.serviceRevoked(jadex.commons.beans.beancontext.BeanContextServiceRevokedEvent)Copyright © 2015. All Rights Reserved.