|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlbg.protocol.rpc.RemoteCall
public class RemoteCall
A class implementing simple and protected calls to distant host.
This class makes use of java.lang.reflect
, and therefore allows
polymorphism
Nested Class Summary | |
---|---|
static class |
RemoteCall.CallType
Who do we make the call to ? |
Constructor Summary | |
---|---|
RemoteCall(RemoteCall.CallType destination,
java.lang.String methodName,
java.lang.Class[] paramtypes,
java.lang.Object[] params)
Creates a remote call. |
|
RemoteCall(RemoteCall.CallType destination,
java.lang.String methodName,
java.lang.Object... params)
Creates a remote call. Warning: you could experience problem with runtime types (e.g. |
Method Summary | |
---|---|
java.lang.Object |
doCall(java.lang.Object obj)
Makes the obj.methodName(params) call. |
protected static LivePeerHandle |
getPeerHandle(java.lang.String host,
int port)
Gets a handle from a Peer just by knowing his host and port. |
protected static LiveSearchEngineHandle |
getSearchEngineHandle(java.lang.String host,
int port)
Gets a handle from a search engine just by knowing his host and port. |
RemoteCall.CallType |
getType()
|
java.lang.Object |
send(java.lang.String host,
int port,
boolean do_return)
Opens a connection to host:port and send the call |
java.lang.Object |
send(java.lang.String host,
int port,
boolean do_return,
boolean do_timeout)
Opens a connection to host:port and send the call |
java.lang.Object |
send(java.lang.String host,
int port,
boolean do_return,
boolean do_timeout,
boolean do_failfast)
Opens a connection to host:port and send the call |
java.lang.String |
toString()
Sums up the call as a string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RemoteCall(RemoteCall.CallType destination, java.lang.String methodName, java.lang.Object... params) throws GridException
destination
- The node we are talking tomethodName
- The name of the methodparams
- The paramaters for called function
GridException
RemoteCall(CallType type, String methodName, Class[] paramtypes,
Object[] params)
public RemoteCall(RemoteCall.CallType destination, java.lang.String methodName, java.lang.Class[] paramtypes, java.lang.Object[] params) throws GridException
destination
- The node we are talking tomethodName
- The name of the methodparamtypes
- The classes of the parametersparams
- The paramaters for called function
GridException
RemoteCall(CallType type, String methodName, Object... params)
Method Detail |
---|
protected static LivePeerHandle getPeerHandle(java.lang.String host, int port) throws GridException
host
- Peer hostport
- Peer port
GridException
- if getting the handle was not possibleprotected static LiveSearchEngineHandle getSearchEngineHandle(java.lang.String host, int port) throws GridException
host
- Search hostport
- Search port
GridException
- if getting the handle was not possiblepublic java.lang.Object doCall(java.lang.Object obj) throws GridException, java.lang.reflect.InvocationTargetException
obj.methodName(params)
call.
obj
- The object to make the call on (will be type-checked)
GridException
- if the call is not supported by that object.
java.lang.reflect.InvocationTargetException
- if the underlying
method throws an exception.public java.lang.Object send(java.lang.String host, int port, boolean do_return) throws GridException
host
- The host to send it toport
- The port on where to send itdo_return
- True if we wait for a return value
GridException
- if the parameters are invalid
GridNetworkException
- if the remote host couldn't be reached or
didn't format its messages as expected.public java.lang.Object send(java.lang.String host, int port, boolean do_return, boolean do_timeout) throws GridException
host
- The host to send it toport
- The port on where to send itdo_return
- true if we wait for a return valuedo_timeout
- false to deactivate the transmission timeout
GridException
- if the parameters are invalid
GridNetworkException
- if the remote host couldn't be reached or
didn't format its messages as expected.public java.lang.Object send(java.lang.String host, int port, boolean do_return, boolean do_timeout, boolean do_failfast) throws GridException
host
- The host to send it toport
- The port on where to send itdo_return
- true if we wait for a return valuedo_timeout
- false to deactivate the transmission timeoutdo_failfast
- true to retry only once, and immediately,
in case of comm. failure
GridException
- if the parameters are invalid
GridNetworkException
- if the remote host couldn't be reached or
didn't format its messages as expected.public RemoteCall.CallType getType()
public java.lang.String toString()
toString
in class java.lang.Object
|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.