|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcgl.narada.transport.udp.UDPLinkFactory
public class UDPLinkFactory
This is a UDP 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 UDPLinkFactory one needs to specify UDPListenerPort , this is the port on which the process running this factory would listen to for datagram packet communications.
To create a link to node B. The following properties needs to be specified.
| Field Summary | |
|---|---|
protected Hashtable |
links
|
protected TransportHandler |
transportHandler
|
protected DatagramSocket |
udpListenerSocket
|
protected UDPPingHandler |
udppinghandler
|
protected UDPReceiverThread |
udpReceiverThread
|
| Constructor Summary | |
|---|---|
UDPLinkFactory()
|
|
| 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 |
UDPLink |
getCurrentLink(InetAddress remoteAddress,
int remotePort)
|
String |
getManagedLinksType()
Return the type of all the links created/managed by this factory |
TransportHandler |
getTransportHandler()
|
void |
handleInboundUDPLinkRequest(InetAddress remoteAddress,
int remotePort)
|
boolean |
loadLinkFactoryServices()
Starts 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 |
| Field Detail |
|---|
protected UDPReceiverThread udpReceiverThread
protected Hashtable links
protected TransportHandler transportHandler
protected DatagramSocket udpListenerSocket
protected UDPPingHandler udppinghandler
| Constructor Detail |
|---|
public UDPLinkFactory()
| 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 UDPLink getCurrentLink(InetAddress remoteAddress, int remotePort)
public void handleInboundUDPLinkRequest(InetAddress remoteAddress, int remotePort)
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 | ||||||||