@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Port
|Modifier and Type||Required Element and Description|
The name of the port.
|Modifier and Type||Optional Element and Description|
Specifies the type of objects that can be received through this port.
Specifies the cardinality of this port.
Specifies the type of objects that can be sent through this port.
public abstract java.lang.String name
Endpoint.onConnect(Connection)method to determine which port has been connected to. Should be unique for the Endpoint. This is the only required part of a
Port. If no
accepts()is defined, the port has been defined without any implementation (like an interface). This is useful for specifying on an interface that should use a specific port.
public abstract java.lang.Class<?> sends
ConnectionManagerwill detect which ports can be connected to each other, it will check if this set is a subset of the other
accepts()set. The implementation of the
Endpointshould never sent other types of objects through this port, otherwise the behavior is unspecified (possible throws ClassCastExceptions).
public abstract java.lang.Class<?> accepts
MessageHandlershould only receive objects of this types.
public abstract Cardinality cardinality
Cardinality.SINGLE, only one
Connectioncan be created on this port at the same time. If it is set to
Cardinality.MULTIPLE, multiple connections are possible and should be handled by the