Openwings API Documentation (v1.1)

net.openwings.container
Interface ContainerProcess

All Known Subinterfaces:
MobileProcess

public interface ContainerProcess

This interface represents a single execution of a process running inside a Container or ContainerManager. It describes the operations that can be performed remotely on a process. The Container and ContainerManager interfaces return objects implementing this interface to provide control of individual processes.


Method Summary
 ComponentDescriptor getComponentDescriptor()
          This method returns the ComponentDescriptor object that was used to create this ContainerProcess.
 ContainerProcessStatus getContainerProcessStatus()
          This method returns a ContainerProcessStatus object that represents the status of the ContainerProcess.
 UniqueID getProcessID()
          This method returns the unique identifier for this process.
 void registerContainerProcessListener(ContainerProcessListener listener)
          This method is used to register interest in receiving process status updates from a ContainerProcess.
 void start()
          This method is used to start the execution of a ContainerProcess object returned from the Container.createProcess() method.
 void stop()
          This method is used to explicitly stop the execution of a ContainerProcess object.
 void unregisterContainerProcessListener(ContainerProcessListener listener)
          This method is used to cancel interest in receiving process status updates from a ContainerProcess.
 

Method Detail

getProcessID

public UniqueID getProcessID()
                      throws java.rmi.RemoteException
This method returns the unique identifier for this process. This identifier is valid for the lifetime of a process, even if the process moves to another Container or ContainerManager.

Returns:
unique identifier for this process
Throws:
java.rmi.RemoteException - if there is an error communicating with the process.

getComponentDescriptor

public ComponentDescriptor getComponentDescriptor()
                                           throws java.rmi.RemoteException
This method returns the ComponentDescriptor object that was used to create this ContainerProcess. This method can be called without throwing an IllegalStateException regardless of the state of the process. Remember that the lifecycle-related "hint" parameters in the descriptor may have been overridden when the process was created. Check the process status to get the actual command line parameters, and to determine whether the process is mobile, set to be restarted on failure, or running in a shared container.

Returns:
the ComponentDescriptor object that was used to start the ContainerProcess
Throws:
java.rmi.RemoteException - if there is an error communicating with the process.

getContainerProcessStatus

public ContainerProcessStatus getContainerProcessStatus()
                                                 throws java.rmi.RemoteException
This method returns a ContainerProcessStatus object that represents the status of the ContainerProcess. The ContainerProcess is not required to generate an updated process status report during execution of this method, only to report the most recent status report it has. This method can be called without throwing an IllegalStateException regardless of the state of the process. After the ContainerProcess has stopped, this method should return the final status report.

Returns:
a ContainerProcessStatus object containing the most recent status of the ContainerProcess
Throws:
java.rmi.RemoteException - if there is an error communicating with the process.

start

public void start()
           throws java.lang.IllegalStateException,
                  java.rmi.RemoteException
This method is used to start the execution of a ContainerProcess object returned from the Container.createProcess() method. This method cannot be called to restart a stopped process.

Throws:
java.lang.IllegalStateException - if the process is not in the CREATED state (defined in ContainerProcessStatus).
java.rmi.RemoteException - if there is an error communicating with the process.

stop

public void stop()
          throws java.rmi.RemoteException
This method is used to explicitly stop the execution of a ContainerProcess object. This method can be called without throwing an IllegalStateException regardless of the state of the process.

Throws:
java.rmi.RemoteException - if there is an error communicating with the process.

registerContainerProcessListener

public void registerContainerProcessListener(ContainerProcessListener listener)
                                      throws java.rmi.RemoteException
This method is used to register interest in receiving process status updates from a ContainerProcess. The ContainerProcess implementation must call the appropriate method on listener whenever the status of the process changes. This method can be called after the process has stopped without throwing an IllegalStateException, but listener will never receive any updates.

Parameters:
listener - an object that implements the ContainerProcessListener interface.
Throws:
java.rmi.RemoteException - if there is an error communicating with the process.

unregisterContainerProcessListener

public void unregisterContainerProcessListener(ContainerProcessListener listener)
                                        throws java.rmi.RemoteException
This method is used to cancel interest in receiving process status updates from a ContainerProcess. The ContainerProcess implementation should no longer call methods on listener, but method calls that are already in progress will be completed. This method can be called after the process has stopped without throwing an IllegalStateException, but it is not necessary to explicitly unregister listeners for a stopped process since no further updates will be generated.

Parameters:
listener - an object that implements the ContainerProcessListener interface.
Throws:
java.rmi.RemoteException - if there is an error communicating with the process.

Openwings API Documentation (v1.1)