|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibis.ipl.PortType
A PortType
represents a class of send and receive
ports with specific properties and with a specific role in the program.
Each class also
serves as the factory to create instances of these ports.
Ports can only connect to other ports of the same type.
A PortType
is created using the
Ibis.createPortType(String, StaticProperties)
method.
Support for connection downcalls can be explicitly turned on and off, because it might incur some overhead. Moreover, if downcalls are used, the amount of administration that must be kept is dependent on the frequency of the user downcalls. If the user never does a downcall, the administration is kept indefinitely.
Constructor Summary | |
PortType()
Dummy constructor; do not use: a PortType is created using the
Ibis.createPortType(String, StaticProperties) method. |
Method Summary | |
ReceivePort |
createReceivePort(java.lang.String name)
Creates a named ReceivePort of this PortType ,
with explicit receipt communication. |
ReceivePort |
createReceivePort(java.lang.String name,
boolean connectionDowncalls)
Creates a named ReceivePort of this PortType ,
with explicit receipt communication. |
ReceivePort |
createReceivePort(java.lang.String name,
ReceivePortConnectUpcall cU)
Creates a named ReceivePort of this PortType ,
with explicit receipt communication. |
ReceivePort |
createReceivePort(java.lang.String name,
Upcall u)
Creates a named ReceivePort of this PortType ,
with upcall based communication. |
ReceivePort |
createReceivePort(java.lang.String name,
Upcall u,
boolean connectionDowncalls)
Creates a named ReceivePort of this PortType ,
with upcall based communication. |
ReceivePort |
createReceivePort(java.lang.String name,
Upcall u,
ReceivePortConnectUpcall cU)
Creates a named ReceivePort of this PortType ,
with upcall based communication. |
SendPort |
createSendPort()
Creates a anonymous SendPort of this PortType . |
SendPort |
createSendPort(boolean connectionDowncalls)
Creates a anonymous SendPort of this PortType . |
SendPort |
createSendPort(java.lang.String name)
Creates a named SendPort of this PortType . |
SendPort |
createSendPort(java.lang.String name,
boolean connectionDowncalls)
Creates a named SendPort of this PortType . |
SendPort |
createSendPort(java.lang.String name,
SendPortConnectUpcall cU)
Creates a named SendPort of this PortType . |
abstract boolean |
equals(java.lang.Object other)
The equals method is mentioned here just as a reminder that an implementation must probably redefine it, because two objects representing the same porttype must compare equal (and result in the same hashcode). |
abstract int |
hashCode()
The hashCode method is mentioned here just as a reminder that an implementation must probably redefine it, because two objects representing the same porttype must result in the same hashcode (and compare equal). |
abstract java.lang.String |
name()
Returns the name given to this PortType upon creation. |
abstract StaticProperties |
properties()
Returns the properties given to this PortType upon creation. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PortType()
PortType
is created using the
Ibis.createPortType(String, StaticProperties)
method.
Method Detail |
public abstract java.lang.String name()
public abstract StaticProperties properties()
public SendPort createSendPort() throws java.io.IOException
SendPort
of this PortType
.
java.io.IOException
- is thrown when the port could not be
created.public SendPort createSendPort(java.lang.String name) throws java.io.IOException
SendPort
of this PortType
.
The name does not have to be unique.
name
- the name of this sendport.
java.io.IOException
- is thrown when the port could not be
created.
IbisConfigurationException
- is thrown when the port
type does not match what is required here.public SendPort createSendPort(boolean connectionDowncalls) throws java.io.IOException
SendPort
of this PortType
.
connectionDowncalls
- set when this port must keep
connection administration to support the lostConnections
downcall.
java.io.IOException
- is thrown when the port could not be
created.
IbisConfigurationException
- is thrown when the port
type does not match what is required here.public SendPort createSendPort(java.lang.String name, boolean connectionDowncalls) throws java.io.IOException
SendPort
of this PortType
.
The name does not have to be unique.
name
- the name of this sendport.connectionDowncalls
- set when this port must keep
connection administration to support the lostConnections
downcall.
java.io.IOException
- is thrown when the port could not be
created.
IbisConfigurationException
- is thrown when the port
type does not match what is required here.public SendPort createSendPort(java.lang.String name, SendPortConnectUpcall cU) throws java.io.IOException
SendPort
of this PortType
.
The name does not have to be unique.
When a connection is lost, a ConnectUpcall is performed.
name
- the name of this sendport.cU
- object implementing the
SendPortConnectUpcall.lostConnection(SendPort,
ReceivePortIdentifier, Exception)
method.
java.io.IOException
- is thrown when the port could not be
created.
IbisConfigurationException
- is thrown when the port
type does not match what is required here.public ReceivePort createReceivePort(java.lang.String name) throws java.io.IOException
ReceivePort
of this PortType
,
with explicit receipt communication.
New connections will not be accepted until
ReceivePort.enableConnections()
is invoked.
This is done to avoid upcalls during initialization.
name
- the unique name of this receiveport (or null
,
in which case a name is invented).
java.io.IOException
- is thrown when the port could not be
created.
IbisConfigurationException
- is thrown when the port
type does not match what is required here.public ReceivePort createReceivePort(java.lang.String name, boolean connectionDowncalls) throws java.io.IOException
ReceivePort
of this PortType
,
with explicit receipt communication.
New connections will not be accepted until
ReceivePort.enableConnections()
is invoked.
This is done to avoid upcalls during initialization.
name
- the unique name of this receiveport (or null
,
in which case a name is invented).connectionDowncalls
- set when this port must keep
connection administration to support the lostConnections and
newConnections downcalls.
java.io.IOException
- is thrown when the port could not be
created.
IbisConfigurationException
- is thrown when the port
type does not match what is required here.public ReceivePort createReceivePort(java.lang.String name, Upcall u) throws java.io.IOException
ReceivePort
of this PortType
,
with upcall based communication.
New connections will not be accepted until
ReceivePort.enableConnections()
is invoked.
This is done to avoid upcalls during initialization.
name
- the unique name of this receiveport (or null
,
in which case a name is invented).u
- the upcall handler.
java.io.IOException
- is thrown when the port could not be
created.
IbisConfigurationException
- is thrown when the port
type does not match what is required here.public ReceivePort createReceivePort(java.lang.String name, Upcall u, boolean connectionDowncalls) throws java.io.IOException
ReceivePort
of this PortType
,
with upcall based communication.
New connections will not be accepted until
ReceivePort.enableConnections()
is invoked.
This is done to avoid upcalls during initialization.
name
- the unique name of this receiveport (or null
,
in which case a name is invented).u
- the upcall handler.connectionDowncalls
- set when this port must keep
connection administration to support the lostConnections and
newConnections downcalls.
java.io.IOException
- is thrown when the port could not be
created.
IbisConfigurationException
- is thrown when the port
type does not match what is required here.public ReceivePort createReceivePort(java.lang.String name, ReceivePortConnectUpcall cU) throws java.io.IOException
ReceivePort
of this PortType
,
with explicit receipt communication.
New connections will not be accepted until
ReceivePort.enableConnections()
is invoked.
This is done to avoid upcalls during initialization.
When a new connection request arrives, or when a connection is lost,
a ConnectUpcall is performed.
name
- the unique name of this receiveport (or null
,
in which case a name is invented).cU
- object implementing gotConnection
() and
lostConnection
() upcalls.
java.io.IOException
- is thrown when the port could not be
created.
IbisConfigurationException
- is thrown when the port
type does not match what is required here.public ReceivePort createReceivePort(java.lang.String name, Upcall u, ReceivePortConnectUpcall cU) throws java.io.IOException
ReceivePort
of this PortType
,
with upcall based communication.
New connections will not be accepted until
ReceivePort.enableConnections()
is invoked.
This is done to avoid upcalls during initialization.
When a new connection request arrives, or when a connection is lost,
a ConnectUpcall is performed.
name
- the unique name of this receiveport (or null
,
in which case a name is invented).u
- the upcall handler.cU
- object implementing gotConnection
() and
lostConnection
() upcalls.
java.io.IOException
- is thrown when the port could not be
created.
IbisConfigurationException
- is thrown when the port
type does not match what is required here.public abstract int hashCode()
public abstract boolean equals(java.lang.Object other)
other
- the object to compare with.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |