Package com.tangosol.util
Class NullImplementation.NullResourceRegistry
java.lang.Object
com.tangosol.util.NullImplementation.NullResourceRegistry
- All Implemented Interfaces:
 Disposable,ResourceRegistry,ResourceResolver,AutoCloseable
- Enclosing class:
 NullImplementation
public static class NullImplementation.NullResourceRegistry
extends Object
implements ResourceRegistry
A 
ResourceRegistry implementation that does nothing.- 
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.util.ResourceRegistry
ResourceRegistry.ResourceLifecycleObserver<R> - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NullImplementation.NullResourceRegistrySingleton instance of a NullResourceRegistry.Fields inherited from interface com.tangosol.util.ResourceRegistry
DEFAULT_NAME - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Invoked when all resources owned by the implementer can safely be released.<R> RgetResource(Class<R> clsResource) Attempts to retrieve the resource that was registered with the specified class.<R> RgetResource(Class<R> clsResource, String sResourceName) Attempts to retrieve the resource that was registered with the specified class and name.<R> StringregisterResource(Class<R> clzResource, Builder<? extends R> bldrResource, RegistrationBehavior behavior, ResourceRegistry.ResourceLifecycleObserver<R> observer) Registers a resource according to the specifiedRegistrationBehavior.<R> StringregisterResource(Class<R> clzResource, String sResourceName, Builder<? extends R> bldrResource, RegistrationBehavior behavior, ResourceRegistry.ResourceLifecycleObserver<R> observer) Registers a resource according to the specifiedRegistrationBehavior.<R> StringregisterResource(Class<R> clzResource, String sResourceName, R resource) Registers the resource with the specified name for later retrieval withResourceResolver.getResource(Class, String).<R> StringregisterResource(Class<R> clzResource, R resource) Registers the resource for later retrieval withResourceResolver.getResource(Class).<R> voidunregisterResource(Class<R> clzResource, String sResourceName) Unregisters the resource that was previously registered of the specified class and name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oracle.coherence.common.base.Disposable
close 
- 
Field Details
- 
INSTANCE
Singleton instance of a NullResourceRegistry. 
 - 
 - 
Constructor Details
- 
NullResourceRegistry
public NullResourceRegistry() 
 - 
 - 
Method Details
- 
registerResource
Description copied from interface:ResourceRegistryRegisters the resource for later retrieval withResourceResolver.getResource(Class).Notes:
- Multiple resources for the same class can be registered if each
      resource is registered with a unique name via
      
ResourceRegistry.registerResource(Class, String, Object) - Registration of resources will occur in a thread-safe manner.
 - Resources that are 
Disposablewill be disposed when theResourceRegistryis disposed. 
- Specified by:
 registerResourcein interfaceResourceRegistry- Parameters:
 clzResource- the class of the resourceresource- the resource- Returns:
 - the actual name used to register the resource
 
 - Multiple resources for the same class can be registered if each
      resource is registered with a unique name via
      
 - 
registerResource
Description copied from interface:ResourceRegistryRegisters the resource with the specified name for later retrieval withResourceResolver.getResource(Class, String).Notes:
- Registration of resources will occur in a thread-safe manner.
 - Resources that are 
Disposablewill be disposed when theResourceRegistryis disposed. 
- Specified by:
 registerResourcein interfaceResourceRegistry- Parameters:
 clzResource- the class of the resourcesResourceName- the proposed name of the resourceresource- the resource- Returns:
 - the actual name used to register the resource
 
 - 
registerResource
public <R> String registerResource(Class<R> clzResource, Builder<? extends R> bldrResource, RegistrationBehavior behavior, ResourceRegistry.ResourceLifecycleObserver<R> observer) Description copied from interface:ResourceRegistryRegisters a resource according to the specifiedRegistrationBehavior. If successful the registered resource may later be retrieved using methodResourceResolver.getResource(Class).Notes:
- Multiple resources for the same class can be registered if each
      resource is registered with a unique name via
      
ResourceRegistry.registerResource(Class, String, Builder, RegistrationBehavior, ResourceLifecycleObserver) - Registration of resources will occur in a thread-safe manner.
 - Resources that are 
Disposablewill be disposed when theResourceRegistryis disposed. 
- Specified by:
 registerResourcein interfaceResourceRegistry- Type Parameters:
 R- the type of the resource- Parameters:
 clzResource- the class of the resourcebldrResource- theBuilderto realize the resource to register (if required the specified behavior requires a resource)behavior- theRegistrationBehaviorto useobserver- an optionalResourceRegistry.ResourceLifecycleObserverthat will be called when the resource is being released from theResourceRegistry(may be null)- Returns:
 - the actual name used to register the resource
 
 - Multiple resources for the same class can be registered if each
      resource is registered with a unique name via
      
 - 
registerResource
public <R> String registerResource(Class<R> clzResource, String sResourceName, Builder<? extends R> bldrResource, RegistrationBehavior behavior, ResourceRegistry.ResourceLifecycleObserver<R> observer) throws IllegalArgumentException Description copied from interface:ResourceRegistryRegisters a resource according to the specifiedRegistrationBehavior. If successful the registered resource may later be retrieved using methodResourceResolver.getResource(Class, String).Notes:
- Registration of resources will occur in a thread-safe manner.
 - Resources that are 
Disposablewill be disposed when theResourceRegistryis disposed. 
- Specified by:
 registerResourcein interfaceResourceRegistry- Type Parameters:
 R- the type of the resource- Parameters:
 clzResource- the class of the resourcesResourceName- the proposed name of the resourcebldrResource- theBuilderto realize the resource to register (if required the specified behavior requires a resource)behavior- theRegistrationBehaviorto useobserver- an optionalResourceRegistry.ResourceLifecycleObserverthat will be called when the resource is being released from theResourceRegistry(may be null)- Returns:
 - the actual name used to register the resource
 - Throws:
 IllegalArgumentException- if a resource with the specified class is already registered with theResourceRegistryand the behavior wasRegistrationBehavior.FAIL
 - 
unregisterResource
Description copied from interface:ResourceRegistryUnregisters the resource that was previously registered of the specified class and name.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.- Specified by:
 unregisterResourcein interfaceResourceRegistry- Type Parameters:
 R- the type of the resource- Parameters:
 clzResource- the class of the resourcesResourceName- the name of the resource
 - 
getResource
Description copied from interface:ResourceResolverAttempts to retrieve the resource that was registered with the specified class.- Specified by:
 getResourcein interfaceResourceResolver- Type Parameters:
 R- the type of the resource- Parameters:
 clsResource- the class of the resource- Returns:
 - the registered resource or 
nullif the resource is unknown to theResourceRegistry 
 - 
getResource
Description copied from interface:ResourceResolverAttempts to retrieve the resource that was registered with the specified class and name.- Specified by:
 getResourcein interfaceResourceResolver- Type Parameters:
 R- the type of the resource- Parameters:
 clsResource- the class of the resourcesResourceName- the name of the resource- Returns:
 - the registered resource or 
nullif the resource is unknown to theResourceRegistry 
 - 
dispose
public void dispose()Description copied from interface:DisposableInvoked when all resources owned by the implementer can safely be released.Once disposed of the object should no longer be considered to be usable.
Note the Disposable interface is compatible with try-with-resources which will automatically invoke this method.
- Specified by:
 disposein interfaceDisposable
 
 -