|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.util.SimpleResourceRegistry
public class SimpleResourceRegistry
A SimpleResourceRegistry is a basic implementation of a ResourceRegistry.
| Nested Class Summary | |
|---|---|
protected class |
SimpleResourceRegistry.RegistryKeyKey class for a registered resource. |
protected class |
SimpleResourceRegistry.RegistryValueA holder for resource objects and their (optional) respective ResourceLifecycleObservers. |
| Nested classes/interfaces inherited from interface com.tangosol.util.ResourceRegistry |
|---|
ResourceRegistry.ResourceLifecycleObserver |
| Field Summary |
|---|
| Fields inherited from interface com.tangosol.util.ResourceRegistry |
|---|
DEFAULT_NAME |
| Constructor Summary | |
|---|---|
SimpleResourceRegistry()Construct a SimpleResourceRegistry. |
|
| Method Summary | |
|---|---|
void |
dispose() |
java.lang.Object |
getResource(java.lang.Class clzResource)Attempts to retrieve the resource that was registered with the specified class. |
java.lang.Object |
getResource(java.lang.Class clzResource, java.lang.String sResourceName)Attempts to retrieve the resource that was registered with the specified class and name. |
boolean |
isEmpty()Determine if the ResourceRegistry is empty (contains no resource registrations). |
java.lang.String |
registerResource(java.lang.Class clzResource, Builder bldrResource, RegistrationBehavior behavior, ResourceRegistry.ResourceLifecycleObserver observer)Registers a resource according to the specified RegistrationBehavior. |
java.lang.String |
registerResource(java.lang.Class clzResource, java.lang.Object resource)Registers the resource for later retrieval with ResourceResolver.getResource(Class). |
java.lang.String |
registerResource(java.lang.Class clzResource, java.lang.String sResourceName, Builder bldrResource, RegistrationBehavior behavior, ResourceRegistry.ResourceLifecycleObserver observer)Registers a resource according to the specified RegistrationBehavior. |
java.lang.String |
registerResource(java.lang.Class clzResource, java.lang.String sResourceName, java.lang.Object resource)Registers the resource with the specified name for later retrieval with ResourceResolver.getResource(Class, String). |
void |
unregisterResource(java.lang.Class clzResource, java.lang.String sResourceName)Unregisters the resource that was previously registered of the specified class and name. |
| Constructor Detail |
|---|
public SimpleResourceRegistry()
SimpleResourceRegistry.| Method Detail |
|---|
public boolean isEmpty()
ResourceRegistry is empty (contains no resource registrations).public void dispose()
dispose in interface com.oracle.common.base.Disposablepublic java.lang.Object getResource(java.lang.Class clzResource)
getResource in interface ResourceResolverclzResource - the class of the resourcenull if the resource is unknown to the ResourceRegistry
public java.lang.Object getResource(java.lang.Class clzResource,
java.lang.String sResourceName)
getResource in interface ResourceResolverclzResource - the class of the resourcesResourceName - the name of the resourcenull if the resource is unknown to the ResourceRegistry
public java.lang.String registerResource(java.lang.Class clzResource,
java.lang.Object resource)
throws java.lang.IllegalArgumentException
ResourceResolver.getResource(Class).
Notes:
ResourceRegistry.registerResource(Class, String, Object)Disposable will be disposed when the ResourceRegistry is disposed.registerResource in interface ResourceRegistryclzResource - the class of the resourceresource - the resourcejava.lang.IllegalArgumentException - if a resource of the same specified type is already registered
public java.lang.String registerResource(java.lang.Class clzResource,
java.lang.String sResourceName,
java.lang.Object resource)
throws java.lang.IllegalArgumentException
ResourceResolver.getResource(Class, String).
Notes:
Disposable will be disposed when the ResourceRegistry is disposed.registerResource in interface ResourceRegistryclzResource - the class of the resourcesResourceName - the proposed name of the resourceresource - the resourcejava.lang.IllegalArgumentException - if a resource of the same specified type and name is already registered
public java.lang.String registerResource(java.lang.Class clzResource,
Builder bldrResource,
RegistrationBehavior behavior,
ResourceRegistry.ResourceLifecycleObserver observer)
throws java.lang.IllegalArgumentException
RegistrationBehavior. If successful the registered resource may later be retrieved using method ResourceResolver.getResource(Class).
Notes:
ResourceRegistry.registerResource(Class, String, Builder, RegistrationBehavior, ResourceLifecycleObserver)Disposable will be disposed when the ResourceRegistry is disposed.registerResource in interface ResourceRegistryclzResource - the class of the resourcebldrResource - the Builder to realize the resource to register (if required the specified behavior requires a resource)behavior - the RegistrationBehavior to useobserver - an optional ResourceRegistry.ResourceLifecycleObserver that will be called when the resource is being released from the ResourceRegistry (may be null)java.lang.IllegalArgumentException - if a resource with the specified class is already registered with the ResourceRegistry and the behavior was RegistrationBehavior.FAIL
public java.lang.String registerResource(java.lang.Class clzResource,
java.lang.String sResourceName,
Builder bldrResource,
RegistrationBehavior behavior,
ResourceRegistry.ResourceLifecycleObserver observer)
throws java.lang.IllegalArgumentException
RegistrationBehavior. If successful the registered resource may later be retrieved using method ResourceResolver.getResource(Class, String).
Notes:
Disposable will be disposed when the ResourceRegistry is disposed.registerResource in interface ResourceRegistryclzResource - the class of the resourcesResourceName - the proposed name of the resourcebldrResource - the Builder to realize the resource to register (if required the specified behavior requires a resource)behavior - the RegistrationBehavior to useobserver - an optional ResourceRegistry.ResourceLifecycleObserver that will be called when the resource is being released from the ResourceRegistry (may be null)java.lang.IllegalArgumentException - if a resource with the specified class is already registered with the ResourceRegistry and the behavior was RegistrationBehavior.FAIL
public void unregisterResource(java.lang.Class clzResource,
java.lang.String sResourceName)
Note: Unregistering a resource does not cause it to be disposed, but it does call ResourceRegistry.ResourceLifecycleObserver.onRelease(Object) if an observer was provided at the time of registration.
unregisterResource in interface ResourceRegistryclzResource - the class of the resourcesResourceName - the name of the resource
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||