All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.comm.ComPointHTTP

java.lang.Object
   |
   +----semper.comm.ComPointTCP
           |
           +----semper.comm.ComPointHTTP

public class ComPointHTTP
extends ComPointTCP
This class implements the ComPoint class based on http.

Version:
beta-4, 12.8.96
Author:
Mehdi Nassehi

Constructor Index

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

Method Index

 o accept()
Waits for and returns a Responder ComPoint when a message arrives.
 o close()
Closes the ComPointHTTP.
 o comPoint(int, ComPointAddress)
Creats an Initiator or Server ComPointHTTP cast into ComPoint.
 o finalize()
Finalizer.
 o getLocalAddress()
Returns the local address.
 o getProtocol()
Returns the protocol.
 o getRemoteAddress()
Returns the peer address.
 o init()
Initializes the module.
 o isInitialized()
Check whether the module is initialized.
 o isProxyConfigured()
Check whether a proxy is configured.
 o read()
Waits for and returns a message received on the ComPoint, which must be either an Initiator or a Responder.
 o write(Serializable)
Sends the message through the ComPoint, which must be either an Initiator or a Responder.

Constructors

 o ComPointHTTP
 public ComPointHTTP()
Creats a ComPointHTTP.

 o ComPointHTTP
 public ComPointHTTP(int type,
                     ComPointAddress address) throws ComPointException
Creats an initiator or server ComPointHTTP.

Parameters:
type - type of ComPointHTTP to be created, initiator or server
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.

Methods

 o init
 public static void init()
Initializes the module.

 o isInitialized
 public static boolean isInitialized()
Check whether the module is initialized.

Returns:
true if and only if fully initialized;
 o isProxyConfigured
 public static boolean isProxyConfigured()
Check whether a proxy is configured.

Returns:
true if and only if a proxy configured;
 o comPoint
 public ComPoint comPoint(int type,
                          ComPointAddress address) throws ComPointException
Creats an Initiator or Server ComPointHTTP cast into ComPoint.

Parameters:
type - type of ComPointHTTP to be created
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.
Overrides:
comPoint in class ComPointTCP
 o close
 public void close() throws ComPointException
Closes the ComPointHTTP.

Throws: ComPointException
if type is invalid or encountered an error while error while closing the socket.
Overrides:
close in class ComPointTCP
 o finalize
 protected void finalize()
Finalizer.

Overrides:
finalize in class ComPointTCP
 o getProtocol
 public String getProtocol()
Returns the protocol.

Overrides:
getProtocol in class ComPointTCP
 o getLocalAddress
 public ComPointAddress getLocalAddress()
Returns the local address. Note: we always return the canonical IP address for the host; this should be the most portable (e.g when $ sending a compointaddress from one host to another)

Overrides:
getLocalAddress in class ComPointTCP
 o getRemoteAddress
 public ComPointAddress getRemoteAddress()
Returns the peer address. Note: we always return the canonical IP address for the host; this should be the most portable (e.g when $ sending a compointaddress from one host to another) Note: the remote address is not garantueed to be the correct one ! firewalls/proxies can result in a address which is not really the address of the original originator and doesn't allow a callback. In most cases though such situations anyway don't allow any callback ...

Overrides:
getRemoteAddress in class ComPointTCP
 o write
 public synchronized void write(Serializable 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.
Overrides:
write in class ComPointTCP
 o read
 public synchronized Serializable 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 ComPoint type or HTTP type is invalid or encountered an error while internalizing the message.
Overrides:
read in class ComPointTCP
 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 or encountered an error while accepting a new socket.
Overrides:
accept in class ComPointTCP

All Packages  Class Hierarchy  This Package  Previous  Next  Index