Search in sources :

Example 1 with RequestRepository

use of org.infinispan.remoting.transport.impl.RequestRepository in project infinispan by infinispan.

the class JGroupsTransport method start.

@Start
@Override
public void start() {
    if (running)
        throw new IllegalStateException("Two or more cache managers are using the same JGroupsTransport instance");
    probeHandler.updateThreadPool(nonBlockingExecutor);
    props = TypedProperties.toTypedProperties(configuration.transport().properties());
    requests = new RequestRepository();
    String stack = configuration.transport().stack();
    if (stack != null) {
        CLUSTER.startingJGroupsChannel(configuration.transport().clusterName(), configuration.transport().stack());
    } else {
        CLUSTER.startingJGroupsChannel(configuration.transport().clusterName());
    }
    initChannel();
    channel.setUpHandler(channelCallbacks);
    setXSiteViewListener(channelCallbacks);
    startJGroupsChannelIfNeeded();
    waitForInitialNodes();
    channel.getProtocolStack().getTransport().registerProbeHandler(probeHandler);
    RELAY2 relay2 = findRelay2();
    if (relay2 != null) {
        localSite = XSiteNamedCache.cachedString(relay2.site());
    }
    running = true;
}
Also used : RequestRepository(org.infinispan.remoting.transport.impl.RequestRepository) RELAY2(org.jgroups.protocols.relay.RELAY2) Start(org.infinispan.factories.annotations.Start)

Example 2 with RequestRepository

use of org.infinispan.remoting.transport.impl.RequestRepository in project infinispan by infinispan.

the class CountingRequestRepository method replaceDispatcher.

public static CountingRequestRepository replaceDispatcher(EmbeddedCacheManager cacheManager) {
    GlobalComponentRegistry gcr = cacheManager.getGlobalComponentRegistry();
    JGroupsTransport transport = (JGroupsTransport) gcr.getComponent(Transport.class);
    RequestRepository requestRepository = (RequestRepository) TestingUtil.extractField(JGroupsTransport.class, transport, "requests");
    CountingRequestRepository instance = new CountingRequestRepository(requestRepository);
    TestingUtil.replaceField(instance, "requests", transport, JGroupsTransport.class);
    return instance;
}
Also used : JGroupsTransport(org.infinispan.remoting.transport.jgroups.JGroupsTransport) GlobalComponentRegistry(org.infinispan.factories.GlobalComponentRegistry) Transport(org.infinispan.remoting.transport.Transport) JGroupsTransport(org.infinispan.remoting.transport.jgroups.JGroupsTransport) RequestRepository(org.infinispan.remoting.transport.impl.RequestRepository)

Aggregations

RequestRepository (org.infinispan.remoting.transport.impl.RequestRepository)2 GlobalComponentRegistry (org.infinispan.factories.GlobalComponentRegistry)1 Start (org.infinispan.factories.annotations.Start)1 Transport (org.infinispan.remoting.transport.Transport)1 JGroupsTransport (org.infinispan.remoting.transport.jgroups.JGroupsTransport)1 RELAY2 (org.jgroups.protocols.relay.RELAY2)1