Package org.eclipse.ecf.core.sharedobject

## Interface ISharedObjectFactory

All Known Implementing Classes:
  `SharedObjectFactory`

    public interface ISharedObjectFactory

Container factory contract `SharedObjectFactory` for default implementation.

### Method Summary

All Methods Instance Methods Abstract Methods
`SharedObjectTypeDescription` `addDescription​(SharedObjectTypeDescription description)`
`boolean` `containsDescription​(SharedObjectTypeDescription description)` Check to see if a given named description is already contained by this factory
`ISharedObject` `createSharedObject​(String descriptionName)` Create ISharedObject instance.
`ISharedObject` `createSharedObject​(String descriptionName, Object[] args)` Create ISharedObject instance.
`ISharedObject` `createSharedObject​(SharedObjectTypeDescription typeDescription, Object[] args)` Create ISharedObject instance.
`SharedObjectTypeDescription` `getDescriptionByName​(String name)` Get the known SharedObjectTypeDescription given it's name.
`List` `getDescriptions()` Get a collection of the SharedObjectTypeDescriptions currently known to this factory.
`SharedObjectTypeDescription` `removeDescription​(SharedObjectTypeDescription scd)` Remove given description from set known to this factory.

### Method Detail

#### addDescription

    SharedObjectTypeDescription addDescription​(SharedObjectTypeDescription description)

#### getDescriptions

    List getDescriptions()

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.

Returns:
  List of SharedObjectTypeDescription instances. Will not be null.

#### containsDescription

    boolean containsDescription​(SharedObjectTypeDescription description)

Check to see if a given named description is already contained by this factory

Parameters:
  `description` - the SharedObjectTypeDescription to look for
Returns:
  true if description is already known to factory, false otherwise

#### getDescriptionByName

    SharedObjectTypeDescription getDescriptionByName​(String name)
                                              throws SharedObjectCreateException

Get the known SharedObjectTypeDescription given it's name.

Parameters:
  `name` -
Returns:
  SharedObjectTypeDescription found. Null if description not found.
Throws:
  `SharedObjectCreateException`

#### createSharedObject

    ISharedObject createSharedObject​(SharedObjectTypeDescription typeDescription,
                                     Object[] args)
                              throws SharedObjectCreateException

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

Parameters:
  `typeDescription` - 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

    ISharedObject createSharedObject​(String descriptionName)
                              throws SharedObjectCreateException

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

Parameters:
  `descriptionName` - the SharedObjectTypeDescription name to lookup
Returns:
  a valid instance of ISharedObject. Will not be null.
Throws:
  `SharedObjectCreateException`

#### createSharedObject

    ISharedObject createSharedObject​(String descriptionName,
                                     Object[] args)
                              throws SharedObjectCreateException

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

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

    SharedObjectTypeDescription removeDescription​(SharedObjectTypeDescription scd)

Remove given description from set known to this factory.

Parameters:
  `scd` - the SharedObjectTypeDescription to remove
Returns:
  the removed SharedObjectTypeDescription, null if nothing removed