use of com.b2international.snowowl.rpc.RpcProtocol in project snow-owl by b2ihealthcare.
the class RepositoryPlugin method connectSystemUser.
private void connectSystemUser(IManagedContainer container) throws SnowowlServiceException {
final IJVMConnector connector = JVMUtil.getConnector(container, TransportClient.NET_4_J_CONNECTOR_NAME);
JVMUtil.getAcceptor(container, TransportClient.NET_4_J_CONNECTOR_NAME);
final RpcProtocol clientProtocol = RpcUtil.getRpcClientProtocol(container);
clientProtocol.open(connector);
}
use of com.b2international.snowowl.rpc.RpcProtocol 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);
}
use of com.b2international.snowowl.rpc.RpcProtocol in project snow-owl by b2ihealthcare.
the class TransportClient method openCustomProtocols.
@SuppressWarnings("unchecked")
private void openCustomProtocols() {
// other client protocols
final List<ClientProtocolFactory> protocolFactories = getRegisteredClientProtocolFactories();
for (final ClientProtocolFactory clientProtocolFactory : protocolFactories) {
final SignalProtocol<Object> protocol = (SignalProtocol<Object>) clientProtocolFactory.create("");
openProtocol(protocol);
}
// also set up the RPC client...
final RpcProtocol rpcProtocol = RpcUtil.getRpcClientProtocol(IPluginContainer.INSTANCE);
openProtocol(rpcProtocol);
if (!env.isServer()) {
// ...the event bus, too.
final IEventBusProtocol eventBusProtocol = EventBusNet4jUtil.getClientProtocol(IPluginContainer.INSTANCE);
openProtocol(eventBusProtocol);
}
}
Aggregations