DRCL JavaSim API

drcl.comp
Class Port

java.lang.Object
  |
  +--drcl.DrclObj
        |
        +--drcl.comp.Port
All Implemented Interfaces:
java.lang.Cloneable, ObjectDuplicable, java.io.Serializable

public class Port
extends DrclObj

The default implementation of a port.

See Also:
Component, Serialized Form

Field Summary
 java.lang.String groupID
          ID of the port group this port belongs to.
 Component host
           
 java.lang.String id
          ID of the port, unique in the port group it belongs to.
protected  Wire inwire
           
protected  Wire outwire
           
static java.lang.String PortType_EVENT
          The event port type
static java.lang.String PortType_FORK
          The fork port type
static java.lang.String PortType_IN
          The input-only port type.
static java.lang.String PortType_INOUT
          The duplex port type.
static java.lang.String PortType_OUT
          The output-only port type.
static java.lang.String PortType_SERVER
          The server port type
static java.lang.String PortType_UNKNOWN
           
static java.lang.Object SEND_RCV_REQUEST
           
 
Constructor Summary
Port()
          Constructor, default duplex port type.
Port(java.lang.String type_)
          Constructor, with specified port type.
Port(java.lang.String type_, boolean exeBoundary_)
          Constructor, with specified port type and properties.
 
Method Summary
 boolean _isEventExportEnabled()
           
 boolean anyClient()
           
 boolean anyConnection()
          Returns true if the port connects to or shadows for at least one port.
 boolean anyOutConnection()
          Returns true if the port connects to or shadows for at least one port.
 boolean anyPeer()
           
 void attachIn(Port p_)
           
 void attachIn(Port[] pp_)
           
 void attachOut(Port p_)
           
 void attachOut(Port[] pp_)
           
 boolean connect(Port peer_)
          Bi-direction connection, consider proxying.
 void connect(Port[] pp_)
          Disconnects from the given ports.
 boolean connectTo(Port peer_)
          Uni-direction connection, consider proxying.
 void connectTo(Port[] pp_)
          Connects to the given ports.
 void detachIn(Port p_)
           
 void detachIn(Port[] pp_)
           
 void detachOut(Port p_)
           
 void detachOut(Port[] pp_)
           
 void disconnect()
          Disconnect with all peers and clients.
 void disconnectClients()
           
 void disconnectInWire()
          Disconnect with all peers and clients on the IN wire.
 void disconnectOutWire()
          Disconnect with all peers and clients on the OUT wire.
 void disconnectPeers()
          Removes peers from the wires attached with this port.
 void disconnectWithParent()
           
 void doLastSending(java.lang.Object data_)
          Same as doSending(Object) in terms of functionality.
protected  void doReceiving(java.lang.Object data_, Port peer_, WorkerThread thread_)
          Data come in from a peer/client port.
 void doSending(java.lang.Object data_)
          Called by the host component to send data at this port.
 void duplicate(java.lang.Object source_)
          Duplicates the content of the port from source_.
 void exportEvent(java.lang.String evtName_, double value_, java.lang.String evtDescription_)
           
 void exportEvent(java.lang.String evtName_, java.lang.Object evtObj_, java.lang.String evtDescription_)
           
 Port[] getClients()
           
 Contract getContract()
           
 int getFlag()
           
 java.lang.String getGroupID()
          Get the id of the group this port belongs to.
 Component getHost()
          Returns the host component.
 java.lang.String getID()
          Returns the id of the port.
 Port[] getInClients()
           
 Port[] getInPeers()
           
 Port[] getInShadows()
           
 Wire getInWire()
           
 Port[] getOutClients()
           
 Port[] getOutPeers()
           
 Port[] getOutShadows()
           
 Wire getOutWire()
           
 Port[] getParentPeers()
          Returns host's parent's peers and the shadow ports.
 Port[] getPeers()
           
 Port[] getShadows()
           
 java.lang.String getType()
          Returns the port type of this port.
 java.lang.String info()
           
 void inoutSplit()
          Splits the "IN" wire/"OUT" wire of this port.
 boolean isConnectedWith(Port p_)
           
 boolean isDataTraceEnabled()
           
 boolean isEventExportEnabled()
           
 boolean isExecutionBoundary()
           
 boolean isRemovable()
           
 boolean isSendTraceEnabled()
           
 boolean isShadow()
           
 void reset()
           
 java.lang.Object sendReceive(java.lang.Object data_)
           
 boolean set(java.lang.String gid_, java.lang.String id_)
          Sets the group ID and port ID of this port.
 void setDataTraceEnabled(boolean enabled_)
           
 void setEventExportEnabled(boolean enabled_)
           
 void setExecutionBoundary(boolean flag_)
           
 boolean setGroupID(java.lang.String groupID_)
          Sets the id of the group this port belongs to.
 void setHost(Component host_)
          Sets the host component.
 boolean setID(java.lang.String id_)
          Set the id of the port, unique in the port group it belongs to.
 void setRemovable(boolean flag_)
           
 void setSendTraceEnabled(boolean enabled_)
           
 void setShadow(boolean flag_)
           
 void setTraceEnabled(boolean enabled_)
           
 void setType(java.lang.String type_)
          Sets the port type.
 java.lang.String toString()
          Returns the full path.
 
