Prism.extensions.port
Class ExtensiblePort

java.lang.Object
  extended by Prism.core.Brick
      extended by Prism.core.Port
          extended by Prism.extensions.port.ExtensiblePort
All Implemented Interfaces:
java.io.Serializable, IPort

public class ExtensiblePort
extends Port

A subclass of Port provides extra functionality on top of Port object. Extra capability can be selected by installing the appropriate extension. Installation of appropriate extension can be done by done by setting the appropriate interface to the implementation of extensions. There are access methods provided to allow installation of these extensions.

Version:
2.0
Author:
USC Soft. Arch. Group. Contact: Sam Malek malek@usc.edu
See Also:
Serialized Form

Field Summary
 
Fields inherited from class Prism.core.Brick
name, scaffold
 
Constructor Summary
ExtensiblePort(java.lang.String name, int pPortType)
          This constructor instantiates an ExtensiblePort object and sets its parent's pointer to itself.
 
Method Summary
 void addCompressionModule(AbstractCompression compression)
          Installs the compression extension.
 void addDistributionModule(AbstractDistribution dist)
          Installs the distribution extension.
 void connect(java.lang.String hostName, int portNum)
          Method for connecting to a remote host.
 AbstractCompression getCompressionModule()
          Returns the installed Compression extension.
 void handle(Event e)
          The default handler, determines the type of processing needed to be done.
 void handle(java.lang.Object eventObject, java.lang.String direction)
          Checks the type of extensions installed.
 void start()
          Calls the start method of all the implemented interfaces in the appropriate order.
 
Methods inherited from class Prism.core.Port
getExtensiblePort, getMutualPort, getParentBrick, getPortType, setExtensiblePort, setMutualPort, setParentBrick
 
Methods inherited from class Prism.core.Brick
add, getStyle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensiblePort

public ExtensiblePort(java.lang.String name,
                      int pPortType)
This constructor instantiates an ExtensiblePort object and sets its parent's pointer to itself.

Parameters:
pPortType - Type of the port. For example: Request, Reply, ..
pBrick - Parent Brick of this port. For example: component,..
Method Detail

getCompressionModule

public AbstractCompression getCompressionModule()
Returns the installed Compression extension.

Returns:
AbstractCompression installed compression extension

start

public void start()
Calls the start method of all the implemented interfaces in the appropriate order.

Overrides:
start in class Brick

handle

public void handle(Event e)
The default handler, determines the type of processing needed to be done. There are two types of processing. Processing event that is incoming and processing event that is outgoing.

Overrides:
handle in class Port
Parameters:
e - event

handle

public void handle(java.lang.Object eventObject,
                   java.lang.String direction)
Checks the type of extensions installed. Depending on the extensions installed the appropriate processing is done.

Parameters:
eventObject - represents the event
direction - incoming vs outgoing

addDistributionModule

public void addDistributionModule(AbstractDistribution dist)
Installs the distribution extension.

Parameters:
dist - distribution extension.

addCompressionModule

public void addCompressionModule(AbstractCompression compression)
Installs the compression extension.

Parameters:
compression - compression extension.

connect

public void connect(java.lang.String hostName,
                    int portNum)
Method for connecting to a remote host. Also initiates security key exchange if security extension is installed.

Parameters:
hostName - host name or IP address of destination
portNum - port num of destination