|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.meter.GenericServiceMonitor
public abstract class GenericServiceMonitor
Field Summary | |
---|---|
protected ServiceMetric |
cumulativeServiceMetric
|
protected ServiceMetric[] |
deltaServiceMetrics
|
protected ModuleImplAdvertisement |
implAdvertisement
|
protected MonitorManager |
monitorManager
|
protected long |
reportRate
|
protected int |
reportRateIndex
|
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_DISABLED, START_OK |
Constructor Summary | |
---|---|
GenericServiceMonitor()
|
Method Summary | |
---|---|
void |
beginCumulativeReport()
A request for a cumulative Report(s) are coming, prepare to receive them |
void |
beginPulse(ServiceMonitorPulseInfo pulseInfo)
|
protected abstract ServiceMetric |
collectServiceMetrics()
Get the service metrics accrued since the last pulse |
protected ServiceMetric |
createServiceMetric()
|
ServiceMonitorFilter |
createSupportedCumulativeServiceMonitorFilter(ServiceMonitorFilter serviceMonitorFilter)
Transform the provided ServiceMonitorFilter into one that is supported for cumulative reporting |
ServiceMonitorFilter |
createSupportedServiceMonitorFilter(ServiceMonitorFilter serviceMonitorFilter,
long reportRate)
Transform the provided ServiceMonitorFilter into one that is supported for periodic reporting at the specified rate |
void |
destroy()
Clean up. |
void |
endCumulativeReport()
Indication that the flurry of requests for cumulative Report is over |
void |
endPulse(ServiceMonitorPulseInfo pulseInfo)
|
protected ServiceMetric |
getCumulativeServiceMetric()
|
ServiceMetric |
getCumulativeServiceMetric(ServiceMonitorFilter serviceMonitorFilter,
long fromTime,
long toTime)
Get ServiceMetrics since the start (or last reset time) of this ServiceMonitor. |
ModuleClassID |
getModuleClassID()
Get ModuleClassID of this ServiceMonitor |
PeerGroup |
getPeerGroup()
|
ServiceMetric |
getServiceMetric(ServiceMonitorFilter serviceMonitorFilter,
long fromTime,
long toTime,
int reportIndex,
long reportRate)
Get ServiceMetrics accrued in during this pulse interval |
protected void |
init()
|
void |
init(MonitorManager monitorManager)
|
void |
init(PeerGroup group,
ID assignedID,
Advertisement advertisement)
Initialize the module, passing it its peer group and advertisement. |
void |
resetPulseRate(ServiceMonitorPulseInfo pulseInfo,
int oldPulseRateIndex)
|
void |
serviceMonitorFilterDeregistered(ServiceMonitorFilter serviceMonitorFilter,
int reportRateIndex,
long reportRate,
boolean retiredRate)
Information that the Monitor Manager is deregistering the Monitoring for this filter at this rate |
void |
serviceMonitorFilterRegistered(ServiceMonitorFilter serviceMonitorFilter,
int reportRateIndex,
long reportRate,
boolean newRate)
Information that the Monitor Manager has accepted a Monitoring for this filter at this rate |
int |
startApp(String[] args)
Complete any remaining initialization of the module. |
void |
stopApp()
Stop a module. |
void |
validateCumulativeServiceMonitorFilter(ServiceMonitorFilter serviceMonitorFilter)
Validate ServiceMonitorFilter for a cumulative Report |
void |
validateServiceMonitorFilter(ServiceMonitorFilter serviceMonitorFilter,
long reportRate)
Validate ServiceMonitorFilter for a periodic Reporting |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MonitorManager monitorManager
protected long reportRate
protected int reportRateIndex
protected ServiceMetric cumulativeServiceMetric
protected ServiceMetric[] deltaServiceMetrics
protected ModuleImplAdvertisement implAdvertisement
Constructor Detail |
---|
public GenericServiceMonitor()
Method Detail |
---|
public void init(PeerGroup group, ID assignedID, Advertisement advertisement)
net.jxta.platform.Module
init
in interface Module
group
- The PeerGroup from which this Module can obtain services.
If this module is a Service, this is also the PeerGroup of which this
module is a service.assignedID
- Identity of Module within group.
modules can use it as a the root of their namespace to create
names that are unique within the group but predictable by the
same module on another peer. This is normally the ModuleClassID
which is also the name under which the module is known by other
modules. For a group it is the PeerGroupID itself.
The parameters of a service, in the Peer configuration, are indexed
by the assignedID of that service, and a Service must publish its
run-time parameters in the Peer Advertisement under its assigned ID.advertisement
- The implementation advertisement for this
Module. It is permissible to pass null if no implementation
advertisement is available. This may happen if the
implementation was selected by explicit class name rather than
by following an implementation advertisement. Modules are not
required to support that style of loading, but if they do, then
their documentation should mention it.public void init(MonitorManager monitorManager)
init
in interface ServiceMonitorImpl
public int startApp(String[] args)
net.jxta.platform.Module
startApp()
is completed. That is
also the opportunity to supply arbitrary arguments (mostly to
applications).
If this module is a PeerGroup
service, it may be invoked
several times depending on its return value.
startApp
in interface Module
args
- An array of Strings forming the parameters for this
Module.
Module.START_OK
, Module.START_AGAIN_PROGRESS
,
Module.START_AGAIN_STALLED
, which indicates partial or complete
success, or any other value (negative values are
recommended for future compatibility), which indicates failure.public void stopApp()
net.jxta.platform.Module
init()
completes and should not assume that startApp()
has been
called or completed.
The Module cannot be forced to comply, but in the future
we might be able to deny it access to anything after some timeout.
stopApp
in interface Module
protected void init()
public ModuleClassID getModuleClassID()
net.jxta.meter.ServiceMonitor
getModuleClassID
in interface ServiceMonitor
public PeerGroup getPeerGroup()
protected ServiceMetric getCumulativeServiceMetric()
public void resetPulseRate(ServiceMonitorPulseInfo pulseInfo, int oldPulseRateIndex)
resetPulseRate
in interface ServiceMonitorImpl
public void validateCumulativeServiceMonitorFilter(ServiceMonitorFilter serviceMonitorFilter)
net.jxta.meter.ServiceMonitor
validateCumulativeServiceMonitorFilter
in interface ServiceMonitor
public ServiceMonitorFilter createSupportedCumulativeServiceMonitorFilter(ServiceMonitorFilter serviceMonitorFilter)
net.jxta.meter.ServiceMonitor
createSupportedCumulativeServiceMonitorFilter
in interface ServiceMonitor
public void validateServiceMonitorFilter(ServiceMonitorFilter serviceMonitorFilter, long reportRate)
net.jxta.meter.ServiceMonitor
validateServiceMonitorFilter
in interface ServiceMonitor
public ServiceMonitorFilter createSupportedServiceMonitorFilter(ServiceMonitorFilter serviceMonitorFilter, long reportRate)
net.jxta.meter.ServiceMonitor
createSupportedServiceMonitorFilter
in interface ServiceMonitor
protected ServiceMetric createServiceMetric()
protected abstract ServiceMetric collectServiceMetrics()
public void beginPulse(ServiceMonitorPulseInfo pulseInfo)
beginPulse
in interface ServiceMonitorImpl
public void endPulse(ServiceMonitorPulseInfo pulseInfo)
endPulse
in interface ServiceMonitorImpl
public void beginCumulativeReport()
net.jxta.meter.ServiceMonitor
beginCumulativeReport
in interface ServiceMonitor
ServiceMonitor.endCumulativeReport()
public void endCumulativeReport()
net.jxta.meter.ServiceMonitor
endCumulativeReport
in interface ServiceMonitor
ServiceMonitor.beginCumulativeReport()
public ServiceMetric getServiceMetric(ServiceMonitorFilter serviceMonitorFilter, long fromTime, long toTime, int reportIndex, long reportRate)
net.jxta.meter.ServiceMonitor
getServiceMetric
in interface ServiceMonitor
serviceMonitorFilter
- Filter Metrics based upon this MonitorFilterfromTime
- Beginning time as determined by the MonitorManagertoTime
- Ending time as determined by the MonitorManagerreportIndex
- Pulse Index of the reporting rate PyramidreportRate
- Reporting Rate (corresponding to the PulseNumber's index)public ServiceMetric getCumulativeServiceMetric(ServiceMonitorFilter serviceMonitorFilter, long fromTime, long toTime)
net.jxta.meter.ServiceMonitor
getCumulativeServiceMetric
in interface ServiceMonitor
serviceMonitorFilter
- Filter Metrics based upon this MonitorFilterfromTime
- Beginning time as determined by the MonitorManagertoTime
- Ending time as determined by the MonitorManagerServiceMonitor.beginCumulativeReport()
,
ServiceMonitor.endCumulativeReport()
public void serviceMonitorFilterRegistered(ServiceMonitorFilter serviceMonitorFilter, int reportRateIndex, long reportRate, boolean newRate)
net.jxta.meter.ServiceMonitor
serviceMonitorFilterRegistered
in interface ServiceMonitor
serviceMonitorFilter
- Accepted FilterreportRateIndex
- Pulse Index into pyramid of accepted ratereportRate
- Accepted reporting ratenewRate
- Is this a new reporting rate (ie you don't have any currently registered at this rate)public void serviceMonitorFilterDeregistered(ServiceMonitorFilter serviceMonitorFilter, int reportRateIndex, long reportRate, boolean retiredRate)
net.jxta.meter.ServiceMonitor
serviceMonitorFilterDeregistered
in interface ServiceMonitor
serviceMonitorFilter
- Deregistered FilterreportRateIndex
- Pulse Index into pyramid of deregistered filterreportRate
- Reporting rate of deregistered filterretiredRate
- Is this a retired filter the last one registered at this rate (ie you don't have to keep metrics for this rate any longer)public void destroy()
net.jxta.meter.ServiceMonitor
destroy
in interface ServiceMonitor
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |