How to customize communication in JProxy?
A custom protocol or fail-over algorithm may be utilized on client side by implementing TunnelInvocationInterceptor interface. The interface has only one method that takes as parameters java.reflect.Method instance of invoked method, arguments of the method and instance of stub. The interface may satisfy various demands, for instance: custom data marshalling, fail-over algorithm, debugging. An instance of class implementing the interface may be passed to JProxy thru Tunnel.setTunnelInvocationInterceptor(). The server side implementation must create at least one instance of GenericInvocator and also it has to be able to pass unmarshalled data to invokeAll() method of the instance. A Data passing to the call must be instance of Marshalable interface.