|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfreerails.network.LocalConnection
public class LocalConnection
A connection between the a client and server in the same JVM.
| Field Summary | |
|---|---|
private SychronizedQueue |
fromClient
|
private SychronizedQueue |
fromServer
|
static java.lang.String |
SERVER_IN_SAME_JVM
|
private SynchronizedFlag |
status
|
| Constructor Summary | |
|---|---|
LocalConnection()
|
|
| Method Summary | |
|---|---|
void |
disconnect()
Disconnect from the client. |
void |
flush()
Flush the underlying stream. |
java.lang.String |
getServerDetails()
|
boolean |
isOpen()
Returns true if this connection is open. |
FreerailsSerializable[] |
readFromClient()
Returns an array containing all the objects read from the client since the last time this method or waitForObjectFromClient() was called, if no objects have been received, it returns an empty array rather than blocking. |
FreerailsSerializable[] |
readFromServer()
Returns an array containing all the objects read from the server since the last time this method or waitForObjectFromServer() was called, if no objects have been received, it returns an empty array rather than blocking. |
FreerailsSerializable |
waitForObjectFromClient()
Returns the next object read from the client, blocking if non is available. |
FreerailsSerializable |
waitForObjectFromServer()
Returns the next object read from the server, blocking if non is available. |
void |
writeToClient(FreerailsSerializable object)
Sends the specified object to the client. |
void |
writeToServer(FreerailsSerializable object)
Sends the specified object to the server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SERVER_IN_SAME_JVM
private final SychronizedQueue fromServer
private final SychronizedQueue fromClient
private final SynchronizedFlag status
| Constructor Detail |
|---|
public LocalConnection()
| Method Detail |
|---|
public FreerailsSerializable[] readFromClient()
throws java.io.IOException
Connection2Client
readFromClient in interface Connection2Clientjava.io.IOException
public FreerailsSerializable waitForObjectFromClient()
throws java.io.IOException,
java.lang.InterruptedException
Connection2Client
waitForObjectFromClient in interface Connection2Clientjava.io.IOException
java.lang.InterruptedException
public void writeToClient(FreerailsSerializable object)
throws java.io.IOException
Connection2Client
writeToClient in interface Connection2Clientjava.io.IOException
public FreerailsSerializable[] readFromServer()
throws java.io.IOException
Connection2Server
readFromServer in interface Connection2Serverjava.io.IOException
public FreerailsSerializable waitForObjectFromServer()
throws java.io.IOException,
java.lang.InterruptedException
Connection2Server
waitForObjectFromServer in interface Connection2Serverjava.io.IOException
java.lang.InterruptedException
public void writeToServer(FreerailsSerializable object)
throws java.io.IOException
Connection2Server
writeToServer in interface Connection2Serverjava.io.IOExceptionpublic boolean isOpen()
Connection2Client
isOpen in interface Connection2ClientisOpen in interface Connection2Serverpublic void flush()
Connection2Client
flush in interface Connection2Clientflush in interface Connection2Serverpublic void disconnect()
Connection2Client
disconnect in interface Connection2Clientdisconnect in interface Connection2Serverpublic java.lang.String getServerDetails()
getServerDetails in interface Connection2Server
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||