Package org.eclipse.ecf.osgi.services.remoteserviceadmin

## Class AbstractContainerSelector

- java.lang.Object
- - org.eclipse.ecf.osgi.services.remoteserviceadmin.AbstractContainerSelector

Direct Known Subclasses:
  `AbstractConsumerContainerSelector`, `AbstractHostContainerSelector`

    public abstract class AbstractContainerSelector
    extends Object

Abstract superclass for both host and consumer container selectors...i.e. implementers of `IHostContainerSelector` or `IConsumerContainerSelector`.

### Field Summary

Fields
`static IRemoteServiceContainer[]` `EMPTY_REMOTE_SERVICE_CONTAINER_ARRAY`

### Constructor Summary

Constructors
`AbstractContainerSelector()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `connectContainer​(IContainer container, ID connectTargetID, IConnectContext connectContext)`
`protected IConnectContext` `createConnectContext​(ServiceReference serviceReference, Map<String,​Object> properties, IContainer container, Object context)`
`protected IContainer` `createContainer​(ServiceReference serviceReference, Map<String,​Object> properties, ContainerTypeDescription containerTypeDescription)`
`protected IContainer` `createContainer​(ServiceReference serviceReference, Map<String,​Object> properties, ContainerTypeDescription containerTypeDescription, String[] intents)`
`protected ID` `createTargetID​(IContainer container, String target)`
`protected void` `disconnectContainer​(IContainer container)`
`protected IContainerFactory` `getContainerFactory()`
`protected Object` `getContainerFactoryArguments​(ServiceReference serviceReference, Map<String,​Object> properties, ContainerTypeDescription containerTypeDescription)`
`protected Object` `getContainerFactoryArguments​(ServiceReference serviceReference, Map<String,​Object> properties, ContainerTypeDescription containerTypeDescription, String[] intents)`
`protected IContainerManager` `getContainerManager()`
`protected IContainer[]` `getContainers()`
`protected ContainerTypeDescription` `getContainerTypeDescription​(IContainer container)`
`protected ContainerTypeDescription[]` `getContainerTypeDescriptions()`
`protected IRemoteServiceContainer[]` `getRemoteServiceContainers​(IContainer[] containers)`
`protected String[]` `getSupportedConfigTypes​(ContainerTypeDescription containerTypeDescription)`
`protected String[]` `getSupportedIntents​(ContainerTypeDescription containerTypeDescription)`
`protected IRemoteServiceContainerAdapter` `hasRemoteServiceContainerAdapter​(IContainer container)`
`protected boolean` `includeContainerWithConnectNamespace​(IContainer container, String connectNamespaceName)`
`protected void` `logError​(String methodName, String message)`
`protected void` `logError​(String methodName, String message, Throwable t)`
`protected void` `logException​(String string, Exception e)`
`protected void` `logWarning​(String methodName, String message)`
`protected boolean` `matchConnectNamespace​(IContainer container, ID endpointID, ID connectTargetID)`
`protected boolean` `matchContainerID​(IContainer container, ID endpointID)`
`protected void` `trace​(String methodName, String message)`
`protected void` `traceException​(String methodName, String message, Throwable t)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### EMPTY_REMOTE_SERVICE_CONTAINER_ARRAY

    public static final IRemoteServiceContainer[] EMPTY_REMOTE_SERVICE_CONTAINER_ARRAY

### Constructor Detail

#### AbstractContainerSelector

    public AbstractContainerSelector()

### Method Detail

#### getContainerManager

    protected IContainerManager getContainerManager()

#### getContainerFactory

    protected IContainerFactory getContainerFactory()

#### getContainerTypeDescriptions

    protected ContainerTypeDescription[] getContainerTypeDescriptions()

#### getContainers

    protected IContainer[] getContainers()

#### hasRemoteServiceContainerAdapter

    protected IRemoteServiceContainerAdapter hasRemoteServiceContainerAdapter​(IContainer container)

#### getContainerTypeDescription

    protected ContainerTypeDescription getContainerTypeDescription​(IContainer container)

#### getRemoteServiceContainers

    protected IRemoteServiceContainer[] getRemoteServiceContainers​(IContainer[] containers)

#### includeContainerWithConnectNamespace

    protected boolean includeContainerWithConnectNamespace​(IContainer container,
                                                           String connectNamespaceName)

#### connectContainer

    protected void connectContainer​(IContainer container,
                                    ID connectTargetID,
                                    IConnectContext connectContext)
                             throws ContainerConnectException

Throws:
  `ContainerConnectException`

#### getSupportedConfigTypes

    protected String[] getSupportedConfigTypes​(ContainerTypeDescription containerTypeDescription)

#### getSupportedIntents

    protected String[] getSupportedIntents​(ContainerTypeDescription containerTypeDescription)

#### createContainer

    protected IContainer createContainer​(ServiceReference serviceReference,
                                         Map<String,​Object> properties,
                                         ContainerTypeDescription containerTypeDescription)
                                  throws SelectContainerException

Parameters:
  `serviceReference` - serviceReference
  `properties` - overriding properties
  `containerTypeDescription` - containerTypeDescription
Returns:
  IContainer created container. Should not be `null`
Throws:
  `SelectContainerException` - thrown if some create or configure failure
Since:
  2.0

#### createContainer

    protected IContainer createContainer​(ServiceReference serviceReference,
                                         Map<String,​Object> properties,
                                         ContainerTypeDescription containerTypeDescription,
                                         String[] intents)
                                  throws SelectContainerException

Parameters:
  `serviceReference` - serviceReference
  `properties` - overriding properties
  `containerTypeDescription` - containerTypeDescription
  `intents` - intents
Returns:
  IContainer created container. May be null if instance cannot be created (e.g. because of intent requirements)
Throws:
  `SelectContainerException` - thrown if some create or configure failure
Since:
  4.6

#### getContainerFactoryArguments

    protected Object getContainerFactoryArguments​(ServiceReference serviceReference,
                                                  Map<String,​Object> properties,
                                                  ContainerTypeDescription containerTypeDescription)

Parameters:
  `serviceReference` - serviceReference
  `properties` - overriding properties
  `containerTypeDescription` - containerTypeDescription
Returns:
  Object container factory arguments to use
Since:
  2.0

#### getContainerFactoryArguments

    protected Object getContainerFactoryArguments​(ServiceReference serviceReference,
                                                  Map<String,​Object> properties,
                                                  ContainerTypeDescription containerTypeDescription,
                                                  String[] intents)

Parameters:
  `serviceReference` - serviceReference
  `properties` - overriding properties
  `containerTypeDescription` - containerTypeDescription
  `intents` - intents
Returns:
  Object container factory arguments to use
Since:
  4.6

#### createTargetID

    protected ID createTargetID​(IContainer container,
                                String target)

#### disconnectContainer

    protected void disconnectContainer​(IContainer container)

#### createConnectContext

    protected IConnectContext createConnectContext​(ServiceReference serviceReference,
                                                   Map<String,​Object> properties,
                                                   IContainer container,
                                                   Object context)

Parameters:
  `serviceReference` - serviceReference
  `properties` - overriding properties
  `container` - the container to create connect context for
  `context` - a possible connect context]
Returns:
  IConnectContext a connect context or null
Since:
  2.0

#### logException

    protected void logException​(String string,
                                Exception e)

#### trace

    protected void trace​(String methodName,
                         String message)

#### traceException

    protected void traceException​(String methodName,
                                  String message,
                                  Throwable t)

#### logError

    protected void logError​(String methodName,
                            String message,
                            Throwable t)

#### logError

    protected void logError​(String methodName,
                            String message)

#### logWarning

    protected void logWarning​(String methodName,
                              String message)

#### matchConnectNamespace

    protected boolean matchConnectNamespace​(IContainer container,
                                            ID endpointID,
                                            ID connectTargetID)

#### matchContainerID

    protected boolean matchContainerID​(IContainer container,
                                       ID endpointID)