Class NIOTransport
- java.lang.Object
-
- org.apache.activemq.util.ServiceSupport
-
- org.apache.activemq.transport.TransportSupport
-
- org.apache.activemq.transport.TransportThreadSupport
-
- org.apache.activemq.transport.tcp.TcpTransport
-
- org.apache.activemq.transport.nio.NIOTransport
-
- Direct Known Subclasses:
AutoNIOTransport
,NIOSSLTransport
public class NIOTransport extends TcpTransport
An implementation of theTransport
interface using raw tcp/ip
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.activemq.transport.tcp.TcpTransport
TcpTransport.InitBuffer
-
-
Field Summary
Fields Modifier and Type Field Description protected SocketChannel
channel
protected ByteBuffer
currentBuffer
protected ByteBuffer
inputBuffer
protected int
nextFrameSize
protected SelectorSelection
selection
-
Fields inherited from class org.apache.activemq.transport.tcp.TcpTransport
buffOut, closeAsync, connectionTimeout, dataIn, dataOut, diffServChosen, dynamicManagement, initBuffer, ioBufferSize, jmxPort, localLocation, logWriterName, minmumWireFormatVersion, receiveCounter, remoteLocation, socket, socketBufferSize, socketFactory, socketOptions, soTimeout, startLogging, stoppedLatch, trace, trafficClass, typeOfServiceChosen, useLocalHost, wireFormat
-
-
Constructor Summary
Constructors Constructor Description NIOTransport(WireFormat wireFormat, Socket socket)
NIOTransport(WireFormat format, Socket socket, TcpTransport.InitBuffer initBuffer)
NIOTransport(WireFormat wireFormat, SocketFactory socketFactory, URI remoteLocation, URI localLocation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doStart()
protected void
doStop(ServiceStopper stopper)
protected void
initializeStreams()
protected int
readFromBuffer()
protected void
serviceRead()
-
Methods inherited from class org.apache.activemq.transport.tcp.TcpTransport
closeStreams, connect, doRun, getConnectionTimeout, getDiffServ, getIoBufferSize, getJmxPort, getKeepAlive, getLogWriterName, getMinmumWireFormatVersion, getPeerCertificates, getReceiveCounter, getRemoteAddress, getSocketBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTypeOfService, getWireFormat, initialiseSocket, isCloseAsync, isDynamicManagement, isStartLogging, isTrace, isUseLocalHost, narrow, oneway, readCommand, resolveHostName, run, setCloseAsync, setConnectionTimeout, setDiffServ, setDynamicManagement, setIoBufferSize, setJmxPort, setKeepAlive, setLogWriterName, setMinmumWireFormatVersion, setPeerCertificates, setSocketBufferSize, setSocketOptions, setSoLinger, setSoTimeout, setStartLogging, setTcpNoDelay, setTrace, setTypeOfService, setUseLocalHost, stop, toString
-
Methods inherited from class org.apache.activemq.transport.TransportThreadSupport
getStackSize, isDaemon, setDaemon, setStackSize
-
Methods inherited from class org.apache.activemq.transport.TransportSupport
asyncRequest, checkStarted, doConsume, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, onException, reconnect, request, request, setTransportListener, updateURIs
-
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.transport.Transport
asyncRequest, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, reconnect, request, request, setTransportListener, updateURIs
-
-
-
-
Field Detail
-
channel
protected SocketChannel channel
-
selection
protected SelectorSelection selection
-
inputBuffer
protected ByteBuffer inputBuffer
-
currentBuffer
protected ByteBuffer currentBuffer
-
nextFrameSize
protected int nextFrameSize
-
-
Constructor Detail
-
NIOTransport
public NIOTransport(WireFormat wireFormat, SocketFactory socketFactory, URI remoteLocation, URI localLocation) throws UnknownHostException, IOException
- Throws:
UnknownHostException
IOException
-
NIOTransport
public NIOTransport(WireFormat wireFormat, Socket socket) throws IOException
- Throws:
IOException
-
NIOTransport
public NIOTransport(WireFormat format, Socket socket, TcpTransport.InitBuffer initBuffer) throws IOException
- Parameters:
format
-socket
-initBuffer
-- Throws:
IOException
-
-
Method Detail
-
initializeStreams
protected void initializeStreams() throws IOException
- Overrides:
initializeStreams
in classTcpTransport
- Throws:
IOException
-
readFromBuffer
protected int readFromBuffer() throws IOException
- Throws:
IOException
-
serviceRead
protected void serviceRead()
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classTcpTransport
- Throws:
Exception
-
doStop
protected void doStop(ServiceStopper stopper) throws Exception
- Overrides:
doStop
in classTcpTransport
- Throws:
Exception
-
-