Search in sources :

Example 1 with RpcProtocol

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);
}
Also used : RpcProtocol(com.b2international.snowowl.rpc.RpcProtocol) IJVMConnector(org.eclipse.net4j.jvm.IJVMConnector)

Example 2 with RpcProtocol

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);
}
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)

Example 3 with RpcProtocol

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);
    }
}
Also used : ClientProtocolFactory(org.eclipse.spi.net4j.ClientProtocolFactory) RpcProtocol(com.b2international.snowowl.rpc.RpcProtocol) SignalProtocol(org.eclipse.net4j.signal.SignalProtocol) ISignalProtocol(org.eclipse.net4j.signal.ISignalProtocol) IEventBusProtocol(com.b2international.snowowl.eventbus.net4j.IEventBusProtocol)

Aggregations

RpcProtocol (com.b2international.snowowl.rpc.RpcProtocol)3 IEventBusProtocol (com.b2international.snowowl.eventbus.net4j.IEventBusProtocol)1 RpcSession (com.b2international.snowowl.rpc.RpcSession)1 SingleServiceLookup (com.b2international.snowowl.rpc.test.service.SingleServiceLookup)1 IConnector (org.eclipse.net4j.connector.IConnector)1 IJVMConnector (org.eclipse.net4j.jvm.IJVMConnector)1 ISignalProtocol (org.eclipse.net4j.signal.ISignalProtocol)1 SignalProtocol (org.eclipse.net4j.signal.SignalProtocol)1 ClientProtocolFactory (org.eclipse.spi.net4j.ClientProtocolFactory)1