|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.core.ContainerFactory
public class ContainerFactory
Factory for creating IContainer
instances. This class provides ECF
clients an entry point to constructing IContainer
instances.
Here is an example use of the ContainerFactory to construct an instance of
the 'standalone' container (has no connection to other containers):
IContainer container =
For more details on the creation
and lifecycle of IContainer instances created via this factory see
ContainerFactory.getDefault().createContainer("ecf.generic.client");
...further use of container here...
IContainer
.
IContainer
,
IContainerFactory
Field Summary | |
---|---|
static java.lang.String |
BASE_CONTAINER_NAME
|
Constructor Summary | |
---|---|
protected |
ContainerFactory()
|
Method Summary | |
---|---|
IContainer |
addContainer(IContainer container,
ContainerTypeDescription typeDescription)
Add given container to manager. |
ContainerTypeDescription |
addDescription(ContainerTypeDescription containerTypeDescription)
Add a ContainerTypeDescription to the set of known ContainerDescriptions. |
protected ContainerTypeDescription |
addDescription0(ContainerTypeDescription containerTypeDescription)
|
boolean |
addListener(IContainerManagerListener listener)
Add listener to this IContainerManager . |
boolean |
containsDescription(ContainerTypeDescription containerTypeDescription)
Check to see if a given named description is already contained by this factory |
protected boolean |
containsDescription0(ContainerTypeDescription containerTypeDescription)
|
IContainer |
createContainer()
Make a base IContainer instance. |
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription)
Create a new container. |
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
ID containerID)
Create a new container. |
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
ID containerID,
java.util.Map parameters)
Create a new container. |
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
ID containerID,
java.lang.Object[] parameters)
Create a new container. |
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
java.util.Map parameters)
Create a new container. |
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
java.lang.Object[] parameters)
Create a new container. |
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
java.lang.String containerId)
Create a new container. |
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
java.lang.String containerId,
java.util.Map parameters)
Create a new container. |
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
java.lang.String containerId,
java.lang.Object[] parameters)
Create a new container. |
IContainer |
createContainer(ID containerID)
Create a new container. |
IContainer |
createContainer(java.lang.String containerTypeDescriptionName)
Create a new container. |
IContainer |
createContainer(java.lang.String containerTypeDescriptionName,
ID containerID)
Create a new container. |
IContainer |
createContainer(java.lang.String containerTypeDescriptionName,
ID containerID,
java.util.Map parameters)
Create a new container. |
IContainer |
createContainer(java.lang.String containerTypeDescriptionName,
ID containerID,
java.lang.Object[] parameters)
Create a new container. |
IContainer |
createContainer(java.lang.String containerTypeDescriptionName,
java.util.Map parameters)
Create a new container. |
IContainer |
createContainer(java.lang.String containerTypeDescriptionName,
java.lang.Object[] parameters)
Create a new container. |
IContainer |
createContainer(java.lang.String containerTypeDescriptionName,
java.lang.String containerId)
Create a new container. |
IContainer |
createContainer(java.lang.String containerTypeDescriptionName,
java.lang.String containerId,
java.util.Map parameters)
Create a new container. |
IContainer |
createContainer(java.lang.String containerTypeDescriptionName,
java.lang.String containerId,
java.lang.Object[] parameters)
Create a new container. |
IContainer[] |
getAllContainers()
Get all containers known to this container manager. |
IContainer |
getContainer(ID containerID)
Get container for given ID. |
IContainerFactory |
getContainerFactory()
Get container factory associated with this container manager. |
ContainerTypeDescription |
getContainerTypeDescription(ID containerID)
Get the container type description used to create the container with the given ID. |
static IContainerFactory |
getDefault()
|
protected ContainerTypeDescription |
getDescription0(ContainerTypeDescription containerTypeDescription)
|
protected ContainerTypeDescription |
getDescription0(java.lang.String containerTypeDescriptionName)
|
ContainerTypeDescription |
getDescriptionByName(java.lang.String containerTypeDescriptionName)
Get the known ContainerTypeDescription given it's name. |
java.util.List |
getDescriptions()
Get a collection of the ContainerDescriptions currently known to this factory. |
protected java.util.List |
getDescriptions0()
|
ContainerTypeDescription[] |
getDescriptionsForContainerAdapter(java.lang.Class containerAdapter)
Get container type descriptions that support the given containerAdapter |
boolean |
hasContainer(ID containerID)
Return true if this container manager has the given container under management, false otherwise. |
void |
removeAllContainers()
Remove all containers from this manager |
IContainer |
removeContainer(IContainer container)
Remove given container from manager. |
IContainer |
removeContainer(ID containerID)
Remove given container from manager. |
ContainerTypeDescription |
removeDescription(ContainerTypeDescription containerTypeDescription)
Remove given description from set known to this factory. |
protected ContainerTypeDescription |
removeDescription0(ContainerTypeDescription containerTypeDescription)
|
boolean |
removeListener(IContainerManagerListener listener)
Remove listener from this IContainerManager . |
protected void |
throwContainerCreateException(java.lang.String message,
java.lang.Throwable cause,
java.lang.String method)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BASE_CONTAINER_NAME
Constructor Detail |
---|
protected ContainerFactory()
Method Detail |
---|
public static IContainerFactory getDefault()
public ContainerTypeDescription addDescription(ContainerTypeDescription containerTypeDescription)
IContainerFactory
addDescription
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to add to this factory. Must not
be null
.
public java.util.List getDescriptions()
IContainerFactory
getDescriptions
in interface IContainerFactory
protected java.util.List getDescriptions0()
protected ContainerTypeDescription addDescription0(ContainerTypeDescription containerTypeDescription)
public boolean containsDescription(ContainerTypeDescription containerTypeDescription)
IContainerFactory
containsDescription
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to look for
protected boolean containsDescription0(ContainerTypeDescription containerTypeDescription)
protected ContainerTypeDescription getDescription0(ContainerTypeDescription containerTypeDescription)
protected ContainerTypeDescription getDescription0(java.lang.String containerTypeDescriptionName)
public ContainerTypeDescription getDescriptionByName(java.lang.String containerTypeDescriptionName)
IContainerFactory
getDescriptionByName
in interface IContainerFactory
containerTypeDescriptionName
- the name to use as key to find ContainerTypeDescription. Must not be null
.
public ContainerTypeDescription removeDescription(ContainerTypeDescription containerTypeDescription)
IContainerFactory
removeDescription
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to remove
protected ContainerTypeDescription removeDescription0(ContainerTypeDescription containerTypeDescription)
public ContainerTypeDescription[] getDescriptionsForContainerAdapter(java.lang.Class containerAdapter)
IContainerFactory
getDescriptionsForContainerAdapter
in interface IContainerFactory
containerAdapter
- the container adapter. Must not be null.
protected void throwContainerCreateException(java.lang.String message, java.lang.Throwable cause, java.lang.String method) throws ContainerCreateException
ContainerCreateException
public IContainer createContainer() throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
null
instance will be returned.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(ID containerID) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerID
- the container's new ID. Must not be null
.
null
. instance will be returned.
ContainerCreateException
- if some problem creating a base IContainer instance.public IContainer createContainer(ContainerTypeDescription containerTypeDescription) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to use. Must not be null
.
null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(java.lang.String containerTypeDescriptionName) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescriptionName
- the ContainerTypeDescription name to lookup. Must not be null
.
null
.
ContainerCreateException
public IContainer createContainer(ContainerTypeDescription containerTypeDescription, java.lang.Object[] parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to use to create the instance. Must not be null
.parameters
- an Object [] of parameters passed to the createInstance method
of the IContainerInstantiator. May be null
.
null
instance will be returned.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(java.lang.String containerTypeDescriptionName, java.lang.Object[] parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescriptionName
- the ContainerTypeDescription name to lookup. Must not be null
.parameters
- the Object [] of parameters passed to the
IContainerInstantiator.createInstance method. May be null
.
null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(ContainerTypeDescription containerTypeDescription, ID containerID, java.lang.Object[] parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to use to create the instance. Must not be null
.containerID
- the container's new ID. May be null
.parameters
- an Object [] of parameters passed to the createInstance method
of the IContainerInstantiator. May be null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(java.lang.String containerTypeDescriptionName, ID containerID, java.lang.Object[] parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescriptionName
- the ContainerTypeDescription name to lookup. Must not be null
.containerID
- the new container's id. May be null
.parameters
- the Object [] of parameters passed to the
IContainerInstantiator.createInstance method. May be null
.
null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(ContainerTypeDescription containerTypeDescription, ID containerID) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to lookup. Must not be null
.containerID
- the new container's id. May be null
.
null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(java.lang.String containerTypeDescriptionName, ID containerID) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescriptionName
- the ContainerTypeDescription name to lookup. Must not be null
.containerID
- the new container's id. May be null
.
null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(java.lang.String containerTypeDescriptionName, java.lang.String containerId) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescriptionName
- the ContainerTypeDescription name to use to create the instance. Must not be null
.containerId
- the container's new ID. May be null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(java.lang.String containerTypeDescriptionName, java.lang.String containerId, java.lang.Object[] parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescriptionName
- the ContainerTypeDescription name to use to create the instance. Must not be null
.containerId
- the container's new ID. May be null
.parameters
- an Object [] of parameters passed to the createInstance method
of the IContainerInstantiator. May be null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(ContainerTypeDescription containerTypeDescription, java.lang.String containerId) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to use to create the instance. Must not be null
.containerId
- the container's new ID. May be null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(ContainerTypeDescription containerTypeDescription, java.lang.String containerId, java.lang.Object[] parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to use to create the instance. Must not be null
.containerId
- the container's new ID. May be null
.parameters
- an Object [] of parameters passed to the createInstance method
of the IContainerInstantiator. May be null
.
ContainerCreateException
- if some problem creating the instance.public IContainer[] getAllContainers()
IContainerManager
getAllContainers
in interface IContainerManager
null
, but may
return empty IContainer[].public IContainer getContainer(ID containerID)
IContainerManager
containerID
is
, null will be returned. If
active container with given containerID,
is not known to this container manager,
then null
will also be returned.
- Specified by:
getContainer
in interface IContainerManager
- Parameters:
containerID
- the ID of the container instance to retrieve from this manager. If null
null
will be returned.
- Returns:
- IContainer instance with given
containerID
. Will be null
if there
is no container with given ID known to this container manager.
public boolean hasContainer(ID containerID)
IContainerManager
hasContainer
in interface IContainerManager
containerID
- the ID of the container to find. If null
this
method returns false.
public boolean addListener(IContainerManagerListener listener)
IContainerManager
IContainerManager
.
addListener
in interface IContainerManager
listener
- the listener to add. Must not be null
.
public boolean removeListener(IContainerManagerListener listener)
IContainerManager
IContainerManager
.
removeListener
in interface IContainerManager
listener
- the listener to remove. Must not be null
.
public IContainer addContainer(IContainer container, ContainerTypeDescription typeDescription)
IContainerManager
addContainer
in interface IContainerManager
container
- to add. Must not be null
. Also
container.getID()
must return a non-null
value. If container.getID()
returns
null
then this method will throw a
NullPointerException
.typeDescription
- the container type description used to create the given container. Must not be null
.
public IContainer removeContainer(IContainer container)
IContainerManager
removeContainer
in interface IContainerManager
container
- the container to remove. Must not be null
.
null
will be returned.public IContainer removeContainer(ID containerID)
IContainerManager
removeContainer
in interface IContainerManager
containerID
- the ID of the container to remove. Must not be null
.
null
will be returned.public ContainerTypeDescription getContainerTypeDescription(ID containerID)
IContainerManager
getContainerTypeDescription
in interface IContainerManager
containerID
- the ID of the container to get the description for.
null
if no container with the given containerID exists under this manager.public IContainerFactory getContainerFactory()
IContainerManager
getContainerFactory
in interface IContainerManager
null
.public void removeAllContainers()
IContainerManager
removeAllContainers
in interface IContainerManager
public IContainer createContainer(ContainerTypeDescription containerTypeDescription, ID containerID, java.util.Map parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to use to create the instance. Must not be null
.containerID
- the container's new ID. Must not be null
.parameters
- a Map of parameters (name/value pairs) passed to the createInstance method
of the IContainerInstantiator. May be null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(ContainerTypeDescription containerTypeDescription, java.lang.String containerId, java.util.Map parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to use to create the instance. Must not be null
.containerId
- the container's new ID. May be null
.parameters
- a Map of parameters (name/value pairs) passed to the createInstance method
of the IContainerInstantiator. May be null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(java.lang.String containerTypeDescriptionName, ID containerID, java.util.Map parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescriptionName
- the ContainerTypeDescription name to lookup. Must not be null
.containerID
- the container's new ID. May be null
.parameters
- a Map of parameters (name/value pairs) passed to the createInstance method
of the IContainerInstantiator. May be null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(java.lang.String containerTypeDescriptionName, java.lang.String containerId, java.util.Map parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescriptionName
- the ContainerTypeDescription name to lookup. Must not be null
.containerId
- the container's new ID. May be null
.parameters
- a Map of parameters (name/value pairs) passed to the createInstance method
of the IContainerInstantiator. May be null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(ContainerTypeDescription containerTypeDescription, java.util.Map parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescription
- the ContainerTypeDescription to use to create the instance. Must not be null
.parameters
- a Map of parameters (name/value pairs) passed to the createInstance method
of the IContainerInstantiator. May be null
.
ContainerCreateException
- if some problem creating the instance.public IContainer createContainer(java.lang.String containerTypeDescriptionName, java.util.Map parameters) throws ContainerCreateException
IContainerFactory
createContainer
in interface IContainerFactory
containerTypeDescriptionName
- the ContainerTypeDescription name to lookup. Must not be null
.parameters
- a Map of parameters (name/value pairs) passed to the createInstance method
of the IContainerInstantiator. May be null
.
ContainerCreateException
- if some problem creating the instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |