|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.AbstractTransport
org.glassfish.grizzly.nio.NIOTransport
org.glassfish.grizzly.nio.transport.UDPNIOTransport
public final class UDPNIOTransport
UDP NIO transport implementation
| Nested Class Summary | |
|---|---|
protected class |
UDPNIOTransport.RegisterChannelCompletionHandler
|
protected class |
UDPNIOTransport.TransportConnectorHandler
Transport default UDPNIOConnectorHandler. |
| Nested classes/interfaces inherited from interface org.glassfish.grizzly.Transport |
|---|
Transport.IOEventReg, Transport.State |
| Field Summary | |
|---|---|
protected AsyncQueueIO<java.net.SocketAddress> |
asyncQueueIO
Transport AsyncQueueIO |
protected int |
connectionTimeout
Default channel connection timeout |
protected UDPNIOTransport.RegisterChannelCompletionHandler |
registerChannelCompletionHandler
|
protected boolean |
reuseAddress
The socket reuseAddress |
protected java.util.Collection<UDPNIOServerConnection> |
serverConnections
The Server connections. |
protected int |
serverSocketSoTimeout
The server socket time out |
protected TemporarySelectorIO |
temporarySelectorIO
Server socket backlog. |
| Fields inherited from class org.glassfish.grizzly.nio.NIOTransport |
|---|
nioChannelDistributor, RANDOM, selectionKeyHandler, selectorHandler, selectorRunners, selectorRunnersCount |
| Fields inherited from class org.glassfish.grizzly.AbstractTransport |
|---|
attributeBuilder, connectionMonitoringConfig, isBlocking, isStandalone, kernelPool, kernelPoolConfig, managedWorkerPool, memoryManager, name, processor, processorSelector, readBufferSize, state, strategy, threadPoolMonitoringConfig, transportMonitoringConfig, workerPoolConfig, workerThreadPool, writeBufferSize |
| Constructor Summary | |
|---|---|
UDPNIOTransport()
|
|
UDPNIOTransport(java.lang.String name)
|
|
| Method Summary | |
|---|---|
UDPNIOServerConnection |
bind(int port)
Binds Transport to the specific port on localhost. |
UDPNIOServerConnection |
bind(java.net.SocketAddress socketAddress)
Binds Transport to the specific SocketAddress. |
UDPNIOServerConnection |
bind(java.net.SocketAddress socketAddress,
int backlog)
Binds Transport to the specific SocketAddress. |
UDPNIOServerConnection |
bind(java.lang.String host,
int port)
Binds Transport to the specific host and port. |
UDPNIOServerConnection |
bind(java.lang.String host,
int port,
int backlog)
Binds Transport to the specific host and port. |
UDPNIOServerConnection |
bind(java.lang.String host,
PortRange portRange,
int backlog)
Binds Transport to the specific host, and port within a PortRange. |
protected void |
closeConnection(Connection connection)
Close the connection, managed by Transport |
protected void |
configureNIOConnection(UDPNIOConnection connection)
|
void |
configureStandalone(boolean isStandalone)
|
GrizzlyFuture<Connection> |
connect()
Creates non-connected UDP Connection. |
GrizzlyFuture<Connection> |
connect(java.net.SocketAddress remoteAddress)
Creates, initializes and connects socket to the specific SocketAddress and returns Connection, representing socket. |
GrizzlyFuture<Connection> |
connect(java.net.SocketAddress remoteAddress,
CompletionHandler<Connection> completionHandler)
Creates, initializes and connects socket to the specific SocketAddress and returns Connection, representing socket. |
GrizzlyFuture<Connection> |
connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket. |
GrizzlyFuture<Connection> |
connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket. |
GrizzlyFuture<Connection> |
connect(java.lang.String host,
int port)
Creates, initializes and connects socket to the specific remote host and port and returns Connection, representing socket. |
protected JmxObject |
createJmxManagementObject()
Create the Transport JMX managment object. |
Transport.IOEventReg |
fireIOEvent(IOEvent ioEvent,
Connection connection,
IOEventProcessingHandler processingHandler)
Fires specific IOEvent on the Connection |
AsyncQueueIO |
getAsyncQueueIO()
Get asynchronous queue implementation. |
int |
getConnectionTimeout()
|
Reader |
getReader(boolean isBlocking)
Get the Reader implementation, depending on the requested mode. |
Reader |
getReader(Connection connection)
Get the Reader to read data from the Connection. |
TemporarySelectorIO |
getTemporarySelectorIO()
|
Filter |
getTransportFilter()
Get transport Filter, which is aware of Transport
specifics; knows how to read/write from/to Transport
specific Connection streams. |
Writer |
getWriter(boolean isBlocking)
Get the Writer implementation, depending on the requested mode. |
Writer |
getWriter(Connection connection)
Get the Writer to write data to the Connection. |
boolean |
isReuseAddress()
|
void |
pause()
Pauses the transport |
int |
read(UDPNIOConnection connection,
Buffer buffer)
|
int |
read(UDPNIOConnection connection,
Buffer buffer,
ReadResult<Buffer,java.net.SocketAddress> currentResult)
|
void |
resume()
Resumes the transport after a pause |
void |
setConnectionTimeout(int connectionTimeout)
|
void |
setReuseAddress(boolean reuseAddress)
|
void |
setTemporarySelectorIO(TemporarySelectorIO temporarySelectorIO)
|
void |
start()
Starts the transport |
void |
stop()
Stops the transport and closes all the connections |
void |
unbind(Connection connection)
Unbinds bound Transport connection. |
void |
unbindAll()
Unbinds all bound Transport connections. |
int |
write(UDPNIOConnection connection,
java.net.SocketAddress dstAddress,
Buffer buffer)
|
int |
write(UDPNIOConnection connection,
java.net.SocketAddress dstAddress,
Buffer buffer,
WriteResult<Buffer,java.net.SocketAddress> currentResult)
|
| Methods inherited from class org.glassfish.grizzly.nio.NIOTransport |
|---|
getNIOChannelDistributor, getSelectionKeyHandler, getSelectorHandler, getSelectorRunners, getSelectorRunnersCount, notifyProbesError, notifyProbesPause, notifyProbesResume, notifyProbesStart, notifyProbesStop, notifyTransportError, setNIOChannelDistributor, setSelectionKeyHandler, setSelectorHandler, setSelectorRunnersCount, startSelectorRunners, stopSelectorRunners |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final int serverSocketSoTimeout
protected boolean reuseAddress
protected int connectionTimeout
protected final java.util.Collection<UDPNIOServerConnection> serverConnections
protected final AsyncQueueIO<java.net.SocketAddress> asyncQueueIO
protected TemporarySelectorIO temporarySelectorIO
protected final UDPNIOTransport.RegisterChannelCompletionHandler registerChannelCompletionHandler
| Constructor Detail |
|---|
public UDPNIOTransport()
public UDPNIOTransport(java.lang.String name)
| Method Detail |
|---|
public UDPNIOServerConnection bind(int port)
throws java.io.IOException
bind in interface SocketBinderConnection
java.io.IOException
public UDPNIOServerConnection bind(java.lang.String host,
int port)
throws java.io.IOException
bind in interface SocketBinderhost - the local host the server will bind to
Connection
java.io.IOException
public UDPNIOServerConnection bind(java.lang.String host,
int port,
int backlog)
throws java.io.IOException
bind in interface SocketBinderhost - the local host the server will bind tobacklog - the maximum length of the queue
Connection
java.io.IOException
public UDPNIOServerConnection bind(java.net.SocketAddress socketAddress)
throws java.io.IOException
bind in interface SocketBindersocketAddress - the local address the server will bind to
Connection
java.io.IOException
public UDPNIOServerConnection bind(java.net.SocketAddress socketAddress,
int backlog)
throws java.io.IOException
bind in interface SocketBindersocketAddress - the local address the server will bind tobacklog - the maximum length of the queue
Connection
java.io.IOException
public UDPNIOServerConnection bind(java.lang.String host,
PortRange portRange,
int backlog)
throws java.io.IOException
PortRange.
bind in interface SocketBinderhost - the local host the server will bind toportRange - PortRange.backlog - the maximum length of the queue
Connection
java.io.IOException
public void unbind(Connection connection)
throws java.io.IOException
Transport connection.
unbind in interface SocketBinderconnection - Connection
java.io.IOException
public void unbindAll()
throws java.io.IOException
SocketBinderTransport connections.
unbindAll in interface SocketBinderjava.io.IOException
public GrizzlyFuture<Connection> connect()
throws java.io.IOException
Connection.
Connection.
java.io.IOException
public GrizzlyFuture<Connection> connect(java.lang.String host,
int port)
throws java.io.IOException
Connection, representing socket.
connect in interface SocketConnectorHandlerhost - remote host to connect to.port - remote port to connect to.
GrizzlyFuture of connect operation, which could be used to get
resulting Connection.
java.io.IOException
public GrizzlyFuture<Connection> connect(java.net.SocketAddress remoteAddress)
throws java.io.IOException
SocketAddress and returns Connection, representing socket.
connect in interface ConnectorHandler<java.net.SocketAddress>remoteAddress - remote address to connect to.
GrizzlyFuture of connect operation, which could be used to get
resulting Connection.
java.io.IOException
public GrizzlyFuture<Connection> connect(java.net.SocketAddress remoteAddress,
CompletionHandler<Connection> completionHandler)
throws java.io.IOException
SocketAddress and returns Connection, representing socket.
connect in interface ConnectorHandler<java.net.SocketAddress>remoteAddress - remote address to connect to.completionHandler - UDPNIOTransport.RegisterChannelCompletionHandler.
GrizzlyFuture of connect operation, which could be used to get
resulting Connection.
java.io.IOException
public GrizzlyFuture<Connection> connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
throws java.io.IOException
SocketAddress and returns Connection, representing socket.
connect in interface ConnectorHandler<java.net.SocketAddress>remoteAddress - remote address to connect to.localAddress - local address to bind socket to.
GrizzlyFuture of connect operation, which could be used to get
resulting Connection.
java.io.IOException
public GrizzlyFuture<Connection> connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
throws java.io.IOException
SocketAddress and returns Connection, representing socket.
connect in interface ConnectorHandler<java.net.SocketAddress>remoteAddress - remote address to connect to.localAddress - local address to bind socket to.completionHandler - UDPNIOTransport.RegisterChannelCompletionHandler.
GrizzlyFuture of connect operation, which could be used to get
resulting Connection.
java.io.IOException
protected void closeConnection(Connection connection)
throws java.io.IOException
AbstractTransport
closeConnection in class NIOTransportjava.io.IOException
public void start()
throws java.io.IOException
AbstractTransport
start in interface Transportstart in class AbstractTransportjava.io.IOException
public void stop()
throws java.io.IOException
AbstractTransport
stop in interface Transportstop in class AbstractTransportjava.io.IOException
public void pause()
throws java.io.IOException
AbstractTransport
pause in interface Transportpause in class AbstractTransportjava.io.IOException
public void resume()
throws java.io.IOException
AbstractTransport
resume in interface Transportresume in class AbstractTransportjava.io.IOExceptionpublic void configureStandalone(boolean isStandalone)
configureStandalone in interface Transportpublic Filter getTransportFilter()
FilterChainEnabledTransportFilter, which is aware of Transport
specifics; knows how to read/write from/to Transport
specific Connection streams.
Each Transport should provide transport Filter
implementation.
getTransportFilter in interface FilterChainEnabledTransportFilter, which is aware of Transport
specifics; knows how to read/write from/to Transport
specific Connections.public AsyncQueueIO getAsyncQueueIO()
AsyncQueueEnabledTransport
getAsyncQueueIO in interface AsyncQueueEnabledTransportpublic TemporarySelectorIO getTemporarySelectorIO()
getTemporarySelectorIO in interface TemporarySelectorsEnabledTransportpublic void setTemporarySelectorIO(TemporarySelectorIO temporarySelectorIO)
setTemporarySelectorIO in interface TemporarySelectorsEnabledTransportpublic int getConnectionTimeout()
public void setConnectionTimeout(int connectionTimeout)
public boolean isReuseAddress()
public void setReuseAddress(boolean reuseAddress)
public Transport.IOEventReg fireIOEvent(IOEvent ioEvent,
Connection connection,
IOEventProcessingHandler processingHandler)
throws java.io.IOException
TransportIOEvent on the Connection
fireIOEvent in interface TransportioEvent - I/O eventconnection - Connection, on which we fire the event.processingHandler - I/O event processing handler.
java.io.IOExceptionpublic Reader getReader(Connection connection)
Reader to read data from the Connection.
The Transport may decide to return blocking or non-blocking Reader
depending on the Connection settings.
getReader in interface Transportconnection - Connection.
Reader.public Reader getReader(boolean isBlocking)
Reader implementation, depending on the requested mode.
getReader in interface TransportisBlocking - blocking mode.
Reader.public Writer getWriter(Connection connection)
Writer to write data to the Connection.
The Transport may decide to return blocking or non-blocking Writer
depending on the Connection settings.
getWriter in interface Transportconnection - Connection.
Writer.public Writer getWriter(boolean isBlocking)
Writer implementation, depending on the requested mode.
getWriter in interface TransportisBlocking - blocking mode.
Writer.
public int read(UDPNIOConnection connection,
Buffer buffer)
throws java.io.IOException
java.io.IOException
public int read(UDPNIOConnection connection,
Buffer buffer,
ReadResult<Buffer,java.net.SocketAddress> currentResult)
throws java.io.IOException
java.io.IOException
public int write(UDPNIOConnection connection,
java.net.SocketAddress dstAddress,
Buffer buffer)
throws java.io.IOException
java.io.IOException
public int write(UDPNIOConnection connection,
java.net.SocketAddress dstAddress,
Buffer buffer,
WriteResult<Buffer,java.net.SocketAddress> currentResult)
throws java.io.IOException
java.io.IOExceptionprotected void configureNIOConnection(UDPNIOConnection connection)
protected JmxObject createJmxManagementObject()
createJmxManagementObject in class AbstractTransport
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||