Openwings API Documentation (v1.0)

net.openwings.container
Interface ContainerManager

All Superinterfaces:
Container

public interface ContainerManager
extends Container

This interface provides the external interface by which the computing resources of a platform can be accessed. This interface extends Container, adding methods that provide identifying information for a platform and descriptions of processes which can be run on the platform.

In addition to extending the Container interface by adding new methods, ContainerManager has slightly different semantics for some of the methods it inherits from Container.

This method is used to obtain performance reports for the ContainerManager. This method returns an array of PerformanceReport objects that describe the current loading of the platform. This array must include a PerformanceReport for every CPU and network interface on the platform. Subsequent reports are implementation-defined. The ContainerManager is not required to generate updated performance reports during execution of this method, only to report the most recent performance statistics it has gathered. A RemoteException is thrown if there is an error communicating with the ContainerManager.

In addition to the Container interface semantics, a ContainerManager can create process objects for non-Java processes. Additionally, the ContainerManager should only accept the same descriptors that it returns from getRunnableProcesses. Attempting to create a process with an unknown or modified descriptors should result in a ProcessCreationException

In addition to the Container interface semantics, a ContainerManager can return process objects for non-Java processes. The container should return objects representing Java processes with the following states (defined in ContainerProcessStatus): CREATED, STARTED, FAILED, and MOVED_CONTAINER.

In addition to the Container interface semantics, a ContainerManager can return process status for non-Java processes.

In addition to the Container interface semantics, a ContainerManagerListener can be registered with a ContainerManager, since ContainerManagerListener extends ContainerListener.

In addition to the Container interface semantics, a ContainerManagerListener can be unregistered from a ContainerManager, since ContainerManagerListener extends ContainerListener. In addition to the Container interface semantics, the ContainerManager uses the value of componentDescriptor.getSharedContainerHint() to determine whether the process should be started in a shared container.


Method Summary
 ContainerProcess createProcess(UniqueID componentID)
          This method creates a process inside the container manager based on the unique identifier of a ComponentDescriptor returned from getRunnableProcesses.
 ContainerProcess createProcess(UniqueID componentID, boolean sharedContainer, boolean restart, boolean mobile, java.lang.String commandLineParameters)
          This method creates a process inside the container manager based on the unique identifier of a ComponentDescriptor returned from getRunnableProcesses.
 ComponentDescriptor[] getRunnableProcesses()
          This method returns the current list of ComponentDescriptors that this ContainerManager is able to run.
 
Methods inherited from interface net.openwings.container.Container
createProcess, createProcess, createProcess, getHost, getID, getPerformanceReports, getProcesses, getStatusOfAllProcesses, registerContainerProcessListener, registerMobileProcessListener, shutdown, unregisterContainerProcessListener, unregisterMobileProcessListener
 

Method Detail

getRunnableProcesses

public ComponentDescriptor[] getRunnableProcesses()
                                           throws java.rmi.RemoteException
This method returns the current list of ComponentDescriptors that this ContainerManager is able to run.

Returns:
array of ComponentDescriptors, or null if no processes have been configured or installed.
Throws:
java.rmi.RemoteException - if there is an error communicating with the manager.

createProcess

public ContainerProcess createProcess(UniqueID componentID)
                               throws java.rmi.RemoteException,
                                      ProcessCreationException
This method creates a process inside the container manager based on the unique identifier of a ComponentDescriptor returned from getRunnableProcesses. This variant of createProcess() is used as a shortcut that allows less information to be passed to start a process. This method returns an object that can be used to control the process. The process is not started until the ContainerProcess.start() method is called. Each call to createProcess() creates a unique process.

Parameters:
componentID - unique identifier for the component to be started
Throws:
java.rmi.RemoteException - if there is an error communicating with the container.
ProcessCreationException - if there is a problem creating the process or if componentID is unknown.

createProcess

public ContainerProcess createProcess(UniqueID componentID,
                                      boolean sharedContainer,
                                      boolean restart,
                                      boolean mobile,
                                      java.lang.String commandLineParameters)
                               throws java.rmi.RemoteException,
                                      ProcessCreationException
This method creates a process inside the container manager based on the unique identifier of a ComponentDescriptor returned from getRunnableProcesses. This variant of createProcess() allows the lifecycle-related parameters of the descriptor to be overridden. This method returns an object that can be used to control the process. The process is not started until the ContainerProcess.start() method is called. Each call to createProcess() creates a unique process.

Parameters:
componentID - unique identifier for the component to be started
sharedContainer - boolean indicating whether this process should be run standalone or in a container.
restart - boolean indicating whether this process should be restarted on failure.
mobile - boolean indicating whether this process can be moved between containers or platforms.
commandLineParameters - command line parameters to be passed to the process
Returns:
an object implementing the ContainerProcess service interface.
Throws:
java.rmi.RemoteException - if there is an error communicating with the container.
ProcessCreationException - if there is a problem creating the process or if componentID is unknown.

Openwings API Documentation (v1.0)