org.eclipse.ecf.core.sharedobject
Class SharedObjectFactory

java.lang.Object
  extended by org.eclipse.ecf.core.sharedobject.SharedObjectFactory
All Implemented Interfaces:
ISharedObjectFactory

public class SharedObjectFactory
extends java.lang.Object
implements ISharedObjectFactory

Factory for creating ISharedObject instances. This class provides ECF clients an entry point to constructing ISharedObject instances.


Field Summary
protected static ISharedObjectFactory instance
           
 
Constructor Summary
protected SharedObjectFactory()
           
 
Method Summary
 SharedObjectTypeDescription addDescription(SharedObjectTypeDescription description)
           
protected  SharedObjectTypeDescription addDescription0(SharedObjectTypeDescription n)
           
 boolean containsDescription(SharedObjectTypeDescription scd)
          Check to see if a given named description is already contained by this factory
protected  boolean containsDescription0(SharedObjectTypeDescription scd)
           
 ISharedObject createSharedObject(SharedObjectTypeDescription desc, java.lang.Object[] args)
          Create ISharedObject instance.
 ISharedObject createSharedObject(java.lang.String descriptionName)
          Create ISharedObject instance.
 ISharedObject createSharedObject(java.lang.String descriptionName, java.lang.Object[] args)
          Create ISharedObject instance.
static ISharedObjectFactory getDefault()
           
protected  SharedObjectTypeDescription getDescription0(SharedObjectTypeDescription scd)
           
protected  SharedObjectTypeDescription getDescription0(java.lang.String name)
           
 SharedObjectTypeDescription getDescriptionByName(java.lang.String name)
          Get the known SharedObjectTypeDescription given it's name.
 java.util.List getDescriptions()
          Get a collection of the SharedObjectTypeDescriptions currently known to this factory.
protected  java.util.List getDescriptions0()
           
 SharedObjectTypeDescription removeDescription(SharedObjectTypeDescription scd)
          Remove given description from set known to this factory.
protected  SharedObjectTypeDescription removeDescription0(SharedObjectTypeDescription n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static ISharedObjectFactory instance
Constructor Detail

SharedObjectFactory

protected SharedObjectFactory()
Method Detail

getDefault

public static ISharedObjectFactory getDefault()

addDescription

public SharedObjectTypeDescription addDescription(SharedObjectTypeDescription description)
Specified by:
addDescription in interface ISharedObjectFactory

getDescriptions

public java.util.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 interface ISharedObjectFactory
Returns:
List of SharedObjectTypeDescription instances. Will not be null.

getDescriptions0

protected java.util.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 interface ISharedObjectFactory
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(java.lang.String name)

getDescriptionByName

public SharedObjectTypeDescription getDescriptionByName(java.lang.String name)
                                                 throws SharedObjectCreateException
Description copied from interface: ISharedObjectFactory
Get the known SharedObjectTypeDescription given it's name.

Specified by:
getDescriptionByName in interface ISharedObjectFactory
Returns:
SharedObjectTypeDescription found. Null if description not found.
Throws:
SharedObjectCreateException

createSharedObject

public ISharedObject createSharedObject(SharedObjectTypeDescription desc,
                                        java.lang.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

Specified by:
createSharedObject in interface ISharedObjectFactory
Parameters:
desc - the SharedObjectTypeDescription to use to create the instance
args - 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(java.lang.String descriptionName)
                                 throws SharedObjectCreateException
Description copied from interface: ISharedObjectFactory
Create ISharedObject instance. Given a SharedObjectTypeDescription name, this method will

Specified by:
createSharedObject in interface ISharedObjectFactory
Parameters:
descriptionName - the SharedObjectTypeDescription name to lookup
Returns:
a valid instance of ISharedObject. Will not be null.
Throws:
SharedObjectCreateException

createSharedObject

public ISharedObject createSharedObject(java.lang.String descriptionName,
                                        java.lang.Object[] args)
                                 throws SharedObjectCreateException
Description copied from interface: ISharedObjectFactory
Create ISharedObject instance. Given a SharedObjectTypeDescription name, this method will

Specified by:
createSharedObject in interface ISharedObjectFactory
Parameters:
descriptionName - the SharedObjectTypeDescription name to lookup
args - 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 interface ISharedObjectFactory
Parameters:
scd - the SharedObjectTypeDescription to remove
Returns:
the removed SharedObjectTypeDescription, null if nothing removed

removeDescription0

protected SharedObjectTypeDescription removeDescription0(SharedObjectTypeDescription n)