rina.rib.impl
Class RIBDaemonImpl
java.lang.Object
java.lang.Thread
rina.rib.impl.RIBDaemonImpl
- All Implemented Interfaces:
- java.lang.Runnable, RIBDaemonAPI
public class RIBDaemonImpl
- extends java.lang.Thread
- implements RIBDaemonAPI
RIB Daemon Implementation
note that JVM will only shut down a program when all user threads have terminate.
daemon threads do not keep the program from quitting; user threads keep the program from quitting.
- Version:
- 1.0
- Author:
- Yuefeng Wang and Flavio Esposito. Computer Science Department, Boston University
Nested classes/interfaces inherited from class java.lang.Thread |
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary |
int |
calculateLinkWeight(java.lang.String srcName)
|
int |
createPub(int frequency,
java.lang.String pubName)
|
int |
createSub(int frequency,
java.lang.String subName)
|
int |
createSub(int frequency,
java.lang.String subName,
java.lang.String publisher)
|
void |
createSubscription(double subscriptionID)
Creates a new subscription |
void |
createSubscription(double subscriptionID,
java.util.LinkedHashMap<java.lang.String,java.lang.Object> attributeList,
java.util.LinkedList<java.lang.String> memberList,
double expression,
double tolerance,
java.lang.String readorwrite)
|
void |
deletePub(int pubID)
|
void |
deleteSub(int subID)
|
void |
deleteSubscription(double subscriptionID)
delete and existing subscription |
RIBImpl |
getLocalRIB()
|
int |
getPubID(int frequency,
java.lang.String pubName)
|
SubscriptionOptimizer |
getRIBSubscriptionOptimizer()
|
int |
getSubID(int frequency,
java.lang.String subName)
|
int |
getSubID(int frequency,
java.lang.String subName,
java.lang.String publisher)
|
java.lang.Object |
readSub(int subID)
|
RIBImpl |
readSubscription(double subscriptionID)
allocate
read a RIB Subscription |
void |
run()
|
void |
setLocalRIB(RIBImpl localRIB)
|
void |
setRIBSubscriptionOptimizer(SubscriptionOptimizer rIBSubscriptionOptimizer)
|
void |
writePub(int pubID,
java.lang.Object msg)
|
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 |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
localRIB
public RIBImpl localRIB
RIBSubscriptionOptimizer
public SubscriptionOptimizer RIBSubscriptionOptimizer
RIBDaemonImpl
public RIBDaemonImpl(RIBImpl rib)
RIBDaemonImpl
public RIBDaemonImpl(RIBImpl rib,
IRM irm)
RIBDaemonImpl
public RIBDaemonImpl(RIBImpl rib,
TCPFlowManager tcpManager)
createSub
public int createSub(int frequency,
java.lang.String subName)
- Specified by:
createSub
in interface RIBDaemonAPI
createSub
public int createSub(int frequency,
java.lang.String subName,
java.lang.String publisher)
- Specified by:
createSub
in interface RIBDaemonAPI
getSubID
public int getSubID(int frequency,
java.lang.String subName,
java.lang.String publisher)
getSubID
public int getSubID(int frequency,
java.lang.String subName)
getPubID
public int getPubID(int frequency,
java.lang.String pubName)
createPub
public int createPub(int frequency,
java.lang.String pubName)
- Specified by:
createPub
in interface RIBDaemonAPI
readSub
public java.lang.Object readSub(int subID)
- Specified by:
readSub
in interface RIBDaemonAPI
deleteSub
public void deleteSub(int subID)
- Specified by:
deleteSub
in interface RIBDaemonAPI
deletePub
public void deletePub(int pubID)
- Specified by:
deletePub
in interface RIBDaemonAPI
writePub
public void writePub(int pubID,
java.lang.Object msg)
- Specified by:
writePub
in interface RIBDaemonAPI
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
- Overrides:
run
in class java.lang.Thread
calculateLinkWeight
public int calculateLinkWeight(java.lang.String srcName)
getLocalRIB
public RIBImpl getLocalRIB()
- Returns:
- the localRIB
setLocalRIB
public void setLocalRIB(RIBImpl localRIB)
- Parameters:
localRIB
- the localRIB to set
getRIBSubscriptionOptimizer
public SubscriptionOptimizer getRIBSubscriptionOptimizer()
- Returns:
- the rIBSubscriptionOptimizer
setRIBSubscriptionOptimizer
public void setRIBSubscriptionOptimizer(SubscriptionOptimizer rIBSubscriptionOptimizer)
- Parameters:
rIBSubscriptionOptimizer
- the rIBSubscriptionOptimizer to set
createSubscription
public void createSubscription(double subscriptionID,
java.util.LinkedHashMap<java.lang.String,java.lang.Object> attributeList,
java.util.LinkedList<java.lang.String> memberList,
double expression,
double tolerance,
java.lang.String readorwrite)
- Specified by:
createSubscription
in interface RIBDaemonAPI
createSubscription
public void createSubscription(double subscriptionID)
- Creates a new subscription
- Parameters:
subscription
- ID
deleteSubscription
public void deleteSubscription(double subscriptionID)
- delete and existing subscription
- Specified by:
deleteSubscription
in interface RIBDaemonAPI
- Parameters:
subscription
- ID
readSubscription
public RIBImpl readSubscription(double subscriptionID)
- allocate
read a RIB Subscription
- Specified by:
readSubscription
in interface RIBDaemonAPI
- Parameters:
subscription
- ID
- Returns:
- queried RIB