|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.core.provider.BaseContainerInstantiator org.eclipse.ecf.remoteservice.provider.RemoteServiceContainerInstantiator
public abstract class RemoteServiceContainerInstantiator
Field Summary | |
---|---|
protected static java.lang.String[] |
defaultSupportedAdapterTypes
|
protected static java.lang.String[] |
defaultSupportedIntents
|
protected static java.lang.Class[][] |
defaultSupportedParameterTypes
|
protected java.util.List<java.lang.String> |
exporterConfigs
|
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
exporterConfigToImporterConfigs
|
Fields inherited from class org.eclipse.ecf.core.provider.BaseContainerInstantiator |
---|
EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, NO_ADAPTERS_ARRAY |
Constructor Summary | |
---|---|
protected |
RemoteServiceContainerInstantiator()
|
protected |
RemoteServiceContainerInstantiator(java.util.List<java.lang.String> exporterConfigs,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> exporterConfigToImporterConfig)
|
Method Summary | |
---|---|
abstract IContainer |
createInstance(ContainerTypeDescription description,
java.util.Map<java.lang.String,?> parameters)
|
IContainer |
createInstance(ContainerTypeDescription description,
java.lang.Object[] parameters)
Create instance of IContainer. |
java.lang.String[] |
getImportedConfigs(ContainerTypeDescription description,
java.lang.String[] exporterSupportedConfigs)
Get the imported config types for a given ContainerTypeDescription for the given exporter supported config types. |
java.util.Dictionary |
getPropertiesForImportedConfigs(ContainerTypeDescription description,
java.lang.String[] importedConfigs,
java.util.Dictionary exportedProperties)
Get the properties associated with the given description, with the given importedConfigTypes, via the given exportedProperties. |
java.lang.String[] |
getSupportedAdapterTypes(ContainerTypeDescription description)
Get array of supported adapters for the given container type description. |
java.lang.String[] |
getSupportedConfigs(ContainerTypeDescription description)
Get supported configs for the given ContainerTypeDescription. |
java.lang.String[] |
getSupportedIntents(ContainerTypeDescription description)
Get supported intents for the given ContainerTypeDescription. |
java.lang.Class[][] |
getSupportedParameterTypes(ContainerTypeDescription description)
Get array of parameter types for given container type description. |
protected IContainer |
throwCreateException(java.lang.String message,
java.lang.Throwable cause)
|
Methods inherited from class org.eclipse.ecf.core.provider.BaseContainerInstantiator |
---|
getAdaptersForClass, getIntegerFromArg, getInterfacesAndAdaptersForClass, getInterfacesForClass, getInterfacesForClass, getMap, getMapParameterString, getMapParameterString, getParameterValue, getParameterValue, getParameterValue, getParameterValue, getParameterValue, getStringFromArg |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String[] defaultSupportedAdapterTypes
protected static final java.lang.Class[][] defaultSupportedParameterTypes
protected static final java.lang.String[] defaultSupportedIntents
protected java.util.List<java.lang.String> exporterConfigs
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> exporterConfigToImporterConfigs
Constructor Detail |
---|
protected RemoteServiceContainerInstantiator(java.util.List<java.lang.String> exporterConfigs, java.util.Map<java.lang.String,java.util.List<java.lang.String>> exporterConfigToImporterConfig)
protected RemoteServiceContainerInstantiator()
Method Detail |
---|
public java.lang.String[] getSupportedAdapterTypes(ContainerTypeDescription description)
IContainerInstantiator
IContainer.getAdapter(Class)
with the same type name as a
returned value will return a non-null
result. In other
words, even if the class name is in the returned array, subsequent calls
to IContainer.getAdapter(Class)
may still return
null
.
getSupportedAdapterTypes
in interface IContainerInstantiator
getSupportedAdapterTypes
in class BaseContainerInstantiator
description
- the ContainerTypeDescription to report adapters for. Must not
be null
.
null
may be returned by
the provider if no adapters are supported for this description.public java.lang.Class[][] getSupportedParameterTypes(ContainerTypeDescription description)
IContainerInstantiator
IContainerInstantiator.createInstance(ContainerTypeDescription, Object[])
.
Each of the rows of the returned array specifies a Class[] of parameter types. These parameter types correspond to the types of Object[] that can be passed into the second parameter of
IContainerInstantiator.createInstance(ContainerTypeDescription, Object[])
.
Consider the following example:
public Class[][] getSupportedParameterTypes() { return new Class[][] { { String.class }, { String.class, String.class } }; }The above means that there are two acceptable values for the Object [] passed into
IContainerInstantiator.createInstance(ContainerTypeDescription, Object[])
:
1) a single String, and 2) two Strings. These would therefore be
acceptable as input to createInstance:
IContainer container = ContainerFactory.getDefault().createContainer( description, new Object[] { "Hello" }); IContainer container2 = ContainerFactory.getDefault().createContainer( description, new Object[] { "Hello" });
getSupportedParameterTypes
in interface IContainerInstantiator
getSupportedParameterTypes
in class BaseContainerInstantiator
description
- the ContainerTypeDescription to return parameter types for
IContainerInstantiator.createInstance(ContainerTypeDescription, Object[])
.
null
returned if no parameter types supported for
given description.public java.lang.String[] getSupportedIntents(ContainerTypeDescription description)
IRemoteServiceContainerInstantiator
getSupportedIntents
in interface IContainerInstantiator
getSupportedIntents
in interface IRemoteServiceContainerInstantiator
getSupportedIntents
in class BaseContainerInstantiator
description
- the ContainerTypeDescription to return the supported intents for.
Will not be null
.
null
may be returned if the
given description does not support any intents.public java.lang.String[] getSupportedConfigs(ContainerTypeDescription description)
IRemoteServiceContainerInstantiator
getSupportedConfigs
in interface IRemoteServiceContainerInstantiator
description
- the ContainerTypeDescription to return the supported configs for.
Will not be null
.
null
may be returned if the
given description does not support any config types.public java.lang.String[] getImportedConfigs(ContainerTypeDescription description, java.lang.String[] exporterSupportedConfigs)
IRemoteServiceContainerInstantiator
Get the imported config types for a given ContainerTypeDescription for the given exporter supported config types. This method will be called to determine what the local container imported configs are for the given description and exporterSupportedConfigTypes. The local provider can decide which (if any) imported config types should be returned and return them.
As an example, consider the config types for the ECF generic provider. A generic server has a config type
of 'ecf.generic.server', and the client has 'ecf.generic.server'. If the generic server exports a given
service, the exportersSupportedConfigTypes will be '[ecf.generic.server]'. When this method is called
with the ecf.generic.client description (i.e. the container type description named 'ecf.generic.client'), it
should respond with a non-null, non-empty array...e.g.: [ecf.generic.client]. This indicates that the
ecf.generic.client can serve as an importer for the given exporter config type. All, other descriptions
should return null
, to indicate that they cannot import a remote service exported by the given
exporterSupportedConfigTypes.
getImportedConfigs
in interface IRemoteServiceContainerInstantiator
description
- the container type description under consideration.exporterSupportedConfigs
- the exporter supported config types under consideration.
null
, unless
one or more of the exporterSupportedConfigTypes is recognized for the given description.public java.util.Dictionary getPropertiesForImportedConfigs(ContainerTypeDescription description, java.lang.String[] importedConfigs, java.util.Dictionary exportedProperties)
IRemoteServiceContainerInstantiator
getPropertiesForImportedConfigs
in interface IRemoteServiceContainerInstantiator
description
- the container type description under consideration.importedConfigs
- the imported config types for the given properties. Will not be null
, and
should be the same values as returned from IRemoteServiceContainerInstantiator.getImportedConfigs(ContainerTypeDescription, String[])
.exportedProperties
- the properties from the exported service. Will not be null
.
null
if
no properties are associated with the given description, importedConfigTypes, exportedProperties.public abstract IContainer createInstance(ContainerTypeDescription description, java.util.Map<java.lang.String,?> parameters) throws ContainerCreateException
ContainerCreateException
public IContainer createInstance(ContainerTypeDescription description, java.lang.Object[] parameters) throws ContainerCreateException
IContainerInstantiator
ContainerFactory.getDefault().createContainer("foocontainer",new Object { "hello" });
createInstance
in interface IContainerInstantiator
createInstance
in class BaseContainerInstantiator
description
- the ContainerTypeDescription associated with the registered
container provider implementationparameters
- parameters specified by the caller. May be null if no
parameters are passed in by caller to
ContainerFactory.getDefault().createContainer(...)
ContainerCreateException
protected IContainer throwCreateException(java.lang.String message, java.lang.Throwable cause) throws ContainerCreateException
ContainerCreateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |