|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.abstracthorizon.danube.service.server.SocketConnection
public class SocketConnection
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 Socket |
socket
Socket |
Constructor Summary | |
---|---|
SocketConnection(AdapterManager adapterManager,
Socket socket)
Constructor. |
|
SocketConnection(Socket socket)
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 connection - closes the underlaying socket. |
|
|
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 |
|
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 Socket socket
protected InputStream cachedInputStream
protected OutputStream cachedOutputStream
Constructor Detail |
---|
public SocketConnection(Socket socket)
socket
- socketpublic SocketConnection(AdapterManager adapterManager, Socket socket)
socket
- socketMethod Detail |
---|
public Socket getSocket()
public InputStream getInputStream()
public OutputStream getOutputStream()
public void close()
close
in interface Connection
public boolean isClosed()
isClosed
in interface Connection
true
when socket is closedpublic String toString()
toString
in class Object
public <T> T adapt(T object, Class<T> cls)
adapt
in interface AdapterFactory
object
- object to he adoptedcls
- asked class
public <T> T adapt(Class<T> cls)
Adaptable
adapt
in interface Adaptable
cls
- 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 |