org.eclipse.ecf.server.generic
Interface IGenericServerContainerGroup

All Known Implementing Classes:
GenericServerContainerGroup

public interface IGenericServerContainerGroup

Generic server container group. Instances of this type are returned from using the IGenericServerContainerGroupFactory service.

Since:
4.0

Field Summary
static int DEFAULT_KEEPALIVE
           
 
Method Summary
 void close()
          Close this generic server container group.
 ISharedObjectContainer createContainer(java.lang.String path)
          Create a shared object container within this container group, given a path, a keepAlive value, and a Map of properties that will be provided to the created container.
 ISharedObjectContainer createContainer(java.lang.String path, int keepAlive)
          Create a shared object container within this container group, given a path, a keepAlive value, and a Map of properties that will be provided to the created container.
 ISharedObjectContainer createContainer(java.lang.String path, int keepAlive, java.util.Map properties)
          Create a shared object container within this container group, given a path, a keepAlive value, and a Map of properties that will be provided to the created container.
 ISharedObjectContainer getContainer(java.lang.String path)
          Get the container instance associated with the given path.
 java.util.Map getContainers()
          Get a map (String->ISharedObjectContainer) of the path->containers previously created.
 java.net.URI getGroupEndpoint()
          Get the URI for the group endpoint.
 boolean isListening()
          Returns true if this container group previously started listening via a successful call to startListening()).
 ISharedObjectContainer removeContainer(java.lang.String path)
          Remove previously created container with given path.
 void startListening()
          Start listening on the port given to this generic server container group upon creation.
 void stopListening()
          Stop listening on port given to this generic server container group upon creation.
 

Field Detail

DEFAULT_KEEPALIVE

static final int DEFAULT_KEEPALIVE
See Also:
Constant Field Values
Method Detail

getGroupEndpoint

java.net.URI getGroupEndpoint()
Get the URI for the group endpoint. For

Returns:
uri that is the group endpoint. For example uri='ecftcp://localhost:3282'

createContainer

ISharedObjectContainer createContainer(java.lang.String path,
                                       int keepAlive,
                                       java.util.Map properties)
                                       throws ContainerCreateException
Create a shared object container within this container group, given a path, a keepAlive value, and a Map of properties that will be provided to the created container.

Parameters:
path - the uri path suffix for defining the container's identity. For example, if getGroupEndpoint() returns 'ecftcp://localhost:3282', and a path of '/server' is used to create a new container, then the container's id will be 'ecftcp://localhost:3282/server'. Must not be null.
keepAlive - a value (in milliseconds) that defines the keepAlive for the resulting container.
properties - to be associated to the returned container upon instantiation.
Returns:
shared object container. Will not be null.
Throws:
ContainerCreateException - if container with given path, keepAlive, and properties could not be created.

createContainer

ISharedObjectContainer createContainer(java.lang.String path,
                                       int keepAlive)
                                       throws ContainerCreateException
Create a shared object container within this container group, given a path, a keepAlive value, and a Map of properties that will be provided to the created container.

Parameters:
path - the uri path suffix for defining the container's identity. For example, if getGroupEndpoint() returns 'ecftcp://localhost:3282', and a path of '/server' is used to create a new container, then the container's id will be 'ecftcp://localhost:3282/server'. Must not be null.
keepAlive - a value (in milliseconds) that defines the keepAlive for the resulting container.
Returns:
shared object container. Will not be null.
Throws:
ContainerCreateException - if container with given path, keepAlive, and properties could not be created.
Since:
5.0

createContainer

ISharedObjectContainer createContainer(java.lang.String path)
                                       throws ContainerCreateException
Create a shared object container within this container group, given a path, a keepAlive value, and a Map of properties that will be provided to the created container.

Parameters:
path - the uri path suffix for defining the container's identity. For example, if getGroupEndpoint() returns 'ecftcp://localhost:3282', and a path of '/server' is used to create a new container, then the container's id will be 'ecftcp://localhost:3282/server'. Must not be null.
Returns:
shared object container. Will not be null.
Throws:
ContainerCreateException - if container with given path, keepAlive, and properties could not be created.
Since:
5.0

getContainer

ISharedObjectContainer getContainer(java.lang.String path)
Get the container instance associated with the given path.

Parameters:
path - of the container to return. Must not be null.
Returns:
the previously created shared object container associated with the given path.

getContainers

java.util.Map getContainers()
Get a map (String->ISharedObjectContainer) of the path->containers previously created.

Returns:
map of the path->container map for this generic server container group. Will not return null, but may return a Map of size==0.

removeContainer

ISharedObjectContainer removeContainer(java.lang.String path)
Remove previously created container with given path.

Parameters:
path - of the shared object container to remove.
Returns:
shared object container removed. If no shared object container was previously created with the given path, then null will be returned.

startListening

void startListening()
                    throws java.io.IOException
Start listening on the port given to this generic server container group upon creation.

Throws:
java.io.IOException - if the server port cannot be opened for listening.
See Also:
IGenericServerContainerGroupFactory.createContainerGroup(String, int, Map)

isListening

boolean isListening()
Returns true if this container group previously started listening via a successful call to startListening()).

Returns:
true if currently listening, false otherwise.

stopListening

void stopListening()
Stop listening on port given to this generic server container group upon creation.


close

void close()
Close this generic server container group. This method will:
  1. iterate through all containers created via createContainer(String, int, Map) within this group, and for each one:
    1. remove it from the set of containers within this group
    2. call IContainer.dispose()
  2. stop listening on the port given to this generic server container group upon creation.