"The REFCODES.ORG codes represent a group of artifacts consolidating parts of my work in the past years. Several topics are covered which I consider useful for you, programmers, developers and software engineers."

What is this repository for?

The refcodes-remoting artifact is a lightweight RPC (remote procedure call) framework; you may also call it an IPC (inter process communication) tool-kit. On your server you publish any instance (any Java object), on your client you may access this instance via a proxy object which looks and feels exactly as the remote instance on the server.

Publish an instance (just any Java object) on your server, connect to it on your client via a proxy - voilĂ , you may do remote method calls via the proxy on the instance ... just with a few lines of code ...

This proxy provides your client exactly the same methods as the instance offers on the server. Invoking any of them methods on the proxy at the client actually causes the according method on the remote instance at the server to be processed. VoilĂ , there is your remote procedure call!

Neither stubs nor skeletons to be generated anywhere, no need for you to generate any code.

The refcodes-remoting can be attached to virtually any kind of connection (implement your own! See refcodes-connection ...):

  • Loopback connection: Direct object access on the same JVM (see LoopbackRemoteTest source codes)
  • Input-/OutputStream: Anything which is a Java InputStream/OutputStream can be used (see IoStreamRemoteTest source codes)
  • Socket: Use Java's ServerSocket / (Client-)Socket mechanism (see ObservableSocketRemoteTest source codes)

The refcodes-remoting-ext-observer provides an observable implementation (as of the refcodes-observer artifact) of the refcodes-remoting tool-box.

Yes, it's observable: You get events when a client subscribes (you may veto the subscription in your listener) to an instance on your server or when it unsubscribes ...

How do I get set up?

To get up and running, include the following dependency (without the three dots "...") in your pom.xml:


The artifact is hosted directly at Maven Central. Jump straight to the source codes at Bitbucket. Read the artifact's javadoc at

How do I get started?

First setup your server; we start off with a socket based example; using streams is even simpler. Create your server and publish the object you'd like to be invoked remote by a client:

List<String> theServerList = new ArrayList<String>();
RemoteServer theServer = new RemoteServerImpl();
theServer.publishSubject( theServerList );

Then you wait for the client to connect to your ServerSocket. From the Socket created upon connection you create an InputOutputTransceiver which is used to open your Server:

ServerSocket theServerSocket = new ServerSocket( 5161 );
Socket theSocket = theServerSocket.accept();
InputOutputStreamTransceiverImpl<Serializable> theServerTransceiver = new InputOutputStreamTransceiverImpl<Serializable>(); theSocket.getInputStream(), theSocket.getOutputStream() ); theServerTransceiver );

Next you setup your client. You create a Socket to your server from which you produce an InputOutputTransceiver which is used to open your Client

RemoteClient theClient = new RemoteClientImpl();
Socket theClientSocket = new Socket( "localhost", 5161 );
InputOutputStreamTransceiverImpl<Serializable> theClientTransceiver = new InputOutputStreamTransceiverImpl<Serializable>(); theClientSocket.getInputStream(), theClientSocket.getOutputStream() ); theClientTransceiver );

Now you can invoke the methods provided by the theServerList on your client by retrieving the according proxy:

// Iterator<Object> theProxies = theClient.proxies();
if ( theClient.hasProxy( List.class ) ) {
    List<?> theProxyList = theClient.getProxy( List.class );

That's it! Full examples tweaked to run as unit tests on a single machine you'll find here:

Contribution guidelines

  • Implement other connection types (state-less HTTP, XML-over-stream)
  • Provide some ServerSocket based server which you just start for it to serve the objects to be published. For example some wrapper service could create new server instances upon new client connections or the server could be extended to handle more than one open connections ...
  • Writing tests
  • Code review
  • Other guidelines

Who do I talk to?

  • Siegfried Steiner (

Terms and conditions

The REFCODES.ORG group of artifacts is published under some open source licenses; covered by the refcodes-licensing (org.refcodes group) artifact - evident in each artifact in question as of the pom.xml dependency included in such artifact.