|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Connection<L>
Common interface, which represents any kind of connection.
| Nested Class Summary | |
|---|---|
static interface |
Connection.CloseListener
The listener, which is used to be notified, when Connection gets closed. |
| Method Summary | |
|---|---|
void |
addCloseListener(Connection.CloseListener closeListener)
Add the Connection.CloseListener, which will be notified once Connection
will be closed. |
GrizzlyFuture<Connection> |
close()
Close the Connection |
GrizzlyFuture<Connection> |
close(CompletionHandler<Connection> completionHandler)
Close the Connection |
void |
configureBlocking(boolean isBlocking)
Sets the Connection mode. |
void |
configureStandalone(boolean isStandalone)
|
void |
disableIOEvent(IOEvent ioEvent)
|
void |
enableIOEvent(IOEvent ioEvent)
|
L |
getLocalAddress()
Get the connection local address |
MonitoringConfig<ConnectionProbe> |
getMonitoringConfig()
Return the object associated MonitoringConfig. |
L |
getPeerAddress()
Get the connection peer address |
Processor |
getProcessor()
Gets the default Processor, which will process Connection
I/O events. |
ProcessorSelector |
getProcessorSelector()
Gets the default ProcessorSelector, which will be used to get
Processor to process Connection I/O events, in case if
this Connection's Processor is null. |
int |
getReadBufferSize()
Get the default size of Buffers, which will be allocated for
reading data from Connection. |
long |
getReadTimeout(java.util.concurrent.TimeUnit timeUnit)
|
Transport |
getTransport()
Get the Transport, to which this Connection belongs to. |
int |
getWriteBufferSize()
Get the default size of Buffers, which will be allocated for
writing data to Connection. |
long |
getWriteTimeout(java.util.concurrent.TimeUnit timeUnit)
|
boolean |
isBlocking()
|
boolean |
isOpen()
Is Connection open and ready. |
boolean |
isStandalone()
|
void |
notifyConnectionError(java.lang.Throwable error)
Method gets invoked, when error occur during the Connection lifecycle. |
Processor |
obtainProcessor(IOEvent ioEvent)
Gets the Processor, which will process Connection
I/O event. |
boolean |
removeCloseListener(Connection.CloseListener closeListener)
Remove the Connection.CloseListener. |
void |
setProcessor(Processor preferableProcessor)
Sets the default Processor, which will process Connection
I/O events. |
void |
setProcessorSelector(ProcessorSelector preferableProcessorSelector)
Sets the default ProcessorSelector, which will be used to get
Processor to process Connection I/O events, in case if
this Connection's Processor is null. |
void |
setReadBufferSize(int readBufferSize)
Set the default size of Buffers, which will be allocated for
reading data from Connection. |
void |
setReadTimeout(long timeout,
java.util.concurrent.TimeUnit timeUnit)
|
void |
setWriteBufferSize(int writeBufferSize)
Set the default size of Buffers, which will be allocated for
writing data to Connection. |
void |
setWriteTimeout(long timeout,
java.util.concurrent.TimeUnit timeUnit)
|
| Methods inherited from interface org.glassfish.grizzly.Readable |
|---|
read, read |
| Methods inherited from interface org.glassfish.grizzly.Writable |
|---|
write, write, write |
| Methods inherited from interface org.glassfish.grizzly.attributes.AttributeStorage |
|---|
getAttributes |
| Method Detail |
|---|
Transport getTransport()
Transport, to which this Connection belongs to.
Transport, to which this Connection belongs to.boolean isOpen()
Connection open and ready.
Returns true, if connection is open and ready, or false
otherwise.
void configureBlocking(boolean isBlocking)
Connection mode.
isBlocking - the Connection mode. true,
if Connection should operate in blocking mode, or
false otherwise.boolean isBlocking()
Connection mode.
true, if Connection is operating in blocking mode, or
false otherwise.void configureStandalone(boolean isStandalone)
boolean isStandalone()
Processor obtainProcessor(IOEvent ioEvent)
Processor, which will process Connection
I/O event.
If Processor is null, - then Transport will try
to get Processor using Connection's
ProcessorSelector.select(IOEvent, Connection). If
ProcessorSelector, associated withthe Connection is also
null - will ask Transport for a Processor.
Processor, which will process
Connection I/O events.Processor getProcessor()
Processor, which will process Connection
I/O events.
If Processor is null, - then Transport will try
to get Processor using Connection's
ProcessorSelector.select(IOEvent, Connection). If
ProcessorSelector, associated withthe Connection is also
null - Transport will try to get Processor
using own settings.
Processor, which will process
Connection I/O events.void setProcessor(Processor preferableProcessor)
Processor, which will process Connection
I/O events.
If Processor is null, - then Transport will try
to get Processor using Connection's
ProcessorSelector.select(IOEvent, Connection). If
ProcessorSelector, associated withthe Connection is also
null - Transport will try to get Processor
using own settings.
preferableProcessor - the default Processor, which will
process Connection I/O events.ProcessorSelector getProcessorSelector()
ProcessorSelector, which will be used to get
Processor to process Connection I/O events, in case if
this Connection's Processor is null.
ProcessorSelector, which will be used to get
Processor to process Connection I/O events, in case if
this Connection's Processor is null.void setProcessorSelector(ProcessorSelector preferableProcessorSelector)
ProcessorSelector, which will be used to get
Processor to process Connection I/O events, in case if
this Connection's Processor is null.
preferableProcessorSelector - the default ProcessorSelector,
which will be used to get Processor to process Connection
I/O events, in case if this Connection's Processor
is null.L getPeerAddress()
L getLocalAddress()
GrizzlyFuture<Connection> close()
throws java.io.IOException
Connection
close in interface Closeable<Connection>Future, which could be checked in case, if close operation
will be run asynchronously
java.io.IOException - if I/O error was detected
during Connection closing.
GrizzlyFuture<Connection> close(CompletionHandler<Connection> completionHandler)
throws java.io.IOException
Connection
close in interface Closeable<Connection>completionHandler - CompletionHandler to be called, when
the connection is closed.
Future, which could be checked in case, if close operation
will be run asynchronously
java.io.IOException - if I/O error was detected
during Connection closing.int getReadBufferSize()
Buffers, which will be allocated for
reading data from Connection.
Buffers, which will be allocated for
reading data from Connection.void setReadBufferSize(int readBufferSize)
Buffers, which will be allocated for
reading data from Connection.
readBufferSize - the default size of Buffers, which will
be allocated for reading data from Connection.int getWriteBufferSize()
Buffers, which will be allocated for
writing data to Connection.
Buffers, which will be allocated for
writing data to Connection.void setWriteBufferSize(int writeBufferSize)
Buffers, which will be allocated for
writing data to Connection.
writeBufferSize - the default size of Buffers, which will
be allocated for writing data to Connection.long getReadTimeout(java.util.concurrent.TimeUnit timeUnit)
void setReadTimeout(long timeout,
java.util.concurrent.TimeUnit timeUnit)
long getWriteTimeout(java.util.concurrent.TimeUnit timeUnit)
void setWriteTimeout(long timeout,
java.util.concurrent.TimeUnit timeUnit)
void enableIOEvent(IOEvent ioEvent)
throws java.io.IOException
java.io.IOException
void disableIOEvent(IOEvent ioEvent)
throws java.io.IOException
java.io.IOExceptionMonitoringConfig<ConnectionProbe> getMonitoringConfig()
MonitoringAwareMonitoringConfig.
getMonitoringConfig in interface MonitoringAware<ConnectionProbe>MonitoringConfig.void addCloseListener(Connection.CloseListener closeListener)
Connection.CloseListener, which will be notified once Connection
will be closed.
closeListener - Connection.CloseListener.boolean removeCloseListener(Connection.CloseListener closeListener)
Connection.CloseListener.
closeListener - Connection.CloseListener.void notifyConnectionError(java.lang.Throwable error)
error - Throwable.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||