|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hypercast.MessageStore
A buffer that holds messages and allows messages, or types of messages, to have finite state machines associated with them. It is through these finite state machine that interesting services can be created. Finite state machines are created by extending the I_MessageStoreFSM interface.
Field Summary | |
static short |
FSM_BEST_EFFORT_ORDERING
|
static short |
FSM_DUPLICATE_ELIMINATION
|
static short |
FSM_E2E_ACK
|
static short |
FSM_H2H_ACK
|
static short |
FSM_INCAST
|
static short |
FSM_NAMING
|
static short |
FSM_NO_SERVICE
Finite state machine identifiers |
static short |
FSM_SYNCHRONIZATION
|
static short |
MESSAGESTORE_MESSAGE
|
static short |
OTHER_MESSAGE
|
static short |
STREAM_MESSAGE
Message type conatsnts. |
Constructor Summary | |
MessageStore(hypercast.OL_Socket socket,
hypercast.HyperCastConfig config)
Constructs a MessageStore object with HyperCastConfig and OL_Socket. |
Method Summary | |
void |
clearTimer(hypercast.I_MessageStoreFSM fsm,
int index)
Clear the timer |
void |
clearTimer(hypercast.I_MessageStoreFSM fsm,
java.lang.Object obj)
Clear the timer |
void |
createFSMPool()
Create a pool to store pre-allocated FSM instances based on the configuration file. |
hypercast.I_MessageStoreFSM |
get(byte[] messageid)
Get the message in the hashtable |
static short |
getMsgType(short serviceNumber)
Returns the message type given a service identifier. |
org.w3c.dom.Element[] |
getReadSchema(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
Dynamically generates a subtree of the Readable Schema rooted at the path specified by the xpath. |
org.w3c.dom.Element[] |
getStats(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
Gets statistics information from an object which implements this interface. |
java.lang.String |
getStatsName()
Gets the element name of this I_Stats instance. |
long |
getTimer(hypercast.I_MessageStoreFSM fsm,
int index)
Get the timer |
org.w3c.dom.Element[] |
getWriteSchema(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
Return the schema element which represents the root of the sub-tree, specified by the given xpath, in write schema tree. |
static boolean |
isValidServiceNumber(short serviceNumber)
Test if a service is supported by the MessageStore |
void |
put(byte[] messageid,
hypercast.I_MessageStoreFSM fsm)
Store the message in the hashtable |
void |
remove(byte[] messageid)
Remove the message in the hashtable |
void |
setNotificationHandler(hypercast.NotificationHandler notificationHandler)
Sets the notification handler that is used to pass events from the message store to an application. |
org.w3c.dom.Element[] |
setStats(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath,
org.w3c.dom.Element newValue)
Sets statistics information for an object which implements this interface. |
void |
setStatsName(java.lang.String name)
Assigns a name to this I_Stats instance. |
void |
setTimer(hypercast.I_MessageStoreFSM fsm,
int index,
long delay_ms)
Set the timer |
void |
setTimer(hypercast.I_MessageStoreFSM fsm,
java.lang.Object obj,
long delay_ms)
Set the timer |
void |
start()
Start the timer thread in the message store The code here are copied from adpter class |
void |
stop()
Stop the thread |
void |
timerExpired(java.lang.Object timestamp)
Sync the message store periodically |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final short FSM_NO_SERVICE
public static final short FSM_H2H_ACK
public static final short FSM_E2E_ACK
public static final short FSM_DUPLICATE_ELIMINATION
public static final short FSM_SYNCHRONIZATION
public static final short FSM_INCAST
public static final short FSM_BEST_EFFORT_ORDERING
public static final short FSM_NAMING
public static final short STREAM_MESSAGE
public static final short MESSAGESTORE_MESSAGE
public static final short OTHER_MESSAGE
Constructor Detail |
public MessageStore(hypercast.OL_Socket socket, hypercast.HyperCastConfig config)
config
- HyperCastConfigsocket
- OL_SocketMethod Detail |
public void createFSMPool()
public void start()
public void stop()
public static boolean isValidServiceNumber(short serviceNumber)
serviceNumber
- service number
public static short getMsgType(short serviceNumber)
serviceNumber
- service number
public void setNotificationHandler(hypercast.NotificationHandler notificationHandler)
public void put(byte[] messageid, hypercast.I_MessageStoreFSM fsm)
messageid
- UniqueIDfsm
- I_MessageStoreFSMpublic hypercast.I_MessageStoreFSM get(byte[] messageid)
messageid
- UniqueID
public void remove(byte[] messageid)
messageid
- UniqueIDpublic void setTimer(hypercast.I_MessageStoreFSM fsm, int index, long delay_ms)
fsm
- I_MessageStoreFSMindex
- timestampIDdelay_ms
- time of delaypublic void setTimer(hypercast.I_MessageStoreFSM fsm, java.lang.Object obj, long delay_ms)
fsm
- I_MessageStoreFSMobj
- Object that will be returned when the timer expiresdelay_ms
- time of delaypublic void clearTimer(hypercast.I_MessageStoreFSM fsm, int index)
fsm
- I_MessageStoreFSMindex
- timestampIDpublic void clearTimer(hypercast.I_MessageStoreFSM fsm, java.lang.Object obj)
fsm
- I_MessageStoreFSMobj
- Object attached to the timerpublic long getTimer(hypercast.I_MessageStoreFSM fsm, int index)
fsm
- I_MessageStoreFSMindex
- timestampID
returns the delaypublic void timerExpired(java.lang.Object timestamp)
timestamp
- integerpublic java.lang.String getStatsName()
I_Stats
getStatsName
in interface I_Stats
I_Stats.getStatsName()
public void setStatsName(java.lang.String name)
I_Stats
setStatsName
in interface I_Stats
name
- the name assigned to the I_Stats instance.I_Stats.setStatsName(String)
public org.w3c.dom.Element[] getStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath) throws HyperCastStatsException
I_Stats
getStats
in interface I_Stats
xpath
- Specifies the statistic subtree to query.doc
- The document is used as a factory to create XML
objects such as Nodes and Elements as needed. TODO: describe
how the XML document in the doc is used.
HyperCastStatsException
- If the xpath does not specify a valid subtree.I_Stats.getStats(org.w3c.dom.Document, org.apache.xpath.XPath)
public org.w3c.dom.Element[] setStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath, org.w3c.dom.Element newValue) throws HyperCastStatsException
I_Stats
setStats
in interface I_Stats
xpath
- Specifies the statistic subtree to use when updating values.doc
- The document is used as a factory to create XML
objects such as Nodes and Elements as needed. TODO: describe
how the XML document in the doc is used.
HyperCastStatsException
- If the xpath does not specify a
valid subtree or if any part of the the subtree is read-only,
or if the newValue
does not conform with the
expected format.I_Stats.setStats(org.w3c.dom.Document, org.apache.xpath.XPath, org.w3c.dom.Element)
public org.w3c.dom.Element[] getReadSchema(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath) throws HyperCastStatsException
I_Stats
getReadSchema
in interface I_Stats
HyperCastStatsException
- If some part of the specified
subtree does not correctly implement this interface method.I_Stats.getReadSchema(org.w3c.dom.Document, org.apache.xpath.XPath)
public org.w3c.dom.Element[] getWriteSchema(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath) throws HyperCastStatsException
getWriteSchema
in interface I_Stats
doc
- Document used for create new elements or nodes.xpath
- XPath instance representing the statistics which is the root
of the sub-tree to be queried.
HyperCastStatsException
- If some part of the specified
subtree does not correctly implement this interface method.I_Stats.getWriteSchema(Document, XPath)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |