synergynetframework.appsystem.services.net.objectmessaging
Class Client

java.lang.Object
  extended by synergynetframework.appsystem.services.net.objectmessaging.connections.ConnectionHandler
      extended by synergynetframework.appsystem.services.net.objectmessaging.Client
All Implemented Interfaces:
java.lang.Runnable, EndPoint

public class Client
extends ConnectionHandler
implements EndPoint

The Class Client.


Field Summary
static java.util.logging.Logger log
          The Constant log.
 
Fields inherited from class synergynetframework.appsystem.services.net.objectmessaging.connections.ConnectionHandler
udpRemoteAddress
 
Constructor Summary
Client()
          Instantiates a new client.
Client(int bufferSize)
          Instantiates a new client.
 
Method Summary
 void addMessageHandler(MessageHandler handler)
          Adds the message handler.
 void close()
          Close.
 void connect(int timeout, java.net.InetAddress host, int tcpPort)
          Connect.
 void connect(int timeout, java.net.InetAddress host, int tcpPort, int udpPort)
          Connect.
 void connect(int timeout, java.lang.String host, int tcpPort)
          Connect.
 void connect(int timeout, java.lang.String host, int tcpPort, int udpPort)
          Connect.
 java.lang.Thread getUpdateThread()
          Gets the update thread.
 boolean isConnected()
          Checks if is connected.
 void removeMessageHandler(MessageHandler listener)
          Removes the message handler.
 void run()
           
 void stop()
          Stop.
 void update(int timeout)
          Update.
 
Methods inherited from class synergynetframework.appsystem.services.net.objectmessaging.connections.ConnectionHandler
getEndPoint, getID, getRemoteAddressTCP, getRemoteAddressUDP, getTCPConnection, getUDPConnection, notifyConnected, notifyReceived, sendMessage, sendTCP, sendUDP, setEndPoint, setID, setName, setTCPAliveTime, setTCPConnection, setUDPConnection, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final java.util.logging.Logger log
The Constant log.

Constructor Detail

Client

public Client()
Instantiates a new client.


Client

public Client(int bufferSize)
Instantiates a new client.

Parameters:
bufferSize - the buffer size
Method Detail

addMessageHandler

public void addMessageHandler(MessageHandler handler)
Description copied from class: ConnectionHandler
Adds the message handler.

Specified by:
addMessageHandler in interface EndPoint
Overrides:
addMessageHandler in class ConnectionHandler
Parameters:
handler - the handler

close

public void close()
Description copied from class: ConnectionHandler
Close.

Specified by:
close in interface EndPoint
Overrides:
close in class ConnectionHandler

connect

public void connect(int timeout,
                    java.net.InetAddress host,
                    int tcpPort)
             throws java.io.IOException
Connect.

Parameters:
timeout - the timeout
host - the host
tcpPort - the tcp port
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

connect

public void connect(int timeout,
                    java.net.InetAddress host,
                    int tcpPort,
                    int udpPort)
             throws java.io.IOException
Connect.

Parameters:
timeout - the timeout
host - the host
tcpPort - the tcp port
udpPort - the udp port
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

connect

public void connect(int timeout,
                    java.lang.String host,
                    int tcpPort)
             throws java.io.IOException
Connect.

Parameters:
timeout - the timeout
host - the host
tcpPort - the tcp port
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

connect

public void connect(int timeout,
                    java.lang.String host,
                    int tcpPort,
                    int udpPort)
             throws java.io.IOException
Connect.

Parameters:
timeout - the timeout
host - the host
tcpPort - the tcp port
udpPort - the udp port
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

getUpdateThread

public java.lang.Thread getUpdateThread()
Description copied from interface: EndPoint
Gets the update thread.

Specified by:
getUpdateThread in interface EndPoint
Returns:
the update thread

isConnected

public boolean isConnected()
Checks if is connected.

Returns:
true, if is connected

removeMessageHandler

public void removeMessageHandler(MessageHandler listener)
Description copied from class: ConnectionHandler
Removes the message handler.

Specified by:
removeMessageHandler in interface EndPoint
Overrides:
removeMessageHandler in class ConnectionHandler
Parameters:
listener - the handler

run

public void run()
Specified by:
run in interface java.lang.Runnable
Specified by:
run in interface EndPoint

stop

public void stop()
Description copied from interface: EndPoint
Stop.

Specified by:
stop in interface EndPoint

update

public void update(int timeout)
            throws java.io.IOException,
                   SerializationException
Description copied from interface: EndPoint
Update.

Specified by:
update in interface EndPoint
Parameters:
timeout - the timeout
Throws:
java.io.IOException - Signals that an I/O exception has occurred.
SerializationException - the serialization exception