org.norther.tammi.spray.remote
Class HttpRMIClientImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.norther.tammi.spray.remote.HttpRMIClientImpl
All Implemented Interfaces:
Serializable, Remote, HttpRMIClient

public class HttpRMIClientImpl
extends UnicastRemoteObject
implements HttpRMIClient

An implementation of an RMI client connecting to the server through RMI and providing callbacks to return the response from the server.

Version:
$Id: HttpRMIClientImpl.java,v 1.9 2009/09/28 15:08:31 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
protected static String CONNECTION
          Connection header.
protected static String CONTENT_LENGTH
          Content-Length header.
protected static String CONTENT_TYPE
          Content-Type header.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
HttpRMIClientImpl(HttpServletResponse res)
          Contructs a new RMI client.
 
Method Summary
 void close()
          Closes the connection.
 boolean isClosed()
          Checks the closed state.
 void setHeaders(Map<String,String[]> headers)
          Sets headers as a map of Vectors.
 void write(byte[] buffer, int off, int len)
          Writes a response.
 
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

CONTENT_LENGTH

protected static final String CONTENT_LENGTH
Content-Length header.

See Also:
Constant Field Values

CONTENT_TYPE

protected static final String CONTENT_TYPE
Content-Type header.

See Also:
Constant Field Values

CONNECTION

protected static final String CONNECTION
Connection header.

See Also:
Constant Field Values
Constructor Detail

HttpRMIClientImpl

public HttpRMIClientImpl(HttpServletResponse res)
                  throws RemoteException
Contructs a new RMI client.

Parameters:
res - a client response.
Throws:
RemoteException - on errors.
Method Detail

setHeaders

public void setHeaders(Map<String,String[]> headers)
                throws RemoteException
Description copied from interface: HttpRMIClient
Sets headers as a map of Vectors.

Specified by:
setHeaders in interface HttpRMIClient
Parameters:
headers - the header map.
Throws:
RemoteException - on errors.

write

public void write(byte[] buffer,
                  int off,
                  int len)
           throws RemoteException
Writes a response.

Specified by:
write in interface HttpRMIClient
Parameters:
buffer - a buffer to write.
off - an offset.
len - length.
Throws:
RemoteException - on errors.

close

public void close()
           throws RemoteException
Closes the connection.

Specified by:
close in interface HttpRMIClient
Throws:
RemoteException - on errors.

isClosed

public boolean isClosed()
Checks the closed state.

Returns:
true or false.


Copyright © 2004 The Norther Organization. All rights reserved.