Search in sources :

Example 1 with IConnector

use of org.eclipse.net4j.connector.IConnector in project snow-owl by b2ihealthcare.

the class AbstractRpcTest method initializeService.

protected T initializeService() {
    final IConnector connector = JVMUtil.getConnector(container, JVM_DESCRIPTION);
    serviceImplementation = createServiceImplementation();
    final SingleServiceLookup<U> singleServiceLookup = new SingleServiceLookup<U>(serviceImplementation);
    final RpcSession initialServerSession = RpcUtil.getInitialServerSession(container);
    initialServerSession.registerClassLoader(serviceInterfaceClass, serviceImplementation.getClass().getClassLoader());
    initialServerSession.registerServiceLookup(singleServiceLookup);
    final RpcProtocol protocol = RpcUtil.getRpcClientProtocol(container);
    protocol.registerClassLoader(serviceInterfaceClass, serviceInterfaceClass.getClassLoader());
    protocol.open(connector);
    protocol.setTimeout(PROTOCOL_TIMEOUT_MILLIS);
    return protocol.getServiceProxy(serviceInterfaceClass);
}
Also used : RpcProtocol(com.b2international.snowowl.rpc.RpcProtocol) RpcSession(com.b2international.snowowl.rpc.RpcSession) SingleServiceLookup(com.b2international.snowowl.rpc.test.service.SingleServiceLookup) IConnector(org.eclipse.net4j.connector.IConnector)

Aggregations

RpcProtocol (com.b2international.snowowl.rpc.RpcProtocol)1 RpcSession (com.b2international.snowowl.rpc.RpcSession)1 SingleServiceLookup (com.b2international.snowowl.rpc.test.service.SingleServiceLookup)1 IConnector (org.eclipse.net4j.connector.IConnector)1