IResourceProvider
, IResourceProviderBuilder
public class ProviderResolver extends Resource implements IResourceProviderBuilder, IResourceProvider
PROP_NAMESPACE
Constructor | Description |
---|---|
ProviderResolver() |
Modifier and Type | Method | Description |
---|---|---|
IResourceProvider |
findProvider(java.lang.String namespace) |
|
Resource |
get(java.lang.String name) |
retrieve a resource.
|
void |
init() |
Called at initialization time with the resource management.
|
void |
init(IResourceProviderContext c) |
|
void |
invalidate() |
This method gets called whenever a dependency resource has been invalidated or this resource needs
to be invalidated.
|
public void init()
com.zfabrik.resources.provider.Resource
public void invalidate() throws ResourceBusyException
com.zfabrik.resources.provider.Resource
This code should be executed in a life cycle code block of this resource instance, i.e. where dependencies are effectively managed, so that race conditions can be avoided.
State changing methods of a resource should always be synchronized (e.g. on this). This is
in particular true for cross-resource dependencies. In order to assure consistency under race conditions,
a dependent resource should first declare its dependency and then retrieve the resource implementation.
In case of failures, resources should clean up by calling handle().invalidate(true);
invalidate
in class Resource
ResourceBusyException
public IResourceProvider findProvider(java.lang.String namespace)
findProvider
in interface IResourceProviderBuilder
public void init(IResourceProviderContext c)
init
in interface IResourceProvider
public Resource get(java.lang.String name)
com.zfabrik.resources.provider.IResourceProvider
null
if the resource does
not exist (or will not be made available).
Throws ResourceNotAvailableException if the resource cannot be provided due to an
error situation.get
in interface IResourceProvider
name
- name of the resourcenull
if the resource does
not exist (or will not be made available).