|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.peer.PeerInfoServiceInterface
public class PeerInfoServiceInterface
PeerInfoServiceInterface provides a pure interface object that permits interaction with the actual PeerInfoService implementation without giving access to the real object.
Field Summary |
---|
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_DISABLED, START_OK |
Constructor Summary | |
---|---|
PeerInfoServiceInterface(PeerInfoService theRealThing)
Only authorized constructor |
Method Summary | |
---|---|
long |
addMonitorListener(MonitorFilter monitorFilter,
long reportRate,
boolean includeCumulative,
MonitorListener monitorListener)
Get MonitorReports at a specified rates of metrics accrued over time from the ServiceMonitors (specified in the MonitorFilter) about the local Peer. |
void |
addRemoteMonitorListener(PeerID peerID,
MonitorFilter monitorFilter,
long reportRate,
boolean includeCumulative,
MonitorListener monitorListener,
long lease,
long timeout)
Get MonitorReports at a specified rates of metrics accrued over time from the ServiceMonitors (specified in the MonitorFilter) about the specified remote Peer. |
long |
getBestReportRate(long desiredReportRate)
Asynchronous reporting of Monitored data may be obtained only at rates supported by the MonitorManager on the peer. |
MonitorReport |
getCumulativeMonitorReport(MonitorFilter monitorFilter)
Get a MonitorReport of total accumulated metrics from the ServiceMonitors (specified in the MonitorFilter) since they were created/reset for the local Peer. |
void |
getCumulativeMonitorReport(PeerID peerID,
MonitorFilter monitorFilter,
MonitorListener monitorListener,
long timeout)
Get a MonitorReport of total accumulated metrics from the ServiceMonitors (specified in the MonitorFilter) since they were created/reset for the specified remote Peer. |
Advertisement |
getImplAdvertisement()
Returns the advertisement for this service. |
Service |
getInterface()
Service objects are not manipulated directly to protect usage of the service. |
PeerMonitorInfo |
getPeerMonitorInfo()
Obtain the monitoring capabilities of the Local Peer. |
void |
getPeerMonitorInfo(PeerID peerID,
PeerMonitorInfoListener peerMonitorInfoListener,
long timeout)
Obtain the monitoring capabilities of a Remote Peer. |
long[] |
getSupportedReportRates()
Asynchronous reporting of Monitored data may be obtained only at rates supported by the MonitorManager on the peer. |
void |
init(PeerGroup pg,
ID assignedID,
Advertisement impl)
Initialize the module, passing it its peer group and advertisement. |
boolean |
isLocalMonitoringAvailable()
See if Local Monitoring is available on this Peer Local monitoring is only available if you are using a version of of jxta.jar that was build with metering activated. |
boolean |
isLocalMonitoringAvailable(ModuleClassID moduleClassID)
See if Local monitoring is available from a specific ServiceMonitor. |
boolean |
isSupportedReportRate(long reportRate)
Asynchronous reporting of Monitored data may be obtained only at rates supported by the MonitorManager on the peer. |
boolean |
removeMonitorListener(MonitorListener monitorListener)
Stop the periodic reporting for all registered filters corresponding to this MonitorListener |
void |
removeRemoteMonitorListener(MonitorListener monitorListener,
long timeout)
Stop the periodic reporting for all registered filters to the all remote Peers corresponding to this MonitorListener. |
void |
removeRemoteMonitorListener(PeerID peerID,
MonitorListener monitorListener,
long timeout)
Stop the periodic reporting for all registered filters to the specified Peer corresponding to this MonitorListener. |
int |
startApp(String[] arg)
Complete any remaining initialization of the module. |
void |
stopApp()
Stop a module. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PeerInfoServiceInterface(PeerInfoService theRealThing)
theRealThing
- Method Detail |
---|
public Service getInterface()
getInterface
in interface Service
public Advertisement getImplAdvertisement()
getImplAdvertisement
in interface Service
ModuleImplAdvertisement
.public void init(PeerGroup pg, ID assignedID, Advertisement impl)
init
in interface Module
pg
- 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.impl
- 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 int startApp(String[] arg)
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.
This is here for temporary class hierarchy reasons. it is ALWAYS
ignored. By definition, the interface object protects the real
object's start/stop methods from being called
startApp
in interface Module
arg
- 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()
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.
This is here for temporary class hierarchy reasons. it is ALWAYS
ignored. By definition, the interface object protects the real
object's start/stop methods from being called This request is
currently ignored.
stopApp
in interface Module
public boolean isLocalMonitoringAvailable()
net.jxta.peer.PeerInfoService
See the document:
isLocalMonitoringAvailable
in interface PeerInfoService
public boolean isLocalMonitoringAvailable(ModuleClassID moduleClassID)
net.jxta.peer.PeerInfoService
See the document:
isLocalMonitoringAvailable
in interface PeerInfoService
moduleClassID
- The Module classID of the ServiceMonitor. Note that the ServiceMonitor
moduleClassID is not the same as moduleClassID of the Service
being monitored.
public long[] getSupportedReportRates()
net.jxta.peer.PeerInfoService
getSupportedReportRates
in interface PeerInfoService
public boolean isSupportedReportRate(long reportRate)
net.jxta.peer.PeerInfoService
isSupportedReportRate
in interface PeerInfoService
reportRate
- the report rate to check
public long getBestReportRate(long desiredReportRate)
net.jxta.peer.PeerInfoService
getBestReportRate
in interface PeerInfoService
desiredReportRate
- the desired rate
public PeerMonitorInfo getPeerMonitorInfo()
net.jxta.peer.PeerInfoService
The PeerMonitorInfo provides:
getPeerMonitorInfo
in interface PeerInfoService
public void getPeerMonitorInfo(PeerID peerID, PeerMonitorInfoListener peerMonitorInfoListener, long timeout) throws MonitorException
net.jxta.peer.PeerInfoService
The PeerMonitorInfo provides:
getPeerMonitorInfo
in interface PeerInfoService
peerID
- The PeerID of the Peer you wish information aboutpeerMonitorInfoListener
- The Listener to be told about the obtained PeerMonitorInfotimeout
- Generate a timeout event if no answer has been received in this time (in Milliseconds)
MonitorException
- if a monitor error occurspublic MonitorReport getCumulativeMonitorReport(MonitorFilter monitorFilter) throws MonitorException
net.jxta.peer.PeerInfoService
getCumulativeMonitorReport
in interface PeerInfoService
monitorFilter
- The MonitorFilter containing the specific ServiceMonitors and types of Service Metrics desired
MonitorException
- if a monitor error occurspublic void getCumulativeMonitorReport(PeerID peerID, MonitorFilter monitorFilter, MonitorListener monitorListener, long timeout) throws MonitorException
net.jxta.peer.PeerInfoService
getCumulativeMonitorReport
in interface PeerInfoService
peerID
- The PeerID of the Peer you wish information aboutmonitorFilter
- The MonitorFilter containing the specific ServiceMonitors and types of Service Metrics desiredmonitorListener
- The Listener to obtain the report when it arrives (or timed out)timeout
- The timeout for reporting that the information has not arrived.
MonitorException
- if a monitor error occurspublic long addMonitorListener(MonitorFilter monitorFilter, long reportRate, boolean includeCumulative, MonitorListener monitorListener) throws MonitorException
net.jxta.peer.PeerInfoService
There is a problem with the following approach:
addMonitorListener
in interface PeerInfoService
monitorFilter
- The MonitorFilter containing the specific ServiceMonitors and types of Service Metrics desiredreportRate
- The rate at which you wish metric delta reportsincludeCumulative
- Should the first report you receive be the cumulative data since the ServiceMonitors were created/reset?monitorListener
- The Listener to obtain the report when it arrives (or timed out)
MonitorException
- if a monitor error occurspublic void addRemoteMonitorListener(PeerID peerID, MonitorFilter monitorFilter, long reportRate, boolean includeCumulative, MonitorListener monitorListener, long lease, long timeout) throws MonitorException
net.jxta.peer.PeerInfoService
There is a problem with the following approach:
addRemoteMonitorListener
in interface PeerInfoService
peerID
- The PeerID of the Peer you wish information aboutmonitorFilter
- The MonitorFilter containing the specific ServiceMonitors and types of Service Metrics desiredreportRate
- The rate at which you wish metric delta reportsincludeCumulative
- Should the first report you receive be the cumulative data since the ServiceMonitors were created/reset?monitorListener
- The Listener to obtain the report when it arrives (or timed out)lease
- the leasetimeout
- The timeout for reporting that the information has not arrived.
MonitorException
- if a monitor error occurspublic boolean removeMonitorListener(MonitorListener monitorListener) throws MonitorException
net.jxta.peer.PeerInfoService
removeMonitorListener
in interface PeerInfoService
monitorListener
- the monitor listener
MonitorException
- if a monitor error occurspublic void removeRemoteMonitorListener(PeerID peerID, MonitorListener monitorListener, long timeout) throws MonitorException
net.jxta.peer.PeerInfoService
removeRemoteMonitorListener
in interface PeerInfoService
peerID
- The Peer that you wish to deregister periodic reportingmonitorListener
- The MonitorListener that was originally registeredtimeout
- The timeout for reporting that the remote listener was acknowledged as deregistered
MonitorException
- if a monitor error occurspublic void removeRemoteMonitorListener(MonitorListener monitorListener, long timeout) throws MonitorException
net.jxta.peer.PeerInfoService
removeRemoteMonitorListener
in interface PeerInfoService
monitorListener
- The MonitorListener that was originally registeredtimeout
- The timeout for reporting that the remote listener was acknowledged as deregistered
MonitorException
- if a monitor error occurs
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |