public class PyroProxy extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
UUID |
correlation_id |
String |
hostname |
String |
objectid |
int |
port |
Set<String> |
pyroAttrs |
Object |
pyroHandshake |
byte[] |
pyroHmacKey |
Set<String> |
pyroMethods |
Set<String> |
pyroOneway |
Constructor and Description |
---|
PyroProxy()
No-args constructor for (un)pickling support
|
PyroProxy(PyroURI uri)
Create a proxy for the remote Pyro object denoted by the uri
|
PyroProxy(String hostname,
int port,
String objectid)
Create a proxy for the remote Pyro object on the given host and port, with the given objectid/name.
|
Modifier and Type | Method and Description |
---|---|
void |
__setstate__(Object[] args)
called by the Unpickler to restore state
args(8): pyroUri, pyroOneway(hashset), pyroMethods(set), pyroAttrs(set), pyroTimeout, pyroHmacKey, pyroHandshake, pyroMaxRetries
|
protected void |
_handshake()
Perform the Pyro protocol connection handshake with the Pyro daemon.
|
SortedMap<String,byte[]> |
annotations()
Returns a sorted map with annotations to be sent with each message.
|
void |
call_oneway(String method,
Object... arguments)
Call a method on the remote Pyro object this proxy is for, using Oneway call semantics (return immediately).
|
Object |
call(String method,
Object... arguments)
Call a method on the remote Pyro object this proxy is for.
|
void |
close()
Close the network connection of this Proxy.
|
protected void |
connect()
(re)connect the proxy to the remote Pyro daemon.
|
void |
finalize() |
Object |
getattr(String attr)
Get the value of a remote attribute.
|
protected void |
getMetadata(String objectId)
get metadata from server (methods, attrs, oneway, ...) and remember them in some attributes of the proxy
|
protected HashSet<String> |
getSetOfStrings(Object strings)
Converts the given object into a set of strings.
|
void |
responseAnnotations(SortedMap<String,byte[]> annotations,
int msgtype)
Process any response annotations (dictionary set by the daemon).
|
void |
setattr(String attr,
Object value)
Set a new value on a remote attribute.
|
void |
validateHandshake(Object response)
Process and validate the initial connection handshake response data received from the daemon.
|
public String hostname
public int port
public String objectid
public byte[] pyroHmacKey
public UUID correlation_id
public Object pyroHandshake
public PyroProxy()
public PyroProxy(PyroURI uri) throws UnknownHostException, IOException
UnknownHostException
IOException
public PyroProxy(String hostname, int port, String objectid) throws UnknownHostException, IOException
UnknownHostException
IOException
protected void connect() throws UnknownHostException, IOException
UnknownHostException
IOException
protected void getMetadata(String objectId) throws PickleException, PyroException, IOException
PickleException
PyroException
IOException
protected HashSet<String> getSetOfStrings(Object strings)
public Object call(String method, Object... arguments) throws PickleException, PyroException, IOException
method
- the name of the method you want to callarguments
- zero or more arguments for the remote methodPickleException
PyroException
IOException
public void call_oneway(String method, Object... arguments) throws PickleException, PyroException, IOException
method
- the name of the method you want to callarguments
- zero or more arguments for the remote methodPickleException
PyroException
IOException
public Object getattr(String attr) throws PickleException, PyroException, IOException
attr
- the attribute namePickleException
PyroException
IOException
public void setattr(String attr, Object value) throws PickleException, PyroException, IOException
attr
- the attribute namevalue
- the new value for the attributePickleException
PyroException
IOException
public SortedMap<String,byte[]> annotations()
public void close()
protected void _handshake() throws IOException
IOException
public void validateHandshake(Object response) throws IOException
IOException
public void responseAnnotations(SortedMap<String,byte[]> annotations, int msgtype)
public void __setstate__(Object[] args) throws IOException
IOException
Copyright © 2016. All Rights Reserved.