APIdia Launch Partner
Top Description Fields Methods
java.beans.beancontext

public Interface BeanContextServices

extends BeanContext, BeanContextServicesListener
Known Direct Implementers
java.beans.beancontext.BeanContextServicesSupport
Annotations
@SuppressWarnings:removal
@Deprecated
since:23
forRemoval:true
Imports
java.util.Iterator, .TooManyListenersException, java.beans.beancontext.BeanContext, .BeanContextServiceProvider, .BeanContextServicesListener

Deprecated

for removal since 23.

The BeanContextServices interface provides a mechanism for a BeanContext to expose generic "services" to the BeanContextChild objects within.

Field Summary

Inherited from java.beans.beancontext.BeanContext:
globalHierarchyLock

Method Summary

Modifier and TypeMethod and Description
public void
addBeanContextServicesListener(BeanContextServicesListener
the BeanContextServicesListener to add
bcsl
)
References Deprecated BeanContextServicesListener is deprecated or references (maybe indirectly) at least one deprecated element.

Adds a BeanContextServicesListener to this BeanContext

public boolean

Returns:

true if the service was successful added, false otherwise
addService
(Class<?>
the service to add
serviceClass
,
BeanContextServiceProvider
the BeanContextServiceProvider associated with the service
serviceProvider
)
References Deprecated BeanContextServiceProvider is deprecated or references (maybe indirectly) at least one deprecated element.

Adds a service to this BeanContext.

public Iterator<?>

Returns:

an Iterator consisting of the currently available services
getCurrentServiceClasses
()

Gets the currently available services for this context.

public Iterator<?>

Returns:

the currently available service selectors for the named serviceClass
getCurrentServiceSelectors
(Class<?>
the specified service
serviceClass
)

Gets the list of service dependent service parameters (Service Selectors) for the specified service, by calling getCurrentServiceSelectors() on the underlying BeanContextServiceProvider.

public Object

Returns:

a reference to this context's named Service as requested or null
getService
(BeanContextChild
the BeanContextChild associated with this request
child
,
Object
the object requesting the service
requestor
,
Class<?>
class of the requested service
serviceClass
,
Object
the service dependent parameter
serviceSelector
,
BeanContextServiceRevokedListener
the BeanContextServiceRevokedListener to notify if the service should later become revoked
bcsrl
)
References Deprecated BeanContextChild and BeanContextServiceRevokedListener are deprecated or reference (maybe indirectly) at least one deprecated element.

A BeanContextChild, or any arbitrary object associated with a BeanContextChild, may obtain a reference to a currently registered service from its nesting BeanContextServices via invocation of this method.

public boolean

Returns:

true if the service is available
hasService
(Class<?>
the service in question
serviceClass
)

Reports whether or not a given service is currently available from this context.

public void
releaseService(BeanContextChild
the BeanContextChild
child
,
Object
the requestor
requestor
,
Object
the service
service
)
References Deprecated BeanContextChild is deprecated or references (maybe indirectly) at least one deprecated element.

Releases a BeanContextChild's (or any arbitrary object associated with a BeanContextChild) reference to the specified service by calling releaseService() on the underlying BeanContextServiceProvider.

public void
removeBeanContextServicesListener(BeanContextServicesListener
the BeanContextServicesListener to remove from this context
bcsl
)
References Deprecated BeanContextServicesListener is deprecated or references (maybe indirectly) at least one deprecated element.

Removes a BeanContextServicesListener from this BeanContext

public void
revokeService(Class<?>
the service to revoke from this BeanContextServices
serviceClass
,
BeanContextServiceProvider
the BeanContextServiceProvider associated with this particular service that is being revoked
serviceProvider
,
boolean
a value of true indicates an exceptional circumstance where the BeanContextServiceProvider or BeanContextServices wishes to immediately terminate service to all currently outstanding references to the specified service.
revokeCurrentServicesNow
)
References Deprecated BeanContextServiceProvider is deprecated or references (maybe indirectly) at least one deprecated element.

BeanContextServiceProviders wishing to remove a currently registered service from this context may do so via invocation of this method.

Inherited from java.beans.beancontext.BeanContext:
addBeanContextMembershipListenergetResourcegetResourceAsStreaminstantiateChildremoveBeanContextMembershipListener
Inherited from java.beans.beancontext.BeanContextServicesListener:
serviceAvailable