Methods inherited from class drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PortType_INOUT

public static final java.lang.String PortType_INOUT
The duplex port type.

PortType_IN

public static final java.lang.String PortType_IN
The input-only port type.

PortType_OUT

public static final java.lang.String PortType_OUT
The output-only port type.

PortType_SERVER

public static final java.lang.String PortType_SERVER
The server port type

PortType_FORK

public static final java.lang.String PortType_FORK
The fork port type

PortType_EVENT

public static final java.lang.String PortType_EVENT
The event port type

PortType_UNKNOWN

public static final java.lang.String PortType_UNKNOWN

groupID

public java.lang.String groupID
ID of the port group this port belongs to. Must use setGroupID(String) or set(String, String) to set the group ID of a port because it affects the bookkeeping in the host component.

id

public java.lang.String id
ID of the port, unique in the port group it belongs to. Must use setID(String) or set(String, String) to set the ID of a port because it affects the bookkeeping in the host component.
See Also:
groupID

host

public Component host

outwire

protected Wire outwire

inwire

protected Wire inwire

SEND_RCV_REQUEST

public static final java.lang.Object SEND_RCV_REQUEST
Constructor Detail

Port

public Port()
Constructor, default duplex port type.

Port

public Port(java.lang.String type_)
Constructor, with specified port type.

Port

public Port(java.lang.String type_,
            boolean exeBoundary_)
Constructor, with specified port type and properties.
Method Detail

reset

public final void reset()

setHost

public final void setHost(Component host_)
Sets the host component.

getHost

public final Component getHost()
Returns the host component.

setGroupID

public final boolean setGroupID(java.lang.String groupID_)
Sets the id of the group this port belongs to. Returns false if failed.

getGroupID

public final java.lang.String getGroupID()
Get the id of the group this port belongs to.

setID

public final boolean setID(java.lang.String id_)
Set the id of the port, unique in the port group it belongs to. Returns false if failed.

set

public final boolean set(java.lang.String gid_,
                         java.lang.String id_)
Sets the group ID and port ID of this port.

getID

public final java.lang.String getID()
Returns the id of the port.

setType

public final void setType(java.lang.String type_)
Sets the port type.

getType

public final java.lang.String getType()
Returns the port type of this port.

setExecutionBoundary

public final void setExecutionBoundary(boolean flag_)

isExecutionBoundary

public final boolean isExecutionBoundary()

getFlag

public final int getFlag()

setRemovable

public final void setRemovable(boolean flag_)

isRemovable

public final boolean isRemovable()

setTraceEnabled

public final void setTraceEnabled(boolean enabled_)

setDataTraceEnabled

public final void setDataTraceEnabled(boolean enabled_)

isDataTraceEnabled

public final boolean isDataTraceEnabled()

setEventExportEnabled

public final void setEventExportEnabled(boolean enabled_)

