Openwings API Documentation (v1.1)

net.openwings.container
Interface ContainerAccess


public interface ContainerAccess

This interface is provided by the Container implementation. It allows an Openwings Component or any Java process to interact with its container. An Openwings Component running in a container can obtain a ContainerAccess object by calling the net.openwings.component.ComponentComplex.getContainerAccess() method. Other Java processes can obtain a ContainerAccess object by reading the implementation class name from the net.openwings.container.implementation property, using Class.forName() to instantiate the class, and calling the Class.instance() method. .


Method Summary
 UniqueID getContainerID()
          This method is used by a process (an Openwings Component or other Java program) to obtain the unique identifier of the container in which it is running.
 UniqueID getProcessID()
          This method is used by a process (an Openwings Component or other Java program) to obtain its own unique process identifier from the container in which it is running.
 void registerProcessAccess(ProcessAccess listener)
          This method is used by a process (an Openwings Component or other Java program) to register a callback that can be used by its container to pull the state of the process asynchronously.
 void registerProcessShutdown(ProcessShutdown shutdown)
          This method is used by a process (an Openwings Component or other Java program) to register a callback that can be used by its container to shut down the process cleanly.
 java.rmi.MarshalledObject retrieveProcessState()
          This method is used by a process (an Openwings Component or other Java program) to obtain its saved state.
 void unregisterProcessAccess(ProcessAccess listener)
          This method is used by a process (an Openwings Component or other Java program) to cancel container access to process state.
 void unregisterProcessShutdown(ProcessShutdown shutdown)
          This method is used by a process (an Openwings Component or other Java program) to remove a shutdown callback.
 void updatedPerformanceReports(PerformanceReport[] performanceReports)
          This method is used by a process (an Openwings Component or other Java program) to push performance reports up to its container.
 boolean updatedProcessState(java.rmi.MarshalledObject state)
          This method is used by a process (an Openwings Component or other Java program) to push its saved state up to its container.
 

Method Detail

getContainerID

public UniqueID getContainerID()
This method is used by a process (an Openwings Component or other Java program) to obtain the unique identifier of the container in which it is running.

Returns:
unique identifier for the container.

getProcessID

public UniqueID getProcessID()
This method is used by a process (an Openwings Component or other Java program) to obtain its own unique process identifier from the container in which it is running.

Returns:
unique identifier for the process.

retrieveProcessState

public java.rmi.MarshalledObject retrieveProcessState()
This method is used by a process (an Openwings Component or other Java program) to obtain its saved state. This method is intended to be used at process startup for the process to initialize itself to a previously saved state. In this way the process can recover from a failure or move.

Returns:
serialized state of the process, or null if there is no saved state, such as for a new process.

updatedProcessState

public boolean updatedProcessState(java.rmi.MarshalledObject state)
This method is used by a process (an Openwings Component or other Java program) to push its saved state up to its container.

Parameters:
state - the serialized state of the process.
Returns:
hint from the Container implementation indicating whether the process is about to be moved.

updatedPerformanceReports

public void updatedPerformanceReports(PerformanceReport[] performanceReports)
This method is used by a process (an Openwings Component or other Java program) to push performance reports up to its container.

Parameters:
performanceReports - array of implementation-specific reports on process performance.

registerProcessAccess

public void registerProcessAccess(ProcessAccess listener)
This method is used by a process (an Openwings Component or other Java program) to register a callback that can be used by its container to pull the state of the process asynchronously. Only one ProcessAccess object may be registered with the container at a time. Repeat calls to this interface cause the previous object to be replaced.

Parameters:
listener - an object that implements the ProcessAccess interface.

unregisterProcessAccess

public void unregisterProcessAccess(ProcessAccess listener)
This method is used by a process (an Openwings Component or other Java program) to cancel container access to process state.

Parameters:
listener - an object that implements the ProcessAccess interface.

registerProcessShutdown

public void registerProcessShutdown(ProcessShutdown shutdown)
This method is used by a process (an Openwings Component or other Java program) to register a callback that can be used by its container to shut down the process cleanly. Multiple ProcessShutdown objects may be registered with the container.


unregisterProcessShutdown

public void unregisterProcessShutdown(ProcessShutdown shutdown)
This method is used by a process (an Openwings Component or other Java program) to remove a shutdown callback.


Openwings API Documentation (v1.1)