|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.primordion.xholon.base.Xholon org.primordion.xholon.base.Port
Port is one type of concrete "port" in a xholon application. The other alternative is for a xholon to have a direct reference to another xholon. There is more flexibility using the Port class, but there is also more overhead.
Field Summary | |
IXholon[] |
replication
Replications of this port. |
Fields inherited from class org.primordion.xholon.base.Xholon |
DEFAULT_LEVEL, interaction, interactionsEnabled |
Fields inherited from interface org.primordion.xholon.base.IPort |
XPATH_EXPR_NO_INDEX, XPATH_EXPR_WILDCARD |
Fields inherited from interface org.primordion.xholon.base.IXholon |
DEFAULT_SIZE_MSG_Q, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx |
Constructor Summary | |
Port()
|
Method Summary | |
static IPort |
createPort(IXholon portOwner,
int multiplicity,
int[] provIfSigs,
java.lang.String[] provIfNames,
int[] reqIfSigs,
java.lang.String[] reqIfNames,
boolean isConjugated)
Create an instance of the Port class. |
boolean |
getIsConjugated()
Get whether or not this is a conjugated port. |
IXholon |
getLink(int index)
Get the link from a local port replication to a remote port or xholon. |
java.lang.String |
getName()
Get name, unique within this application, of this Xholon instance. |
IXholon |
getPort(int portNum)
Get the port that corresponds to this index (0 indexed). |
IPortInterface |
getProvidedInterface()
Get the provided interface of this port. |
IPortInterface |
getRequiredInterface()
Get the required interface of this port. |
boolean |
isBound(IXholon port)
Is this port bound to anything? If a port is bound, then it will be possible for the local IXholon to send a message to, or get/set a val on, a remote IXholon. |
void |
postConfigure()
Perform some action, typically once at start up; MAY be overridden. |
void |
sendMessage(int signal,
java.lang.Object data,
IXholon sender)
Send a ROOM/UML2 message to a receiving Xholon instance. |
void |
sendMessage(int signal,
java.lang.Object data,
IXholon sender,
int index)
Send a ROOM/UML2 message through a local instance of a replicated port to a remote replicated port instance or directly to a remote xholon, or from a remote port replication to its owning xholon. |
void |
setIsConjugated(boolean isConjugated)
Set whether or not this is a conjugated port. |
boolean |
setLink(int index,
IXholon context,
java.lang.String xpathExpressionIn)
Set the link from a local port replication to a remote port or xholon. |
boolean |
setLink(int index,
IXholon context,
java.lang.String xpathExprTemplate,
int xholonIx,
int portIx,
int replicationIx)
Set the link from a local port replication to a remote port or xholon. |
void |
setProvidedInterface(IPortInterface providedInterface)
Set the provided interface of this port. |
void |
setReplications(int multiplicity)
Set the replication factor of a remote port, and create the remote port. |
void |
setRequiredInterface(IPortInterface requiredInterface)
Set the required interface of this port. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public IXholon[] replication
Constructor Detail |
public Port()
Method Detail |
public void setProvidedInterface(IPortInterface providedInterface)
IPort
setProvidedInterface
in interface IPort
providedInterface
- An array of zero or more signal IDs.public IPortInterface getProvidedInterface()
IPort
getProvidedInterface
in interface IPort
public void setRequiredInterface(IPortInterface requiredInterface)
IPort
setRequiredInterface
in interface IPort
requiredInterface
- An array of zero or more signal IDs.public IPortInterface getRequiredInterface()
IPort
getRequiredInterface
in interface IPort
public void setIsConjugated(boolean isConjugated)
IPort
setIsConjugated
in interface IPort
isConjugated
- true (conjugated) or false (non-conjugated). default: falsepublic boolean getIsConjugated()
IPort
getIsConjugated
in interface IPort
public void postConfigure()
IXholon
postConfigure
in interface IXholon
postConfigure
in class Xholon
public java.lang.String getName()
IXholon
getName
in interface IXholon
getName
in class Xholon
public static IPort createPort(IXholon portOwner, int multiplicity, int[] provIfSigs, java.lang.String[] provIfNames, int[] reqIfSigs, java.lang.String[] reqIfNames, boolean isConjugated)
portOwner
- The xholon that owns this port.multiplicity
- The number of replications of the port to create.provIfSigs
- Provided interface signal IDs.provIfNames
- Provided interface signal names.reqIfSigs
- Required interface signal IDs.reqIfNames
- Required interface signal names.isConjugated
- Whether or not the port instance is conjugated.
public void setReplications(int multiplicity)
IPort
setReplications
in interface IPort
multiplicity
- The maximum number of instances of the remote port.public boolean setLink(int index, IXholon context, java.lang.String xpathExprTemplate, int xholonIx, int portIx, int replicationIx)
IPort
setLink
in interface IPort
index
- Index of the local replicated port on which the link is to be set.context
- The xholon that owns the port and port replication.xpathExprTemplate
- XPath expression template.xholonIx
- Remote xholon index, used to fill in a value in the template.
If there is no index, then the value must be XPATH_EXPR_NO_INDEX.portIx
- Remote port index, used to fill in a value in the template.
If there is no index, then the value must be XPATH_EXPR_NO_INDEX.replicationIx
- Remote replication index, used to fill in a value in the template.
If there is no index, then the value must be XPATH_EXPR_NO_INDEX.public boolean setLink(int index, IXholon context, java.lang.String xpathExpressionIn)
IPort
setLink
in interface IPort
index
- Index of the local replicated port on which the link is to be set.context
- The xholon that owns the port and port replication.xpathExpressionIn
- Complete XPath expression.
public IXholon getLink(int index)
IPort
getLink
in interface IPort
index
- Index of the local replicated port.
public IXholon getPort(int portNum)
IXholon
getPort
in interface IXholon
getPort
in class Xholon
public boolean isBound(IXholon port)
IXholon
If the port is intended to be a direct reference to another IXholon, then isBound() will return true if the port actually references a concrete IXholon, and will return false if the port value is null.
If the port is intended to be an IPort, then isBound() will return true if there is an end-to-end connection to a remote IXholon, and will return false if the port value is null or if it does not connect all the way through to a remote IXholon.
isBound
in interface IXholon
isBound
in class Xholon
public void sendMessage(int signal, java.lang.Object data, IXholon sender)
IXholon
sendMessage
in interface IXholon
sendMessage
in class Xholon
public void sendMessage(int signal, java.lang.Object data, IXholon sender, int index)
IPort
sendMessage
in interface IPort
sendMessage
in class Xholon
public java.lang.String toString()
toString
in class Xholon
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |