Class NettyTransport
java.lang.Object
org.infinispan.server.core.transport.NettyTransport
- All Implemented Interfaces:
Transport
@MBean(objectName="Transport",
description="Transport component manages read and write operations to/from server.")
public class NettyTransport
extends Object
implements Transport
A Netty based transport.
- Since:
- 4.1
- Author:
- Galder ZamarreƱo, wburns
-
Constructor Summary
ConstructorDescriptionNettyTransport
(InetSocketAddress address, ProtocolServerConfiguration configuration, String threadNamePrefix, EmbeddedCacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionstatic io.netty.channel.MultithreadEventLoopGroup
buildEventLoop
(int nThreads, ThreadFactory threadFactory, String configuration) closeChannels
(io.netty.channel.group.ChannelMatcher channelMatcher) io.netty.channel.group.ChannelGroup
int
int
int
int
int
int
getPort()
int
int
boolean
long
long
void
initializeHandler
(io.netty.channel.ChannelInitializer<io.netty.channel.Channel> handler) boolean
void
start()
void
stop()
void
updateTotalBytesRead
(int bytes) void
updateTotalBytesWritten
(int bytes)
-
Constructor Details
-
NettyTransport
public NettyTransport(InetSocketAddress address, ProtocolServerConfiguration configuration, String threadNamePrefix, EmbeddedCacheManager cacheManager)
-
-
Method Details
-
initializeHandler
public void initializeHandler(io.netty.channel.ChannelInitializer<io.netty.channel.Channel> handler) -
start
@ManagedOperation(description="Starts the transport", displayName="Starts the transport", name="start") public void start() -
stop
@ManagedOperation(description="Stops the transport", displayName="Stops the transport", name="stop") public void stop() -
isRunning
@ManagedAttribute(description="Returns whether the transport is running", displayName="Transport running", dataType=TRAIT) public boolean isRunning() -
getTotalBytesWritten
@ManagedAttribute(description="Returns the total number of bytes written by the server back to clients which includes both protocol and user information.", displayName="Number of total number of bytes written", measurementType=TRENDSUP) public long getTotalBytesWritten()- Specified by:
getTotalBytesWritten
in interfaceTransport
-
getTotalBytesRead
@ManagedAttribute(description="Returns the total number of bytes read by the server from clients which includes both protocol and user information.", displayName="Number of total number of bytes read", measurementType=TRENDSUP) public long getTotalBytesRead()- Specified by:
getTotalBytesRead
in interfaceTransport
-
getHostName
@ManagedAttribute(description="Returns the host to which the transport binds.", displayName="Host name", dataType=TRAIT) public String getHostName()- Specified by:
getHostName
in interfaceTransport
-
getPort
@ManagedAttribute(description="Returns the port to which the transport binds.", displayName="Port", dataType=TRAIT) public int getPort() -
getNumberIOThreads
@ManagedAttribute(description="Returns the number of I/O threads.", displayName="Number of I/O threads") public int getNumberIOThreads()- Specified by:
getNumberIOThreads
in interfaceTransport
-
getPendingTasks
@ManagedAttribute(description="Returns the number of pending tasks.", displayName="Pending tasks") public int getPendingTasks()- Specified by:
getPendingTasks
in interfaceTransport
-
getIdleTimeout
@ManagedAttribute(description="Returns the idle timeout.", displayName="Idle timeout", dataType=TRAIT) public int getIdleTimeout()- Specified by:
getIdleTimeout
in interfaceTransport
-
getTcpNoDelay
@ManagedAttribute(description="Returns whether TCP no delay was configured or not.", displayName="TCP no delay", dataType=TRAIT) public boolean getTcpNoDelay()- Specified by:
getTcpNoDelay
in interfaceTransport
-
getSendBufferSize
@ManagedAttribute(description="Returns the send buffer size.", displayName="Send buffer size", dataType=TRAIT) public int getSendBufferSize()- Specified by:
getSendBufferSize
in interfaceTransport
-
getReceiveBufferSize
@ManagedAttribute(description="Returns the receive buffer size.", displayName="Receive buffer size", dataType=TRAIT) public int getReceiveBufferSize()- Specified by:
getReceiveBufferSize
in interfaceTransport
-
getNumberOfLocalConnections
@ManagedAttribute(description="Returns a count of active connections this server.", displayName="Local active connections") public int getNumberOfLocalConnections()- Specified by:
getNumberOfLocalConnections
in interfaceTransport
-
getNumberOfGlobalConnections
@ManagedAttribute(description="Returns a count of active connections in the cluster. This operation will make remote calls to aggregate results, so latency might have an impact on the speed of calculation of this attribute.", displayName="Cluster-wide number of active connections", clusterWide=true) public int getNumberOfGlobalConnections()- Specified by:
getNumberOfGlobalConnections
in interfaceTransport
-
updateTotalBytesWritten
public void updateTotalBytesWritten(int bytes) -
updateTotalBytesRead
public void updateTotalBytesRead(int bytes) -
closeChannels
- Specified by:
closeChannels
in interfaceTransport
-
getAcceptedChannels
public io.netty.channel.group.ChannelGroup getAcceptedChannels()- Specified by:
getAcceptedChannels
in interfaceTransport
-
buildEventLoop
public static io.netty.channel.MultithreadEventLoopGroup buildEventLoop(int nThreads, ThreadFactory threadFactory, String configuration)
-