Method Detail

addBeanContextServicesListenerback to summary
public void addBeanContextServicesListener(BeanContextServicesListener bcsl)

References Deprecated

BeanContextServicesListener is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Adds a BeanContextServicesListener to this BeanContext

Parameters
bcsl:BeanContextServicesListener

the BeanContextServicesListener to add

addServiceback to summary
public boolean addService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider)

References Deprecated

BeanContextServiceProvider is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Adds a service to this BeanContext. BeanContextServiceProviders call this method to register a particular service with this context. If the service has not previously been added, the BeanContextServices associates the service with the BeanContextServiceProvider and fires a BeanContextServiceAvailableEvent to all currently registered BeanContextServicesListeners. The method then returns true, indicating that the addition of the service was successful. If the given service has already been added, this method simply returns false.

Parameters
serviceClass:Class<?>

the service to add

serviceProvider:BeanContextServiceProvider

the BeanContextServiceProvider associated with the service

Returns:boolean

true if the service was successful added, false otherwise

getCurrentServiceClassesback to summary
public Iterator<?> getCurrentServiceClasses()

Gets the currently available services for this context.

Returns:Iterator<?>

an Iterator consisting of the currently available services

getCurrentServiceSelectorsback to summary
public Iterator<?> getCurrentServiceSelectors(Class<?> serviceClass)

Gets the list of service dependent service parameters (Service Selectors) for the specified service, by calling getCurrentServiceSelectors() on the underlying BeanContextServiceProvider.

Parameters
serviceClass:Class<?>

the specified service

Returns:Iterator<?>

the currently available service selectors for the named serviceClass

getServiceback to summary
public Object getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException

References Deprecated

BeanContextChild and BeanContextServiceRevokedListener are deprecated or reference (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

A BeanContextChild, or any arbitrary object associated with a BeanContextChild, may obtain a reference to a currently registered service from its nesting BeanContextServices via invocation of this method. When invoked, this method gets the service by calling the getService() method on the underlying BeanContextServiceProvider.

Parameters
child:BeanContextChild

the BeanContextChild associated with this request

requestor:Object

the object requesting the service

serviceClass:Class<?>

class of the requested service

serviceSelector:Object

the service dependent parameter

bcsrl:BeanContextServiceRevokedListener

the BeanContextServiceRevokedListener to notify if the service should later become revoked

Returns:Object

a reference to this context's named Service as requested or null

Exceptions
TooManyListenersException:
if there are too many listeners
hasServiceback to summary
public boolean hasService(Class<?> serviceClass)

Reports whether or not a given service is currently available from this context.

Parameters
serviceClass:Class<?>

the service in question

Returns:boolean

true if the service is available

releaseServiceback to summary
public void releaseService(BeanContextChild child, Object requestor, Object service)

References Deprecated

BeanContextChild is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Releases a BeanContextChild's (or any arbitrary object associated with a BeanContextChild) reference to the specified service by calling releaseService() on the underlying BeanContextServiceProvider.

Parameters
child:BeanContextChild

the BeanContextChild

requestor:Object

the requestor

service:Object

the service

removeBeanContextServicesListenerback to summary
public void removeBeanContextServicesListener(BeanContextServicesListener bcsl)

References Deprecated

BeanContextServicesListener is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Removes a BeanContextServicesListener from this BeanContext

Parameters
bcsl:BeanContextServicesListener

the BeanContextServicesListener to remove from this context

revokeServiceback to summary
public void revokeService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow)

References Deprecated

BeanContextServiceProvider is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

BeanContextServiceProviders wishing to remove a currently registered service from this context may do so via invocation of this method. Upon revocation of the service, the BeanContextServices fires a BeanContextServiceRevokedEvent to its list of currently registered BeanContextServiceRevokedListeners and BeanContextServicesListeners.

Parameters
serviceClass:Class<?>

the service to revoke from this BeanContextServices

serviceProvider:BeanContextServiceProvider

the BeanContextServiceProvider associated with this particular service that is being revoked

revokeCurrentServicesNow:boolean

a value of true indicates an exceptional circumstance where the BeanContextServiceProvider or BeanContextServices wishes to immediately terminate service to all currently outstanding references to the specified service.