Class SharedObjectFactory
- java.lang.Object
-
- org.eclipse.ecf.core.sharedobject.SharedObjectFactory
-
- All Implemented Interfaces:
ISharedObjectFactory
public class SharedObjectFactory extends Object implements ISharedObjectFactory
Factory for creatingISharedObject
instances. This class provides ECF clients an entry point to constructingISharedObject
instances.
-
-
Field Summary
Fields Modifier and Type Field Description protected static ISharedObjectFactory
instance
-
Constructor Summary
Constructors Modifier Constructor Description protected
SharedObjectFactory()
-
Method Summary
-
-
-
Field Detail
-
instance
protected static ISharedObjectFactory instance
-
-
Method Detail
-
getDefault
public static ISharedObjectFactory getDefault()
-
addDescription
public SharedObjectTypeDescription addDescription(SharedObjectTypeDescription description)
- Specified by:
addDescription
in interfaceISharedObjectFactory
-
getDescriptions
public List getDescriptions()
Description copied from interface:ISharedObjectFactory
Get a collection of the SharedObjectTypeDescriptions currently known to this factory. This allows clients to query the factory to determine what if any other SharedObjectTypeDescriptions are currently registered with the factory, and if so, what they are.- Specified by:
getDescriptions
in interfaceISharedObjectFactory
- Returns:
- List of SharedObjectTypeDescription instances. Will not be null.
-
getDescriptions0
protected List getDescriptions0()
-
addDescription0
protected SharedObjectTypeDescription addDescription0(SharedObjectTypeDescription n)
-
containsDescription
public boolean containsDescription(SharedObjectTypeDescription scd)
Description copied from interface:ISharedObjectFactory
Check to see if a given named description is already contained by this factory- Specified by:
containsDescription
in interfaceISharedObjectFactory
- Parameters:
scd
- the SharedObjectTypeDescription to look for- Returns:
- true if description is already known to factory, false otherwise
-
containsDescription0
protected boolean containsDescription0(SharedObjectTypeDescription scd)
-
getDescription0
protected SharedObjectTypeDescription getDescription0(SharedObjectTypeDescription scd)
-
getDescription0
protected SharedObjectTypeDescription getDescription0(String name)
-
getDescriptionByName
public SharedObjectTypeDescription getDescriptionByName(String name) throws SharedObjectCreateException
Description copied from interface:ISharedObjectFactory
Get the known SharedObjectTypeDescription given it's name.- Specified by:
getDescriptionByName
in interfaceISharedObjectFactory
- Returns:
- SharedObjectTypeDescription found. Null if description not found.
- Throws:
SharedObjectCreateException
-
createSharedObject
public ISharedObject createSharedObject(SharedObjectTypeDescription desc, Object[] args) throws SharedObjectCreateException
Description copied from interface:ISharedObjectFactory
Create ISharedObject instance. Given a SharedObjectTypeDescription object, a String [] of argument types, and an Object [] of parameters, this method will- lookup the known SharedObjectTypeDescriptions to find one of matching name
- if found, will retrieve or create an ISharedObjectInstantiator for that description
- Call the ISharedObjectInstantiator.createInstance method to return an instance of ISharedObject
- Specified by:
createSharedObject
in interfaceISharedObjectFactory
- Parameters:
desc
- the SharedObjectTypeDescription to use to create the instanceargs
- an Object [] of arguments passed to the createInstance method of the ISharedObjectInstantiator- Returns:
- a valid instance of ISharedObject. Will not be null.
- Throws:
SharedObjectCreateException
- if shared object cannot be created
-
createSharedObject
public ISharedObject createSharedObject(String descriptionName) throws SharedObjectCreateException
Description copied from interface:ISharedObjectFactory
Create ISharedObject instance. Given a SharedObjectTypeDescription name, this method will- lookup the known SharedObjectTypeDescriptions to find one of matching name
- if found, will retrieve or create an ISharedObjectInstantiator for that description
- Call the ISharedObjectInstantiator.createInstance method to return an instance of ISharedObject
- Specified by:
createSharedObject
in interfaceISharedObjectFactory
- Parameters:
descriptionName
- the SharedObjectTypeDescription name to lookup- Returns:
- a valid instance of ISharedObject. Will not be null.
- Throws:
SharedObjectCreateException
-
createSharedObject
public ISharedObject createSharedObject(String descriptionName, Object[] args) throws SharedObjectCreateException
Description copied from interface:ISharedObjectFactory
Create ISharedObject instance. Given a SharedObjectTypeDescription name, this method will- lookup the known SharedObjectTypeDescriptions to find one of matching name
- if found, will retrieve or create an ISharedObjectInstantiator for that description
- Call the ISharedObjectInstantiator.createInstance method to return an instance of ISharedObject
- Specified by:
createSharedObject
in interfaceISharedObjectFactory
- Parameters:
descriptionName
- the SharedObjectTypeDescription name to lookupargs
- the Object [] of arguments passed to the ISharedObjectInstantiator.createInstance method- Returns:
- a valid instance of IContainer. Will not be null.
- Throws:
SharedObjectCreateException
-
removeDescription
public SharedObjectTypeDescription removeDescription(SharedObjectTypeDescription scd)
Description copied from interface:ISharedObjectFactory
Remove given description from set known to this factory.- Specified by:
removeDescription
in interfaceISharedObjectFactory
- Parameters:
scd
- the SharedObjectTypeDescription to remove- Returns:
- the removed SharedObjectTypeDescription, null if nothing removed
-
removeDescription0
protected SharedObjectTypeDescription removeDescription0(SharedObjectTypeDescription n)
-
-