public class ContainerFactory extends Object implements IContainerFactory, IContainerManager
IContainer instances. This class provides ECF
clients an entry point to constructing IContainer instances.
IContainer container =
ContainerFactory.getDefault().createContainer("ecf.generic.client");
...further use of container here...
For more details on the creation
and lifecycle of IContainer instances created via this factory see
IContainer.IContainer,
IContainerFactory| Modifier and Type | Field and Description |
|---|---|
static String |
BASE_CONTAINER_NAME |
| Modifier | Constructor and Description |
|---|---|
protected |
ContainerFactory() |
| Modifier and Type | Method and Description |
|---|---|
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,
Map parameters)
Create a new container.
|
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
ID containerID,
Object[] parameters)
Create a new container.
|
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
Map parameters)
Create a new container.
|
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
Object[] parameters)
Create a new container.
|
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
String containerId)
Create a new container.
|
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
String containerId,
Map parameters)
Create a new container.
|
IContainer |
createContainer(ContainerTypeDescription containerTypeDescription,
String containerId,
Object[] parameters)
Create a new container.
|
IContainer |
createContainer(ID containerID)
Create a new container.
|
IContainer |
createContainer(String containerTypeDescriptionName)
Create a new container.
|
IContainer |
createContainer(String containerTypeDescriptionName,
ID containerID)
Create a new container.
|
IContainer |
createContainer(String containerTypeDescriptionName,
ID containerID,
Map parameters)
Create a new container.
|
IContainer |
createContainer(String containerTypeDescriptionName,
ID containerID,
Object[] parameters)
Create a new container.
|
IContainer |
createContainer(String containerTypeDescriptionName,
Map parameters)
Create a new container.
|
IContainer |
createContainer(String containerTypeDescriptionName,
Object[] parameters)
Create a new container.
|
IContainer |
createContainer(String containerTypeDescriptionName,
String containerId)
Create a new container.
|
IContainer |
createContainer(String containerTypeDescriptionName,
String containerId,
Map parameters)
Create a new container.
|
IContainer |
createContainer(String containerTypeDescriptionName,
String containerId,
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(String containerTypeDescriptionName) |
ContainerTypeDescription |
getDescriptionByName(String containerTypeDescriptionName)
Get the known ContainerTypeDescription given it's name.
|
List |
getDescriptions()
Get a collection of the ContainerDescriptions currently known to this
factory.
|
protected List |
getDescriptions0() |
ContainerTypeDescription[] |
getDescriptionsForContainerAdapter(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(String message,
Throwable cause,
String method) |
public static final String BASE_CONTAINER_NAME
public static IContainerFactory getDefault()
public ContainerTypeDescription addDescription(ContainerTypeDescription containerTypeDescription)
IContainerFactoryaddDescription in interface IContainerFactorycontainerTypeDescription - the ContainerTypeDescription to add to this factory. Must not
be null.public List getDescriptions()
IContainerFactorygetDescriptions in interface IContainerFactoryprotected List getDescriptions0()
protected ContainerTypeDescription addDescription0(ContainerTypeDescription containerTypeDescription)
public boolean containsDescription(ContainerTypeDescription containerTypeDescription)
IContainerFactorycontainsDescription in interface IContainerFactorycontainerTypeDescription - the ContainerTypeDescription to look forprotected boolean containsDescription0(ContainerTypeDescription containerTypeDescription)
protected ContainerTypeDescription getDescription0(ContainerTypeDescription containerTypeDescription)
protected ContainerTypeDescription getDescription0(String containerTypeDescriptionName)
public ContainerTypeDescription getDescriptionByName(String containerTypeDescriptionName)
IContainerFactorygetDescriptionByName in interface IContainerFactorycontainerTypeDescriptionName - the name to use as key to find ContainerTypeDescription. Must not be null.public ContainerTypeDescription removeDescription(ContainerTypeDescription containerTypeDescription)
IContainerFactoryremoveDescription in interface IContainerFactorycontainerTypeDescription - the ContainerTypeDescription to removeprotected ContainerTypeDescription removeDescription0(ContainerTypeDescription containerTypeDescription)
public ContainerTypeDescription[] getDescriptionsForContainerAdapter(Class containerAdapter)
IContainerFactorygetDescriptionsForContainerAdapter in interface IContainerFactorycontainerAdapter - the container adapter. Must not be null.protected void throwContainerCreateException(String message, Throwable cause, String method) throws ContainerCreateException
ContainerCreateExceptionpublic IContainer createContainer() throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorynull instance will be returned.ContainerCreateException - if some problem creating the instance.public IContainer createContainer(ID containerID) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerID - 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
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescription - the ContainerTypeDescription to use. Must not be null.null.ContainerCreateException - if some problem creating the instance.public IContainer createContainer(String containerTypeDescriptionName) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescriptionName - the ContainerTypeDescription name to lookup. Must not be null.null.ContainerCreateException - if cannot create container of given namepublic IContainer createContainer(ContainerTypeDescription containerTypeDescription, Object[] parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescription - 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(String containerTypeDescriptionName, Object[] parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescriptionName - 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, Object[] parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescription - 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(String containerTypeDescriptionName, ID containerID, Object[] parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescriptionName - 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
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescription - 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(String containerTypeDescriptionName, ID containerID) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescriptionName - 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(String containerTypeDescriptionName, String containerId) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescriptionName - 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(String containerTypeDescriptionName, String containerId, Object[] parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescriptionName - 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, String containerId) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescription - 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, String containerId, Object[] parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescription - 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()
IContainerManagergetAllContainers in interface IContainerManagernull, but may
return empty IContainer[].public IContainer getContainer(ID containerID)
IContainerManagercontainerID is
null then null will be returned. If
active container with given containerID, is not known to this container manager,
then null will also be returned.getContainer in interface IContainerManagercontainerID - the ID of the container instance to retrieve from this manager. If null
null will be returned.containerID. Will be null if there
is no container with given ID known to this container manager.public boolean hasContainer(ID containerID)
IContainerManagerhasContainer in interface IContainerManagercontainerID - the ID of the container to find. If null this
method returns false.public boolean addListener(IContainerManagerListener listener)
IContainerManagerIContainerManager.addListener in interface IContainerManagerlistener - the listener to add. Must not be null.public boolean removeListener(IContainerManagerListener listener)
IContainerManagerIContainerManager.removeListener in interface IContainerManagerlistener - the listener to remove. Must not be null.public IContainer addContainer(IContainer container, ContainerTypeDescription typeDescription)
IContainerManageraddContainer in interface IContainerManagercontainer - 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)
IContainerManagerremoveContainer in interface IContainerManagercontainer - the container to remove. Must not be null.null will be returned.public IContainer removeContainer(ID containerID)
IContainerManagerremoveContainer in interface IContainerManagercontainerID - the ID of the container to remove. Must not be null.null will be returned.public ContainerTypeDescription getContainerTypeDescription(ID containerID)
IContainerManagergetContainerTypeDescription in interface IContainerManagercontainerID - 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()
IContainerManagergetContainerFactory in interface IContainerManagernull.public void removeAllContainers()
IContainerManagerremoveAllContainers in interface IContainerManagerpublic IContainer createContainer(ContainerTypeDescription containerTypeDescription, ID containerID, Map parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescription - 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, String containerId, Map parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescription - 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(String containerTypeDescriptionName, ID containerID, Map parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescriptionName - 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(String containerTypeDescriptionName, String containerId, Map parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescriptionName - 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, Map parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescription - 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(String containerTypeDescriptionName, Map parameters) throws ContainerCreateException
IContainerFactorycreateContainer in interface IContainerFactorycontainerTypeDescriptionName - 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.Copyright © 2004–2020 Eclipse Foundation. All rights reserved.