|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.abstracthorizon.danube.service.server.SocketChannelConnection
public class SocketChannelConnection
This is socket connection implementation.
org.abstracthorizon.danube.connection.socket.SocketConnection,
Connection| Field Summary | |
|---|---|
protected static Class<?>[] |
ADAPTING_CLASSES
Classes that are available through this object as an AdapterFactory |
protected InputStream |
cachedInputStream
Cached input stream |
protected OutputStream |
cachedOutputStream
Cached output stream |
protected SocketChannel |
socketChannel
Socket |
| Constructor Summary | |
|---|---|
SocketChannelConnection(AdapterManager adapterManager,
SocketChannel socketChannel)
Constructor. |
|
SocketChannelConnection(SocketChannel socketChannel)
Constructor. |
|
| Method Summary | ||
|---|---|---|
|
adapt(Class<T> cls)
Returns an object that is instance of asked class |
|
|
adapt(T object,
Class<T> cls)
Adopts given object to the instance of the asked class |
|
void |
close()
Closes the socket channel |
|
|
getAdaptingClasses(T object)
Returns list of classes to which given object can be adopted to by this adopter factory |
|
InputStream |
getInputStream()
Returns input stream |
|
OutputStream |
getOutputStream()
Returns output stream |
|
Socket |
getSocket()
Returns socket |
|
SocketChannel |
getSocketChannel()
Returns socket channel |
|
boolean |
isClosed()
Checks if socket is closed |
|
String |
toString()
Returns connection as a string |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final Class<?>[] ADAPTING_CLASSES
AdapterFactory
protected SocketChannel socketChannel
protected InputStream cachedInputStream
protected OutputStream cachedOutputStream
| Constructor Detail |
|---|
public SocketChannelConnection(SocketChannel socketChannel)
socket -
public SocketChannelConnection(AdapterManager adapterManager,
SocketChannel socketChannel)
socket - | Method Detail |
|---|
public SocketChannel getSocketChannel()
public Socket getSocket()
public InputStream getInputStream()
public OutputStream getOutputStream()
public void close()
close in interface Connectionpublic boolean isClosed()
isClosed in interface Connectiontrue if socket is closedpublic String toString()
toString in class Object
public <T> T adapt(T object,
Class<T> cls)
adapt in interface AdapterFactoryobject - object to he adoptedcls - asked class
public <T> T adapt(Class<T> cls)
Adaptable
adapt in interface Adaptablecls - class to be adapted to
public <T> Class<T>[] getAdaptingClasses(T object)
getAdaptingClasses in interface AdapterFactory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||