org.electrocodeogram.cpc.core.api.provider.data
Interface ICloneFactoryProvider

All Superinterfaces:
IProvider

public interface ICloneFactoryProvider
extends IProvider

Public clone data object factory provider API.
A clone factory provider is used by all CPC modules for the creation of clone objects. Clone objects are never created directly, circumventing the clone factory provider.

There may only be one active clone factory provider at all times.

3rd party extensions should register their own ICloneObject, ICloneObjectSupport and ICloneObjectExtension classes with the clone factory provider via the extension point:
org.electrocodeogram.cpc.core.cloneDataElements

Author:
vw
See Also:
ICloneObject, ICloneObjectSupport, ICloneObjectExtension

Method Summary
 ICloneDataElement getInstance(java.lang.Class<? extends ICloneDataElement> type)
          Creates a new instance of the specified ICloneDataElement sub class.
 ICloneObject getInstance(java.lang.Class<? extends ICloneObject> type, java.lang.String uuid)
          Creates a new instance of the specified ICloneObject sub class.
 IStatefulObject getInstanceByPersistenceClassIdentifier(java.lang.String persistenceClassIdentifier)
          Creates a new instance of a registered IStatefulObject for the given IStatefulObject.getPersistenceClassIdentifier() value.
 java.util.List<ICloneObjectExtension> getRegisteredCloneObjectExtensionObjects(java.lang.Class<? extends ICloneObject> parentType)
          Some users of the getRegistered... methods need to create temporary instances of the classes during their processing.
 java.util.List<java.lang.Class<? extends ICloneObjectExtension>> getRegisteredCloneObjectExtensions()
          Retrieves a list of all registered ICloneObjectExtension implementations.
 java.util.List<java.lang.Class<? extends ICloneObjectExtension>> getRegisteredCloneObjectExtensions(java.lang.Class<? extends ICloneObject> parentType)
          Same as getRegisteredCloneObjectExtensions() but only returns the extensions registered for the given ICloneObject type.
 java.util.List<java.lang.Class<? extends ICloneObject>> getRegisteredCloneObjects()
          Retrieves a list of all registered ICloneObject sub-interface implementations.
 java.util.List<java.lang.Class<? extends ICloneObjectSupport>> getRegisteredCloneObjectSupports()
          Retrieves a list of all registered ICloneObjectSupport sub-interface implementations.
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.provider.IProvider
getProviderName, toString
 

Method Detail

getInstance

ICloneDataElement getInstance(java.lang.Class<? extends ICloneDataElement> type)
Creates a new instance of the specified ICloneDataElement sub class.
For ICloneObject sub classes a new unique uuid is automatically generated.

Valid values for type are:

Parameters:
type - the ICloneDataElement sub class to create a new instance for, never null.
Returns:
a new instance which is guaranteed to be castable to the specified type or null if no such ICloneDataElement sub class is available.

getInstance

ICloneObject getInstance(java.lang.Class<? extends ICloneObject> type,
                         java.lang.String uuid)
Creates a new instance of the specified ICloneObject sub class.

This method can not be used to create instances for ICloneObjectSupport sub-interfaces.

Valid values for type are:

Parameters:
type - the ICloneObject sub class to create a new instance for, never null.
uuid - the unique uuid to use for the newly created instance.
Returns:
a new instance which is guaranteed to be castable to the specified type or null if no such ICloneObject sub class is available.

getInstanceByPersistenceClassIdentifier

IStatefulObject getInstanceByPersistenceClassIdentifier(java.lang.String persistenceClassIdentifier)
Creates a new instance of a registered IStatefulObject for the given IStatefulObject.getPersistenceClassIdentifier() value.

Parameters:
persistenceClassIdentifier - the IStatefulObject persistence class identifier to create an instance of an implementation class for, never null.
Returns:
a new instance which is guaranteed to yield persistenceClassIdentifier for IStatefulObject.getPersistenceClassIdentifier() or NULL if no such class is available.

getRegisteredCloneObjects

java.util.List<java.lang.Class<? extends ICloneObject>> getRegisteredCloneObjects()
Retrieves a list of all registered ICloneObject sub-interface implementations.
Implementations are registered with the clone factory provider via the corresponding extension point.

The returned list and it's elements may not be modified.

Returns:
a list of registered clone objects, never null.

getRegisteredCloneObjectSupports

java.util.List<java.lang.Class<? extends ICloneObjectSupport>> getRegisteredCloneObjectSupports()
Retrieves a list of all registered ICloneObjectSupport sub-interface implementations.
Implementations are registered with the clone factory provider via the corresponding extension point.

The returned list and it's elements may not be modified.

Returns:
a list of registered clone objects, never null.

getRegisteredCloneObjectExtensions

java.util.List<java.lang.Class<? extends ICloneObjectExtension>> getRegisteredCloneObjectExtensions()
Retrieves a list of all registered ICloneObjectExtension implementations.
Implementations are registered with the clone factory provider via the corresponding extension point.

The returned list and it's elements may not be modified.

Returns:
a list of all registered clone object extensions, never null.

getRegisteredCloneObjectExtensions

java.util.List<java.lang.Class<? extends ICloneObjectExtension>> getRegisteredCloneObjectExtensions(java.lang.Class<? extends ICloneObject> parentType)
Same as getRegisteredCloneObjectExtensions() but only returns the extensions registered for the given ICloneObject type.

Parameters:
parentType - the ICloneObject type for which all registered extensions should be returned, never null.
Returns:
a list of registered clone object extensions for the given parent type, never null.

getRegisteredCloneObjectExtensionObjects

java.util.List<ICloneObjectExtension> getRegisteredCloneObjectExtensionObjects(java.lang.Class<? extends ICloneObject> parentType)
Some users of the getRegistered... methods need to create temporary instances of the classes during their processing. This adds overhead which can be critical. An extreme case of this is the IStoreProvider.
This method mirrors getRegisteredCloneObjectExtensions(Class) but returns shared instances of the extensions instead of their classes.

IMPORTANT: the returned objects are shared. Do not modify them in any way.

Parameters:
parentType - the ICloneObject type for which all registered extensions should be returned, never null.
Returns:
a list of shared instances of registered clone object extensions for the given parent type, never null.