Package org.jcsp.net
Class LinkFactory.Builder
- java.lang.Object
-
- org.jcsp.net.LinkFactory.Builder
-
- Enclosing class:
- LinkFactory
public abstract static class LinkFactory.Builder extends java.lang.ObjectAn abstract inner class which should be implemented by comunication protocol implementations. TheBuilderclass provides an abstract method which should be implemented to take aNodeAddressIDobject which should be used to construct aLinkwhich is then returned by the method to the factory.
-
-
Field Summary
Fields Modifier and Type Field Description private ProtocolIDprotocolID
-
Constructor Summary
Constructors Constructor Description Builder(ProtocolID protocolID)A constructor which takes theProtocolIDidentifying the protocol that thisBuildersupports.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ProtocolIDgetProtocolID()Gets theProtocolIDthat thisBuildersupports.abstract LinktestAndBuild(NodeAddressID addressID)Takes aNodeAddressIDand constructs and returns aLinkobject.
-
-
-
Field Detail
-
protocolID
private final ProtocolID protocolID
-
-
Constructor Detail
-
Builder
public Builder(ProtocolID protocolID)
A constructor which takes theProtocolIDidentifying the protocol that thisBuildersupports. This must be called by sub-classes.- Parameters:
protocolID- theProtocolIDfor the protocol that the implementation supports.
-
-
Method Detail
-
testAndBuild
public abstract Link testAndBuild(NodeAddressID addressID) throws java.lang.IllegalArgumentException
Takes aNodeAddressIDand constructs and returns aLinkobject.- Parameters:
addressID- theAddressIDfor the remote Node.- Returns:
- the constructed
Link. - Throws:
java.lang.IllegalArgumentException- if theAddressIDobject is invalid.
-
getProtocolID
public final ProtocolID getProtocolID()
Gets theProtocolIDthat thisBuildersupports.- Returns:
- the
ProtocolIDthat thisBuildersupports.
-
-