Instead of constructing the RemoteRequest-objects ourself we will use a dynamic proxy for processing client request. This way using EJClient#execute directly can be avoided and invoking remote methods behaves the same like local method invocations.
EJOE contains a generator, which is able to construct dynamic proxies for EJOEs Remote Reflection at runtime. The generator is located within the class de.netseeker.ejoe.RemotingService and is able to produce dynamic proxies for synchronous as well as for asynchronous requests.
import de.netseeker.ejoe.EJClient; import de.netseeker.ejoe.RemotingService; import de.netseeker.ejoe.test.service.ISimpleTypes; import de.netseeker.ejoe.test.service.SimpleTypes; ... EJClient client = new EJClient(... ); //SimpleTypes implements ISimpleTypes and offers an implementation for //the abstract signature #getString(String) ISimpleTypes service = (ISimpleTypes) RemotingService.createService( SimpleTypes.class.getName(), ISimpleTypes.class, client ); String str = service.getString( "abcd" ); ...