com.sun.grid.proxy
Class ResultChannelImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.sun.grid.proxy.ResultChannelImpl
All Implemented Interfaces:
java.rmi.Remote, ResultChannel, java.io.Serializable

public class ResultChannelImpl
extends java.rmi.server.UnicastRemoteObject
implements ResultChannel

This class implements the ResultsChannel interface. When a result is returned, we find the job in the lockbox and notify the Lock. When then put the results in the lockbox to be picked up by the ComputeProxy.

See Also:
Serialized Form

Field Summary
private  java.util.Map lockbox
          A Map containing ComputeProxy.Lock's for each active job.
private  java.util.logging.Logger log
           
 
Fields inherited from class java.rmi.server.UnicastRemoteObject
 
Fields inherited from class java.rmi.server.RemoteServer
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface com.sun.grid.proxy.ResultChannel
LOOKUP_NAME, PORT
 
Constructor Summary
ResultChannelImpl(java.util.Map lockbox)
          Constructs ResultChannelImpl object and exports it on default port.
 
Method Summary
 void sendException(java.lang.Exception e, java.lang.String processId)
          This method sends the execption resulting from a job to the ComputeProxy.
 void sendResult(java.io.Serializable result, java.lang.String processId)
          This method sends the results of a job to the ComputeProxy.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

lockbox

private java.util.Map lockbox
A Map containing ComputeProxy.Lock's for each active job.


log

private java.util.logging.Logger log
Constructor Detail

ResultChannelImpl

public ResultChannelImpl(java.util.Map lockbox)
                  throws java.rmi.RemoteException
Constructs ResultChannelImpl object and exports it on default port.

Parameters:
lockbox - the Map holding the job locks.
Throws:
java.rmi.RemoteException - if an error occurs on the server side
Method Detail

sendException

public void sendException(java.lang.Exception e,
                          java.lang.String processId)
                   throws java.rmi.RemoteException
This method sends the execption resulting from a job to the ComputeProxy.

Specified by:
sendException in interface ResultChannel
Parameters:
e - the exception
processId - the id of the job
Throws:
java.rmi.RemoteException - if an error occurs on the server side

sendResult

public void sendResult(java.io.Serializable result,
                       java.lang.String processId)
                throws java.rmi.RemoteException
This method sends the results of a job to the ComputeProxy.

Specified by:
sendResult in interface ResultChannel
Parameters:
result - the results object
processId - the id of the job
Throws:
java.rmi.RemoteException - if an error occurs on the server