Openwings API Documentation (v1.1)

net.openwings.container
Interface MobileProcess

All Superinterfaces:
ContainerProcess

public interface MobileProcess
extends ContainerProcess

This interface represents a single execution of a process running inside a Container or ContainerManager. It extends the ContainerProcess interface, adding methods that operate on a process that can be moved between containers. The Container and ContainerManager interfaces return objects implementing this interface to provide control of individual processes. Users that wish to access the features of mobile processes will need to check each ContainerProcess object they receive from a Container or ContainerManager to see if it also supports this interface. Note that this can be done by introspection, or by obtaining the ComponentDescriptor from the ContainerProcess and checking the isMobile() property.


Method Summary
 java.rmi.MarshalledObject getProcessState()
          This method returns the latest serialized state of a MobileProcess.
 void registerMobileProcessListener(MobileProcessListener listener)
          This method is used to register interest in receiving the serialized state of a MobileProcess.
 void unregisterMobileProcessListener(MobileProcessListener listener)
          This method is used to cancel interest in receiving the serialized state of a MobileProcess.
 
Methods inherited from interface net.openwings.container.ContainerProcess
getComponentDescriptor, getContainerProcessStatus, getProcessID, registerContainerProcessListener, start, stop, unregisterContainerProcessListener
 

Method Detail

getProcessState

public java.rmi.MarshalledObject getProcessState()
                                          throws java.rmi.RemoteException
This method returns the latest serialized state of a MobileProcess. The MobileProcess is not required to update its serialized state during execution of this method. This method can be called without throwing an IllegalStateException regardless of the state of the process.

Returns:
the latest serialized state of the MobileProcess, or null if the process is not running.
Throws:
java.rmi.RemoteException - if there is an error communicating with the process.

registerMobileProcessListener

public void registerMobileProcessListener(MobileProcessListener listener)
                                   throws java.rmi.RemoteException
This method is used to register interest in receiving the serialized state of a MobileProcess. The MobileProcess implementation must call the appropriate method on listener whenever the serialized state of the MobileProcess is updated. This method can be called after the MobileProcess has stopped without throwing an IllegalStateException, but no updates will ever be generated.

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

unregisterMobileProcessListener

public void unregisterMobileProcessListener(MobileProcessListener listener)
                                     throws java.rmi.RemoteException
This method is used to cancel interest in receiving the serialized state of a MobileProcess. The MobileProcess 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 MobileProcess has stopped without throwing an IllegalStateException, but it is not necessary to explicitly unregister listeners for a stopped MobileProcess since no further updates will be generated.

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

Openwings API Documentation (v1.1)