|
Openwings API Documentation (v1.1) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This interface provides the key abstraction for Container Services.
A Container describes a service interface that
can be accessed in a distributed environment. However, access to a
Container should be limited to the
ContainerManager that creates and manages it.
A Container creates processes and manages their
lifecycle. The container reports the status of processes it contains
and performance statistics. These reports can be obtained directly
from the interface or by registering callback objects called listeners.
| Method Summary | |
ContainerProcess |
createProcess(ComponentDescriptor componentDescriptor)
This method creates a process inside the container based on the given ComponentDescriptor. |
ContainerProcess |
createProcess(ComponentDescriptor componentDescriptor,
boolean restart,
boolean mobile,
java.lang.String commandLineParameters)
This method creates a process inside the container based on the given ComponentDescriptor and lifecycle-related
parameters. |
ContainerProcess |
createProcess(ComponentDescriptor componentDescriptor,
UniqueID processID,
ContainerProcessStatus processStatus,
java.rmi.MarshalledObject processState)
This method creates a process inside the container based on the given ComponentDescriptor, the process unique
ID, and the saved process state. |
java.net.InetAddress |
getHost()
This method returns the host on which this Container is running. |
UniqueID |
getID()
This method returns a unique identifier for this Container. |
PerformanceReport[] |
getPerformanceReports()
This method is used to obtain performance reports for the container. |
ContainerProcess[] |
getProcesses()
This method is used to access all of the processes that are currently running inside a container. |
ContainerProcessStatus[] |
getStatusOfAllProcesses()
This method is a convenience method that reports the status of all of the processes that are currently running inside a container. |
void |
registerContainerProcessListener(ContainerProcessListener listener)
This method is used to register interest in receiving process status updates for every process in a container. |
void |
registerMobileProcessListener(MobileProcessListener listener)
This method is used to register interest in receiving the serialized state of every process in the container that supports state serialization. |
void |
shutdown()
This method is used to shutdown a container. |
void |
unregisterContainerProcessListener(ContainerProcessListener listener)
This method is used to cancel interest in receiving process status updates for every process in a container. |
void |
unregisterMobileProcessListener(MobileProcessListener listener)
This method is used to cancel interest in receiving the serialized state of processes in a container. |
| Method Detail |
public UniqueID getID()
throws java.rmi.RemoteException
Container.
java.rmi.RemoteException - if there is an error communicating
with the container.
public java.net.InetAddress getHost()
throws java.rmi.RemoteException
Container is running.
java.rmi.RemoteException - if there is an error communicating
with the container.
public ContainerProcess createProcess(ComponentDescriptor componentDescriptor)
throws java.rmi.RemoteException,
ProcessCreationException
ComponentDescriptor. 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. A SecurityException is
thrown if the container is unable to start the process.
componentDescriptor - descriptor for the process to be run
ContainerProcess
service interface.
java.rmi.RemoteException - if there is an error communicating with
the container.
ProcessCreationException - if there is a problem creating
the process in the container.
public ContainerProcess createProcess(ComponentDescriptor componentDescriptor,
UniqueID processID,
ContainerProcessStatus processStatus,
java.rmi.MarshalledObject processState)
throws java.rmi.RemoteException,
ProcessCreationException
ComponentDescriptor, the process unique
ID, and the saved process state. This variant of
createProcess() is used to move an existing process
into a new container. 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. A SecurityException is
thrown if the container is unable to start the process.
componentDescriptor - descriptor for the process to be insertedprocessID - unique identifier for the process to be insertedprocessStatus - last known status of process to be insertedprocessState - serialized state of the process to be inserted
ContainerProcess
service interface.
java.rmi.RemoteException - if there is an error communicating with
the container.
ProcessCreationException - if there is a problem creating
the process in the container.
public ContainerProcess createProcess(ComponentDescriptor componentDescriptor,
boolean restart,
boolean mobile,
java.lang.String commandLineParameters)
throws java.rmi.RemoteException,
ProcessCreationException
ComponentDescriptor and lifecycle-related
parameters. This variant of createProcess()
is used to override the default lifecycle-related parameters
of the descriptor. 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. A SecurityException is
thrown if the container is unable to start the process.
componentDescriptor - descriptor for the process to be insertedrestart - 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
ContainerProcess
service interface.
java.rmi.RemoteException - if there is an error communicating with
the container.
ProcessCreationException - if there is a problem creating
the process in the container.
public ContainerProcess[] getProcesses()
throws java.rmi.RemoteException
ContainerProcess
interface that can be used to control the processes. The container
is not required to return ContainerProcess objects for
processes that have stopped, since these processes are obsolete.
The container should return objects representing processes with
the following states (defined in ContainerProcessStatus):
CREATED, STARTED, and FAILED.
ContainerProcess
interface, or null if there are no processes
running in the container
java.rmi.RemoteException - if there is an error communicating with
the container.
public ContainerProcessStatus[] getStatusOfAllProcesses()
throws java.rmi.RemoteException
ContainerProcessStatus
objects that represent the status of the processes inside the
container. The container is not required to generate updated
process status reports during execution of this method, only to
report the most recent status report it has for each process. The
container is not required to return ContainerProcessStatus
objects for processes that have stopped, since these processes
are obsolete.
ContainerProcessStatus objects
or null if there are no processes running in the
container
java.rmi.RemoteException - if there is an error communicating with
the container.
public PerformanceReport[] getPerformanceReports()
throws java.rmi.RemoteException
PerformanceReport objects that describe the current
loading of the container. The first PerformanceReport
in the array must be the memory loading (heap size) of the container,
and subsequent reports are implementation-defined. The container
is not required to generate updated performance reports during
execution of this method, only to report the most recent
performance statistics it has gathered.
PerformanceReport objects
java.rmi.RemoteException - if there is an error communicating with
the container.
public void registerContainerProcessListener(ContainerProcessListener listener)
throws java.rmi.RemoteException
listener - an object that implements the
ContainerProcessListener interface or one of its
subinterfaces, such as ContainerListener or
ContainerManagerListener.
java.rmi.RemoteException - if there is an error communicating with
the container.
public void unregisterContainerProcessListener(ContainerProcessListener listener)
throws java.rmi.RemoteException
listener - an object that implements the
ContainerProcessListener interface or one of its
subinterfaces, such as ContainerListener or
ContainerManagerListener.
java.rmi.RemoteException - if there is an error communicating with
the container.
public void registerMobileProcessListener(MobileProcessListener listener)
throws java.rmi.RemoteException
listener - an object that implements the
MobileProcessListener interface.
java.rmi.RemoteException - if there is an error communicating with
the container.
public void unregisterMobileProcessListener(MobileProcessListener listener)
throws java.rmi.RemoteException
listener - an object that implements the
MobileProcessListener interface.
java.rmi.RemoteException - if there is an error communicating with
the container.
public void shutdown()
throws java.rmi.RemoteException
java.rmi.RemoteException - if there is an error communicating with
the container.
|
Openwings API Documentation (v1.1) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||