|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
cgl.narada.transport.threadpool.PoolTCPLinkFactory
public class PoolTCPLinkFactory
This is a TCP thread pool based 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 be 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 PoolTCPLinkFactory one needs to specify the PoolTCPServerPort . 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
PoolTCPLinkFactory()
|
|
| Method Summary | |
|---|---|
boolean |
canManageLinkMigrationOfType(String linkType)
Indicates if this factory can manage migration of links of a certain type |
void |
completedTask(String taskIdentifier)
|
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 |
handleInboundPoolTCPLinkRequest(SocketChannel sc)
|
boolean |
loadLinkFactoryServices()
Start communication services. |
void |
manageExecution(NetworkTask networkTask)
Schedule the execution of the network task in question. |
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 |
run()
|
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.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PoolTCPLinkFactory()
| 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 handleInboundPoolTCPLinkRequest(SocketChannel sc)
public void reportLinkLoss(Link linkLost)
public TransportHandler getTransportHandler()
public void run()
public void manageExecution(NetworkTask networkTask)
task - public void completedTask(String taskIdentifier)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||