Binary Remoting and Authentication Protocol

BRAP is a Java and Android remoting protocol that uses native Java object serialization, encapsulated in HTTP.

It aims to be a lightweight alternative to Spring HttpInvoker and Spring Security especially when you don't need or want the dependencies of Spring in your client, for example when building a rich client app or an Android app where size is important.

BRAP supports remoting with streams to send and recieve large payloads, and you can easily add progress indicators and cancel/resume behaviour to such transfers.

You can choose to use either the default HttpURLConnection transport or the supplied support for Apache HttpClient, or even easily create your own via the pluggable transport system.

The authentication mechanism lets you use your own domain objects as credentials.

BRAP gives you "pass by reference" even though the object arguments are serialized and passed to the remote service - changes that happen on the remote side can be applied to the client side automatically.

Server configuration can be expressed solely in web.xml or by subclassing the ProxyServlet but there is also an optional SpringProxyServlet available for seamless Spring Integration.

The client is used in exactly the same manner on both Java and Android (Tested with Android 4.1).

BRAP focuses on being easy to use, small in size, yet powerful and extensible.

Accessing a remote service is simple:

MyService myService = ServiceProxyFactory.createProxy(MyService.class, "http://example.com/MyService");

Servlet configuration in web.xml:

<servlet>
  <servlet-name>myservice</servlet-name>
  <servlet-class>no.tornado.brap.servlet.ProxyServlet</servlet-class>
  <init-param>
    <param-name>service</param-name>
    <param-value>com.example.MyServiceImpl</param-value>
  </init-param>
  <init-param>
    <param-name>authorizationProvider</param-name>
    <param-value>no.tornado.brap.auth.AuthenticationNotRequiredAuthorizer</param-value>
  </init-param>
</servlet>

<servlet-mapping>
  <servlet-name>myservice</servlet-name>
    <url-pattern>/MyService</url-pattern>
</servlet-mapping>

Don't let the simplicity fool you - BRAP supports powerful customization and Spring integration for maximum flexibility!

Read the short and concise documentation, the apidocs or browse the source code.

Getting BRAP

All releases are available in the central Maven repository. Add the following to your pom.xml:

<!-- Client -->
<dependency>
  <groupId>no.tornado.brap</groupId>
  <artifactId>brap-client</artifactId>
  <version>1.0.1</version>
</dependency>

<!-- Server -->
<dependency>
  <groupId>no.tornado.brap</groupId>
  <artifactId>brap-server</artifactId>
  <version>1.0.1</version>
</dependency>

<!-- Optional Spring support on the server -->
<dependency>
  <groupId>no.tornado.brap</groupId>
  <artifactId>brap-spring</artifactId>
  <version>1.0.1</version>
</dependency>

Also check out the brap-examples project for more information.

Alternatively, you can access all downloads including source code directly via HTTP from the Downloads page.