|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.net.RemoteNetInterfaceProtocol
public class RemoteNetInterfaceProtocol
implements a convenient protocol for invoking calls to an object remotely using reflection via proxy. This implementation only works on interfaces using methods that solely use method parameters and return values that are serializable! Also, the interface methods should not alter object parameters (using call by reference), as these are not sent back!
| Constructor Summary | |
|---|---|
RemoteNetInterfaceProtocol(Object serverInstance)
calls RemoteNetInterfaceProtocol(serverInstance, false, null) |
|
RemoteNetInterfaceProtocol(Object serverInstance,
boolean enforceAccessibility,
Logger logger)
constructs the handler that implements the server side of the protocol |
|
| Method Summary | |
|---|---|
void |
connectionLost(NetConnection con)
called when a connection caused an IOException during reading or writing; the connection may not have been closed at this point. |
static Object |
createRemoteObject(NetConnection con,
Class<?>... interfaces)
|
static Object |
createRemoteObject(NetConnection con,
ClassLoader cl,
Class<?>... interfaces)
|
static Object |
createRemoteObject(NetConnection con,
Logger logger,
Class<?>... interfaces)
|
static Object |
createRemoteObject(NetConnection con,
Logger logger,
ClassLoader cl,
Class<?>... interfaces)
creates and returns a client object that will be handled remotely through the given NetConnection. |
static Object |
createRemoteObject(String host,
int port,
Class<?>... interfaces)
|
static Object |
createRemoteObject(String host,
int port,
Handshake hs,
Class<?>... interfaces)
|
static Object |
createRemoteObject(String host,
int port,
Handshake hs,
Logger logger,
Class<?>... interfaces)
|
Logger |
getLogger()
|
void |
handleMessage(Object message,
NetConnection con)
called when a message is received by the given NetConnection object |
static void |
sendInfoMessage(NetConnection con,
Object msg)
allows to send an arbitrary message (even just a ping) from one end to another |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteNetInterfaceProtocol(Object serverInstance)
public RemoteNetInterfaceProtocol(Object serverInstance,
boolean enforceAccessibility,
Logger logger)
serverInstance - the object used to handle the requests; this object must
implement the interfaces expected by the clientlogger - used to log connection related eventsenforceAccessibility - if true, even an implementation of a method that would normally
not be accessible, will be made accessible via reflection| Method Detail |
|---|
public static Object createRemoteObject(String host,
int port,
Class<?>... interfaces)
throws IOException
IOException
public static Object createRemoteObject(String host,
int port,
Handshake hs,
Class<?>... interfaces)
throws IOException
IOException
public static Object createRemoteObject(String host,
int port,
Handshake hs,
Logger logger,
Class<?>... interfaces)
throws IOException
IOException
public static Object createRemoteObject(NetConnection con,
Class<?>... interfaces)
public static Object createRemoteObject(NetConnection con,
ClassLoader cl,
Class<?>... interfaces)
public static Object createRemoteObject(NetConnection con,
Logger logger,
Class<?>... interfaces)
public static Object createRemoteObject(NetConnection con,
Logger logger,
ClassLoader cl,
Class<?>... interfaces)
public static void sendInfoMessage(NetConnection con,
Object msg)
throws IOException
IOExceptionpublic Logger getLogger()
public void handleMessage(Object message,
NetConnection con)
throws UnexpectedDataException
NetConnectionHandler
handleMessage in interface NetConnectionHandlerUnexpectedDataExceptionpublic void connectionLost(NetConnection con)
NetConnectionHandler
connectionLost in interface NetConnectionHandler
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||