isEventExportEnabled

public final boolean isEventExportEnabled()

setSendTraceEnabled

public final void setSendTraceEnabled(boolean enabled_)

isSendTraceEnabled

public final boolean isSendTraceEnabled()

isShadow

public final boolean isShadow()

setShadow

public void setShadow(boolean flag_)

getContract

public final Contract getContract()

getOutWire

public Wire getOutWire()

getInWire

public Wire getInWire()

anyConnection

public final boolean anyConnection()
Returns true if the port connects to or shadows for at least one port.

anyOutConnection

public final boolean anyOutConnection()
Returns true if the port connects to or shadows for at least one port.

anyClient

public final boolean anyClient()

getClients

public final Port[] getClients()

getOutClients

public final Port[] getOutClients()

getInClients

public final Port[] getInClients()

anyPeer

public final boolean anyPeer()

getPeers

public final Port[] getPeers()

getOutPeers

public final Port[] getOutPeers()

getInPeers

public final Port[] getInPeers()

getShadows

public final Port[] getShadows()

getOutShadows

public final Port[] getOutShadows()

getInShadows

public final Port[] getInShadows()

getParentPeers

public final Port[] getParentPeers()
Returns host's parent's peers and the shadow ports.

isConnectedWith

public boolean isConnectedWith(Port p_)

doReceiving

protected void doReceiving(java.lang.Object data_,
                           Port peer_,
                           WorkerThread thread_)
Data come in from a peer/client port.

doSending

public final void doSending(java.lang.Object data_)
Called by the host component to send data at this port.

doLastSending

public final void doLastSending(java.lang.Object data_)
Same as doSending(Object) in terms of functionality. Performance-aware components may use the runtime notifies the runtime

sendReceive

public final java.lang.Object sendReceive(java.lang.Object data_)

connect

public final boolean connect(Port peer_)
Bi-direction connection, consider proxying. Returns true if either direction is set up successfully.

connect

public final void connect(Port[] pp_)
Disconnects from the given ports.

attachIn

public final void attachIn(Port p_)

attachIn

public final void attachIn(Port[] pp_)

detachIn

public final void detachIn(Port p_)

detachIn

public final void detachIn(Port[] pp_)

attachOut

public final void attachOut(Port p_)

attachOut

public final void attachOut(Port[] pp_)

detachOut

public final void detachOut(Port p_)

detachOut

public final void detachOut(Port[] pp_)

connectTo

public final boolean connectTo(Port peer_)
Uni-direction connection, consider proxying. Returns true if the connection is set up successfully.

connectTo

public final void connectTo(Port[] pp_)
Connects to the given ports.

disconnect

public final void disconnect()
Disconnect with all peers and clients.

disconnectInWire

public final void disconnectInWire()
Disconnect with all peers and clients on the IN wire.

disconnectOutWire

public final void disconnectOutWire()
Disconnect with all peers and clients on the OUT wire.

disconnectPeers

public final void disconnectPeers()
Removes peers from the wires attached with this port.

disconnectClients

public final void disconnectClients()

disconnectWithParent

public final void disconnectWithParent()

inoutSplit

public void inoutSplit()
Splits the "IN" wire/"OUT" wire of this port.

exportEvent

public final void exportEvent(java.lang.String evtName_,
                              java.lang.Object evtObj_,
                              java.lang.String evtDescription_)

exportEvent

public final void exportEvent(java.lang.String evtName_,
                              double value_,
                              java.lang.String evtDescription_)

_isEventExportEnabled

public final boolean _isEventExportEnabled()

duplicate

public final void duplicate(java.lang.Object source_)
Duplicates the content of the port from source_. This method is meant to be invoked by Component. It only duplicates the flag. ID, groupID and wires are not copied.
Overrides:
duplicate in class DrclObj

toString

public final java.lang.String toString()
Returns the full path.
Overrides:
toString in class DrclObj

info

public final java.lang.String info()

DRCL JavaSim API

Copyright © 2001 - DRCL, OSU     ~ Back to JavaSim Home ~