|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnetwork.AbCommsDG
public abstract class AbCommsDG
Created on November 8, 2006, 4:31 PM
Abstract comms used as the parent for SendComms and RecieveComms.
Uses datagrams to handle the communications.
Sending or waiting for acks is handled by the classes that implement AbCommsDG.
Each child implements and uses the socket, packet, remoteHost, and connectedAddress variables differently.
Created to help simplify and organize communications.
| Constructor Summary | |
|---|---|
AbCommsDG()
Creates a new instance of AbCommsDG |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the property change listener. |
byte[] |
getBuffer()
Gets the buffer to be sent. |
java.net.InetAddress |
getConnectedAddress()
Gets the address connected to. |
java.net.DatagramPacket |
getPacket()
Gets the packet used for communications. |
int |
getPort()
Gets the port number. |
java.beans.PropertyChangeSupport |
getPropertySupport()
Gets the property change support. |
java.lang.String |
getRemoteHost()
Gets the remote host. |
java.lang.Thread |
getRunner()
Gets the current thread that is running. |
java.net.DatagramSocket |
getSocket()
Gets the datagram socket. |
boolean |
isAckRequired()
The ack state. |
boolean |
isAlreadyConnected()
The state of the connection. |
boolean |
isPauseComms()
The pause state of communications. |
boolean |
isRunning()
The running state of the thread. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the property change listener. |
abstract void |
run()
Runs the thread. |
void |
setAckRequired(boolean ackRequired)
Sets the ack state. |
void |
setAlreadyConnected(boolean alreadyConnected)
Set the connection state. |
void |
setBuffer(byte[] buffer)
Sets the buffer with the byte array containing the data to be sent. |
void |
setConnectedAddress(java.net.InetAddress connectedAddress)
Sets teh connected address. |
void |
setPacket(java.net.DatagramPacket packet)
Sets the datagram packet used for communications. |
void |
setPauseComms(boolean pauseComms)
Set the pause state of communications. |
void |
setPort(int port)
Sets the port number to send to. |
void |
setRemoteHost(java.lang.String remoteHost)
Sets the remote host. |
void |
setRunner(java.lang.Thread runner)
Sets the currently running thread. |
void |
setRunning(boolean running)
Sets the running state of the thread. |
void |
setSocket(java.net.DatagramSocket socket)
Sets the data gram socket. |
void |
startComms()
Starts the communications. |
void |
stopComms()
Stops the communications. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbCommsDG()
| Method Detail |
|---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The new listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The listener to remove.public java.beans.PropertyChangeSupport getPropertySupport()
public java.lang.Thread getRunner()
public void setRunner(java.lang.Thread runner)
runner - THe new thread that is running.public boolean isRunning()
public void setRunning(boolean running)
running - The new running state, true if running, otherwise false.public boolean isPauseComms()
public void setPauseComms(boolean pauseComms)
pauseComms - The new pause state, true if paused, otheriwse false.public java.lang.String getRemoteHost()
public void setRemoteHost(java.lang.String remoteHost)
remoteHost - The new remote host.public java.net.DatagramPacket getPacket()
public void setPacket(java.net.DatagramPacket packet)
packet - The new datagram packet.public java.net.DatagramSocket getSocket()
public void setSocket(java.net.DatagramSocket socket)
socket - The socket used for communications.public boolean isAlreadyConnected()
public void setAlreadyConnected(boolean alreadyConnected)
alreadyConnected - The new connection sate, true if connected, false if not.public java.net.InetAddress getConnectedAddress()
public void setConnectedAddress(java.net.InetAddress connectedAddress)
connectedAddress - The new connected address.public int getPort()
public void setPort(int port)
port - The new port number.public byte[] getBuffer()
public void setBuffer(byte[] buffer)
buffer - The buffer array containing the data.public boolean isAckRequired()
public void setAckRequired(boolean ackRequired)
ackRequired - True if an ack is required. Otherwise false.public void startComms()
public void stopComms()
public abstract void run()
run in interface java.lang.Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||