Class semper.comm.ComPointMail
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.comm.ComPointMail

java.lang.Object
   |
   +----semper.comm.ComPointMail

public class ComPointMail
extends Object
implements ComPoint
Implements the ComPoint interface for the Mail protocol.
Version:
beta-4, 12.8.96
Author:
Mehdi Nassehi

Constructor Index

 o ComPointMail()
Creats a ComPointMail.
 o ComPointMail(int, ComPointAddress)
Creats an initiator or server ComPointMail.

Method Index

 o accept()
Waits for and returns a Responder ComPoint when a message arrives.
 o close()
Closes the ComPointMail.
 o comPoint(int, ComPointAddress)
Creates an Initiator or Server ComPointMail cast into ComPoint.
 o finalize()
Finalizer.
 o getAddress()
Returns the address.
 o getProtocol()
Returns the protocol.
 o getType()
Returns the type.
 o init()
Initializes the ComPointMail module.
 o isInitialized()
Check whether the module is initialized.
 o read()
Waits for and returns a message received on the ComPoint.
 o write(Object)
Sends the message through the ComPoint.

Constructors

 o ComPointMail
  public ComPointMail()
Creats a ComPointMail.
 o ComPointMail
  public ComPointMail(int type,
                      ComPointAddress address) throws ComPointException
Creats an initiator or server ComPointMail.
Parameters:
type - type of ComPointMail to be created
address - remote address
Throws: ComPointException
if type is invalid, class not initialized, or the socket cannot be opened.

Methods

 o init
  public static void init() throws ComPointException
Initializes the ComPointMail module.
Throws: ComPointException
if error while opening socket.
 o isInitialized
  public static boolean isInitialized()
Check whether the module is initialized.
Returns:
true if and only if fully initialized;
 o comPoint
  public ComPoint comPoint(int type,
                           ComPointAddress address) throws ComPointException
Creates an Initiator or Server ComPointMail cast into ComPoint.
Parameters:
type - type of ComPointMail to be created
address - if the type is server, the local address; otherwise, the remote address.
Returns:
comPoint ComPoint
Throws: ComPointException
if type is invalid, the module is not initiated, or the socket cannot be opened.
 o close
  public void close() throws ComPointException
Closes the ComPointMail.
Throws: ComPointException
if type is invalid or encountered an error while closing the socket.
 o finalize
  protected void finalize()
Finalizer.
Overrides:
finalize in class Object
 o getProtocol
  public String getProtocol()
Returns the protocol.
 o getType
  public int getType()
Returns the type.
 o getAddress
  public ComPointAddress getAddress()
Returns the address.
 o write
  public synchronized void write(Object message) throws ComPointException
Sends the message through the ComPoint. The ComPoint may be of the type initiator or responder.
Parameters:
message - message to be sent.
Throws: ComPointException
if the type is invalid, the module is not initiated, or encountered an error while externalizing the message.
 o read
  public synchronized Object read() throws ComPointException
Waits for and returns a message received on the ComPoint. The ComPoint may be of type Responder or initiator.
Throws: ComPointException
if the type is invalid, the module is not initiated, or encountered an error while internalizing the message.
 o accept
  public synchronized 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, the module is not initiated, or encountered an error while accepting a new socket.

All Packages  Class Hierarchy  This Package  Previous  Next  Index