Overview

It is a transparent RPC (remoting) technology for Java.  You can publish an object to one or more remote clients via one of the interfaces it implements.  It is best to honor the Facade Pattern while architecting the interface(s) as an RPC call over TCP/IP is not cheap.

JRemoting is Apache 2.0 licensed open source. It is inspired by .Net Remoting and before that Mind Electric's Glue technology (no-longer available). JRemoting has been in development since 2002 and for no good reason was not released as 1.0 until 2008. The 2002 project was AltRMI at Apache, thus the copyright is in part Apache Software Foundation and in part the JRemoting committers

Here is an example of a simple facade-style interface and a POJO implementation of it:

    public interface Bank {
        void credit(BigDecimal amount);
        void debit(BigDecimal amount);
    }

    public BankImpl implements Bank {
        // fields
        public void credit(BigDecimal amount) {
            // etc
        }
        public void debit(BigDecimal amount) {
            // etc
        }
        // other methods
    }
    

Server side publishing

    Bank myBank = new BankImpl();
    server = new SocketServer(new ConsoleServerMonitor(), new InetSocketAddress(10333));
    server.publish(myBank, "BankService", Bank.class);
    server.start();
  

Client side usage

    serviceResolver = new ServiceResolver(new SocketTransport(new ConsoleClientMonitor(), new SocketDetails("localhost", 10333)));
Bank remoteBank = serviceResolver.resolveService("BankService");

Pluggability

JRemoting is designed to have pluggable implementations of its component parts. Explore the left navigation to see what is pluggable.