org.hebe.mps
Class Proxy

java.lang.Object
  |
  +--org.hebe.mps.Proxy

public class Proxy
extends java.lang.Object

This is the base class of all client-side MPS object handles. It maintains a Connection object and an InputStream and an OutputStream. There is very little behaviour on this object - the automatically-generated subclasses provide all the functionality by making use of this object's protected member variables.

Author:
Tony Garnock-Jones
See Also:
Connection, InputStream, OutputStream

Field Summary
private  Connection _connection
          The connection to the remote object server.
private  InputStream _input
          Pipe used when receiving messages from the remote server.
private  OutputStream _output
          Pipe used when sending messages to the remote server.
 
Constructor Summary
protected Proxy(java.lang.String resolvedName)
          Only invoked by subclass constructors.
 
Method Summary
 void _disconnect_proxy()
          Disconnects this client proxy from the server.
protected  InputStream getInputStream()
          Returns a handle on this proxy's input stream for communication from the server.
protected  OutputStream getOutputStream()
          Returns a handle on this proxy's output stream for communication with the server.
protected  java.lang.String getReference()
          Retrieve the canonical name of the server this proxy is connected to.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_connection

private Connection _connection
The connection to the remote object server.

_output

private OutputStream _output
Pipe used when sending messages to the remote server.

_input

private InputStream _input
Pipe used when receiving messages from the remote server.
Constructor Detail

Proxy

protected Proxy(java.lang.String resolvedName)
         throws MPSException
Only invoked by subclass constructors. Creates a connection to the named object, possibly using the naming service passed in, if it is not null.
Parameters:
resolvedName - the name of the server to create a proxy for
Throws:
MPSException - if anything goes wrong
Method Detail

_disconnect_proxy

public void _disconnect_proxy()
                       throws MPSException
Disconnects this client proxy from the server. Closes the socket. It'd be nice if eventually this was reversible - subsequent calls to methods on the proxy should transparently reconnect and succeed, but currently once the connection is gone, it's gone.
Throws:
MPSException - if anything goes wrong

getReference

protected java.lang.String getReference()
Retrieve the canonical name of the server this proxy is connected to. Used (occasionally) to pass references to MPS objects around between MPS interfaces.
Returns:
the canonical name of the connected server
See Also:
OutputStream.writeReference(java.lang.Object)

getOutputStream

protected OutputStream getOutputStream()
Returns a handle on this proxy's output stream for communication with the server.

getInputStream

protected InputStream getInputStream()
                              throws MPSException
Returns a handle on this proxy's input stream for communication from the server.