public abstract class DefaultRegistry<T extends EObject,R extends EObject>
extends java.lang.Object
| Constructor and Description |
|---|
DefaultRegistry() |
| Modifier and Type | Method and Description |
|---|---|
void |
addInitializer(RegistryIntializer<T> initializer)
Adds a new
RegistryIntializer to the registry |
abstract boolean |
addToRegistry(R registry,
T object)
Adds the given object to the given registry and returns
true, on success otherwise false |
protected abstract R |
createEmptyRegistryInstance()
Creates an emtpy instance of the registry
|
void |
dispose()
Disposes the registry
|
protected abstract java.util.List<T> |
getAllObject(R registry)
Returns all objects of the given registry
|
java.util.List<T> |
getAllRegisteredObjects()
Returns all registered objects or an empty list
|
LocationUriProvider |
getLocationUriProvider()
Returns the uri provider instance
|
protected R |
getRegistry()
Returns the registry object and initializes it lazy
|
protected ResourceSet |
getResourceSet()
Returns the
ResourceSet |
protected abstract void |
initializeResourceSet(ResourceSet resourceSet)
Initializes the resource set if necessary
|
protected void |
initRegistry()
Initializes the registry
|
boolean |
registerObject(T object)
Registers the object and returns
true on success
otherwise false, if e.g. |
abstract boolean |
removeFromRegistry(R registry,
T object)
Removes the given object from the given registry and returns
true, on success otherwise false |
void |
removeInitializer(RegistryIntializer<T> initializer)
Removes a new
RegistryIntializer from the registry |
protected void |
saveRegistry()
Saves the registry
|
void |
setLocationUriProvider(LocationUriProvider uriProvider)
Sets the
LocationUriProvider instance |
boolean |
unregisterObject(T object)
Unregisters the object and returns
true on success
otherwise false. |
public abstract boolean addToRegistry(R registry, T object)
true, on success otherwise falseregistry - the registry to add the object to, cannot be nullobject - the object to register, cannot be nulltrue, on successful registration, otherwise falsepublic abstract boolean removeFromRegistry(R registry, T object)
true, on success otherwise falseregistry - the registry to remove the object to, cannot be nullobject - the object to remove, cannot be nulltrue, on successful un-registration, otherwise falsepublic java.util.List<T> getAllRegisteredObjects()
public boolean registerObject(T object)
true on success
otherwise false, if e.g. the object already exists or is nullobject - the object to registertrue on success otherwise falsepublic boolean unregisterObject(T object)
true on success
otherwise false.object - the object to un-registertrue on success otherwise falsepublic void addInitializer(RegistryIntializer<T> initializer)
RegistryIntializer to the registryinitializer - the initializer to addpublic void removeInitializer(RegistryIntializer<T> initializer)
RegistryIntializer from the registryinitializer - the initializer to removepublic LocationUriProvider getLocationUriProvider()
public void setLocationUriProvider(LocationUriProvider uriProvider)
LocationUriProvider instanceuriProvider - the instance to setpublic void dispose()
protected abstract java.util.List<T> getAllObject(R registry)
registry - the registrynullprotected abstract void initializeResourceSet(ResourceSet resourceSet)
resourceSet - the resource set to initializeprotected abstract R createEmptyRegistryInstance()
protected ResourceSet getResourceSet()
ResourceSetResourceSetprotected R getRegistry()
protected void initRegistry()
protected void saveRegistry()
Data In Motion Consulting GmbH