|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcgl.narada.transport.niotcp.NIOTCPLinkFactory
public class NIOTCPLinkFactory
This is a NIOTCP implementation of the LinkFactory Interface. Lets assume that the connection is being initiated by a node A to another node B. There are two independent factors that need to borne in mind while using LinkFactory. The first is of course setting the link factory properties. The second is specifying the properties to create a link to some other node B.
To initialize the NIOTCPLinkFactory one needs to specify the NIOTCPServerPort . When the value of this variable is set to 0 it implies that the node A initiating a connection to node B will not accept link creation requests from any other node.
To create a link to node B. The following properties needs to be specified.
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
NIOTCPLinkFactory()
|
|
| Method Summary | |
|---|---|
boolean |
canManageLinkMigrationOfType(String linkType)
Indicates if this factory can manage migration of links of a certain type |
Link |
createLink(Properties linkProperties)
Create a communication link based on the properties that have been specified. |
void |
dispose()
This method is used to garbage collect any resources associated with the link factory |
String |
getManagedLinksType()
Return the type of all the links created/managed by this factory |
TransportHandler |
getTransportHandler()
|
void |
handleInboundNIOTCPLinkRequest(SocketChannel sc)
|
boolean |
loadLinkFactoryServices()
Start communication services. |
static void |
main(String[] args)
|
void |
manageLinkMigration(Link link)
Used to migrate communications of a link to the one supported by links managed by this factory |
void |
reportLinkLoss(Link linkLost)
|
void |
setLinkFactoryProperties(Properties factoryProperties)
|
void |
setLinkStatusInterval(long interval)
Set the interval for checking status of all links managed by this factory to the one specified in the argument |
void |
setTransportHandler(TransportHandler transportHandler)
Sets the reference to the transport handler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NIOTCPLinkFactory()
| Method Detail |
|---|
public void setLinkFactoryProperties(Properties factoryProperties)
setLinkFactoryProperties in interface LinkFactorypublic String getManagedLinksType()
getManagedLinksType in interface LinkFactorypublic Link createLink(Properties linkProperties) throws TransportException
createLink in interface LinkFactoryTransportExceptionpublic void setLinkStatusInterval(long interval)
setLinkStatusInterval in interface LinkFactory
public boolean loadLinkFactoryServices()
throws TransportException
loadLinkFactoryServices in interface LinkFactoryTransportExceptionpublic boolean canManageLinkMigrationOfType(String linkType)
canManageLinkMigrationOfType in interface LinkFactorypublic void manageLinkMigration(Link link) throws TransportException
manageLinkMigration in interface LinkFactoryTransportExceptionpublic void setTransportHandler(TransportHandler transportHandler)
setTransportHandler in interface LinkFactorypublic void dispose()
dispose in interface LinkFactorypublic void handleInboundNIOTCPLinkRequest(SocketChannel sc)
public void reportLinkLoss(Link linkLost)
public TransportHandler getTransportHandler()
public static void main(String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||