use of org.infinispan.server.core.transport.NettyTransport in project infinispan by infinispan.
the class AbstractProtocolServer method startTransport.
protected void startTransport() {
log.debugf("Starting Netty transport for %s on %s:%s", configuration.name(), configuration.host(), configuration.port());
InetSocketAddress address = new InetSocketAddress(configuration.host(), configuration.port());
transport = new NettyTransport(address, configuration, getQualifiedName(), cacheManager);
transport.initializeHandler(getInitializer());
// Register transport and worker MBeans regardless
registerServerMBeans();
try {
transport.start();
} catch (Throwable re) {
try {
unregisterServerMBeans();
} catch (Exception e) {
throw new CacheException(e);
}
throw re;
}
registerMetrics();
}
use of org.infinispan.server.core.transport.NettyTransport in project infinispan by infinispan.
the class SinglePortEndpointRouter method start.
@Override
public void start(RoutingTable routingTable, EmbeddedCacheManager ecm) {
this.routingTable = routingTable;
this.routingTable.streamRoutes().forEach(r -> r.getRouteDestination().getProtocolServer().setEnclosingProtocolServer(this));
this.cacheManager = ecm;
InetSocketAddress address = new InetSocketAddress(configuration.host(), configuration.port());
transport = new NettyTransport(address, configuration, getQualifiedName(), cacheManager);
transport.initializeHandler(getInitializer());
if (cacheManager != null) {
BasicComponentRegistry bcr = getGlobalComponentRegistry(cacheManager).getComponent(BasicComponentRegistry.class);
bcr.replaceComponent(getQualifiedName(), this, false);
}
registerServerMBeans();
try {
transport.start();
} catch (Throwable re) {
try {
unregisterServerMBeans();
} catch (Exception e) {
re.addSuppressed(e);
}
throw re;
}
registerMetrics();
RouterLogger.SERVER.debugf("REST EndpointRouter listening on %s:%d", transport.getHostName(), transport.getPort());
}
Aggregations