Search in sources :

Example 1 with EventBusProtocolInjector

use of com.b2international.snowowl.internal.eventbus.net4j.EventBusProtocolInjector in project snow-owl by b2ihealthcare.

the class EventBusNet4jUtil method prepareContainer.

/**
 * Prepares the given {@link IManagedContainer} to deliver message through {@link IEventBus} instances over the
 * network.
 *
 * @param container
 * @param gzip - to enable gzip compression on the protocol or not
 * @param numberOfWorkers
 */
public static final void prepareContainer(IManagedContainer container, boolean gzip, int numberOfWorkers) {
    container.registerFactory(new EventBusProtocol.ClientFactory());
    container.registerFactory(new EventBusProtocol.ServerFactory());
    container.registerFactory(new EventBus.Factory());
    container.addPostProcessor(new EventBusProtocolInjector(numberOfWorkers));
    if (gzip) {
        container.addPostProcessor(new GZIPStreamWrapperInjector(EventBusConstants.PROTOCOL_NAME));
    }
}
Also used : EventBusProtocolInjector(com.b2international.snowowl.internal.eventbus.net4j.EventBusProtocolInjector) EventBusProtocol(com.b2international.snowowl.internal.eventbus.net4j.EventBusProtocol) GZIPStreamWrapperInjector(org.eclipse.net4j.signal.wrapping.GZIPStreamWrapperInjector) IEventBus(com.b2international.snowowl.eventbus.IEventBus) EventBus(com.b2international.snowowl.internal.eventbus.EventBus)

Aggregations

IEventBus (com.b2international.snowowl.eventbus.IEventBus)1 EventBus (com.b2international.snowowl.internal.eventbus.EventBus)1 EventBusProtocol (com.b2international.snowowl.internal.eventbus.net4j.EventBusProtocol)1 EventBusProtocolInjector (com.b2international.snowowl.internal.eventbus.net4j.EventBusProtocolInjector)1 GZIPStreamWrapperInjector (org.eclipse.net4j.signal.wrapping.GZIPStreamWrapperInjector)1