Interface semper.comm.ComPoint
All Packages Class Hierarchy This Package Previous Next Index
Interface semper.comm.ComPoint
- public interface ComPoint
- extends Object
- extends ComPointConstants
This abstract class defines the generic interface to the
communication modules. It is subclassed to provide an
actual implementation, such as ComPointTCP.
- Version:
- beta-4, 12.8.96
- Author:
- Mehdi Nassehi
-
accept()
- Waits for and returns a Responder ComPoint when a message arrives.
-
close()
- Closes the ComPoint.
-
comPoint(int, ComPointAddress)
- Creates an initiator or server ComPoint.
-
getAddress()
- If the ComPoint is an Initiator, Returns the remote address;
if it is a Server, Returns the local address.
-
getProtocol()
- Returns the protocol.
-
getType()
- Returns the type.
-
read()
- Waits for and returns a message received on the ComPoint, which
must be either an Initiator or a Responder.
-
toString()
- Creates an string representation of the ComPoint.
-
write(Object)
- Sends the message through the ComPoint, which must be either
an Initiator or a Responder.
comPoint
public abstract ComPoint comPoint(int type,
ComPointAddress address) throws ComPointException
- Creates an initiator or server ComPoint.
- Parameters:
- type - type of ComPoint to be created
The possible values for type are sepcified in ComPointConstants by
constants with prefix COMPOINT_.
- address - if the type is server, the local address; otherwise,
the remote address
- Throws: ComPointException
- if type is invalid or
the socket cannot be opened.
getProtocol
public abstract String getProtocol()
- Returns the protocol.
getType
public abstract int getType()
- Returns the type.
getAddress
public abstract ComPointAddress getAddress()
- If the ComPoint is an Initiator, Returns the remote address;
if it is a Server, Returns the local address.
write
public abstract void write(Object message) throws ComPointException
- Sends the message through the ComPoint, which must be either
an Initiator or a Responder.
- Parameters:
- message - message to be sent
- Throws: ComPointException
- if the type is invalid or encountered
an error while externalizing the message.
read
public abstract Object read() throws ComPointException
- Waits for and returns a message received on the ComPoint, which
must be either an Initiator or a Responder.
- Throws: ComPointException
- if the type is invalid or encountered
an error while internalizing the message.
accept
public abstract ComPoint accept() throws ComPointException
- Waits for and returns a Responder ComPoint when a message arrives.
Must be invoked on a ComPoint of type Server.
- Throws: ComPointException
- if the type is invalid or encountered
an error while accepting a new socket.
close
public abstract void close() throws ComPointException
- Closes the ComPoint.
- Throws: ComPointException
- if the type is invalid or encountered
an error while error while closing the socket.
toString
public abstract String toString()
- Creates an string representation of the ComPoint.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index