|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hypercast.MonitorAndControl.Portal
A Portal runs an overlay socket such that the Monitor can establish communication with the Portal through the overlay network. An advertising protocol is run between Monitor and Portal for them to discover each other. A Portal provides the way to access an local I_Stats object from the remote Monitor. Portal accepts query message from the Monitor and replies. The query message coming from a Monitor can have one of the following purposes: 1. Read a list of statistics values of the I_Stats object. 2. Set a list of statistics values of the I_Stats object. 3. Get the schema of a list of readable statistics of the I_Stats object. 4. Get the schema of a list of writable statistics of the I_Stats object.
Constructor Summary | |
Portal(hypercast.HyperCastConfig config,
hypercast.I_Stats applicationStats,
java.lang.String applicationStatsRootName)
|
Method Summary | |
void |
closePortal()
Closes the portal. |
org.w3c.dom.Element[] |
getReadSchema(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
I_Stats#getReadSchema |
org.w3c.dom.Element[] |
getStats(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
I_Stats#getStats |
java.lang.String |
getStatsName()
Gets the element name of this I_Stats instance. |
org.w3c.dom.Element[] |
getWriteSchema(org.w3c.dom.Document doc,
org.apache.xpath.XPath xpath)
I_Stats#getWriteSchema |
void |
openPortal()
Opens the Portal . |
void |
receiveMCRawMessage(hypercast.MonitorAndControl.MCRawMessage message)
Receives an MC Raw message. |
void |
setSilentOff()
Causes a Portal to begin sending MonitorAdvertise messages to a Monitor |
void |
setSilentOn()
Causes a Portal to cease sending MonitorAdvertise messages to a Monitor |
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 |
startTranscript(java.lang.String filename)
Causes MCMessages to be recorded in a transcript
file. |
void |
stopTranscript()
Stops transcripting. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Portal(hypercast.HyperCastConfig config, hypercast.I_Stats applicationStats, java.lang.String applicationStatsRootName)
config
- Used to initialized various components of the Portal.applicationStats
- statistics object for statistics of the Portal applicationapplicationStatsRootName
- name of the root of the application statistics, ex. "Appl" or "Socket"
The user of the Monitor trying to access the statistics on the Portal should write the XPath query
String like: "/Stats/Appl/...".
To access NumSockets statistic in RunServer use this XPath string:
"/Stats/Appl/NumOfSockets
To access the logical address statistic of the second Socket statistic in RunServer use this XPath string:
"/Stats/Appl/Socket[2]/Node/LogicalAddress
To access the logical address statistic of a Portal's Socket use this XPath string:
"/Stats/Portal/Socket/Node/LogicalAddress
Assuming that the RunServer used "Appl" as the name of the root
of its stats. "Stats" is fixed by the implementation.Method Detail |
public void startTranscript(java.lang.String filename) throws java.io.FileNotFoundException, java.lang.IllegalStateException, HyperCastWarningRuntimeException
I_Portal
MCMessages
to be recorded in a transcript
file. Depending on the options present in the configuration
file either messages that are sent, received, or both will be
recorded.
startTranscript
in interface I_Portal
filename
- The name of the transcript file.
HyperCastWarningRuntimeException
- If the configuration
specifies that neither sent nor received messsages should be
recorded.
java.io.FileNotFoundException
- If the specified file cannot be accessed
java.lang.IllegalStateException
- If a transcript is already startedI_Portal.startTranscript(String)
public void stopTranscript() throws java.lang.IllegalStateException, HyperCastWarningRuntimeException
I_Portal
stopTranscript
in interface I_Portal
java.lang.IllegalStateException
- If no transcript is active.
HyperCastWarningRuntimeException
I_Portal.stopTranscript()
public void openPortal()
I_Portal
Portal
. This causes the
PortalAdvertiser
thread to unblock so that
MCAdvertiseMessages
begin to flow from the
Portal
to the Monitor
.
A Portal
cannot be used until it is opened.
openPortal
in interface I_Portal
I_Portal.openPortal()
public void closePortal()
I_Portal
PortalAdvertiser
thread to block so that
MCAdvertiseMessages
cease to flow from the
Portal
to the Monitor
.
closePortal
in interface I_Portal
I_Portal.closePortal()
public void setSilentOn()
I_Portal
setSilentOn
in interface I_Portal
I_Portal.setSilentOff()
public void setSilentOff()
I_Portal
setSilentOff
in interface I_Portal
I_Portal.setSilentOff()
public void receiveMCRawMessage(hypercast.MonitorAndControl.MCRawMessage message)
hypercast.MonitorAndControl.I_MCRaw_Callback
receiveMCRawMessage
in interface hypercast.MonitorAndControl.I_MCRaw_Callback
message
- Raw message that is passed to the callbackpublic 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(java.lang.String)
public org.w3c.dom.Element[] getStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath) throws HyperCastStatsException
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.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
getReadSchema
in interface I_Stats
HyperCastStatsException
- If some part of the specified
subtree does not correctly implement this interface method.public org.w3c.dom.Element[] getWriteSchema(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath) throws HyperCastStatsException
getWriteSchema
in interface I_Stats
HyperCastStatsException
- If some part of the specified
subtree does not correctly implement this interface method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |