org.ow2.jasmine.monitoring.mbeancmd.osgi.internal
Class ProbeServiceImpl

java.lang.Object
  extended by org.ow2.jasmine.monitoring.mbeancmd.osgi.internal.ProbeServiceImpl
All Implemented Interfaces:
JasmineProbeManager

public class ProbeServiceImpl
extends java.lang.Object
implements JasmineProbeManager

This class exposes an OSGi service bundle that implements the JasmineProbeManager interface. It reads its configuration in a probe-config.xml file. Called today by the jasmine-eos module ProbeManager. It replaces the former part embedded in the jasmine eventswitch.

Author:
Philippe Durieux

Constructor Summary
ProbeServiceImpl(org.osgi.framework.BundleContext bc)
          Inject the BundleContext in the IPojo
 
Method Summary
 void addProbeListener(JasmineProbeListener listener)
          Register a ProbeListener in order to be notified by probe state changes.
 void changeOutput(JasmineOutput newoutput)
           
 void changeProbe(JasmineProbe newprobe)
           
 void changeTarget(JasmineTarget newtarget)
           
 void createOutput(JasmineOutput newoutput)
          Create a new Output
 int createProbe(JasmineProbe probe)
          Create a Probe defined by a JasmineProbe object value
 void createTarget(JasmineTarget newtarget)
          Create a new Target
 JasmineOutput findOutput(java.lang.String name)
          Get an OutputProbe by its Id
 JasmineTarget findTarget(java.lang.String targetId)
          Get a TargetProbe by its Id
 java.util.Set<javax.management.ObjectName> getMBeans(JasmineTarget jt, java.lang.String pattern)
          Get the list of mbeans matching a pattern for this target.
 java.util.Collection<JasmineOutput> getOutputs()
           
 java.util.Collection<JasmineProbe> getProbes()
           
 java.util.Collection<JasmineTarget> getTargets()
           
 void loadConfig(java.lang.String path)
          Load configuration from the specified file
 void publishChange(JasmineProbe probe)
           
 void removeAllProbes()
          Remove all probes
 void removeOutput(java.lang.String name)
          remove an output
 void removeProbe(int probeId)
           
 void removeProbeListener(JasmineProbeListener listener)
          Unregister a ProbeListener
 void removeTarget(java.lang.String name)
          remove an target
 void saveConfig(java.lang.String path)
          Save back configuration in probe-config.xml
 void start()
          Read the configuration when module is set.
 void startAllProbes()
          Start all the probes Continues starting probe even if one is in error (maybe already started)
 void startProbe(int probeId)
           
 void stop()
          module is invalidated.
 void stopAllProbes()
          Stop all the probes Continues stopping probe even if one is in error
 void stopProbe(int probeId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProbeServiceImpl

public ProbeServiceImpl(org.osgi.framework.BundleContext bc)
Inject the BundleContext in the IPojo

Parameters:
bc -
Method Detail

start

public void start()
Read the configuration when module is set.


stop

public void stop()
module is invalidated.


createOutput

public void createOutput(JasmineOutput newoutput)
                  throws JasmineProbeException
Create a new Output

Specified by:
createOutput in interface JasmineProbeManager
Parameters:
newoutput - output description
Throws:
JasmineProbeException

changeOutput

public void changeOutput(JasmineOutput newoutput)
                  throws JasmineProbeException
Specified by:
changeOutput in interface JasmineProbeManager
Throws:
JasmineProbeException

removeOutput

public void removeOutput(java.lang.String name)
                  throws JasmineProbeException
remove an output

Specified by:
removeOutput in interface JasmineProbeManager
Parameters:
name - ident of the output to remove
Throws:
JasmineProbeException

findOutput

public JasmineOutput findOutput(java.lang.String name)
Get an OutputProbe by its Id

Specified by:
findOutput in interface JasmineProbeManager
Parameters:
name - ident of the output

getOutputs

public java.util.Collection<JasmineOutput> getOutputs()
                                               throws JasmineProbeException
Specified by:
getOutputs in interface JasmineProbeManager
Throws:
JasmineProbeException

createTarget

public void createTarget(JasmineTarget newtarget)
                  throws JasmineProbeException
Create a new Target

Specified by:
createTarget in interface JasmineProbeManager
Parameters:
newtarget - target description
Throws:
JasmineProbeException

changeTarget

public void changeTarget(JasmineTarget newtarget)
                  throws JasmineProbeException
Specified by:
changeTarget in interface JasmineProbeManager
Throws:
JasmineProbeException

removeTarget

public void removeTarget(java.lang.String name)
                  throws JasmineProbeException
remove an target

Specified by:
removeTarget in interface JasmineProbeManager
Parameters:
name - ident of the target to remove
Throws:
JasmineProbeException

findTarget

public JasmineTarget findTarget(java.lang.String targetId)
Get a TargetProbe by its Id

Specified by:
findTarget in interface JasmineProbeManager
Parameters:
targetId - ident of the target

getTargets

public java.util.Collection<JasmineTarget> getTargets()
Specified by:
getTargets in interface JasmineProbeManager

createProbe

public int createProbe(JasmineProbe probe)
                throws JasmineProbeException
Create a Probe defined by a JasmineProbe object value

Specified by:
createProbe in interface JasmineProbeManager
Parameters:
probe - the object value
Returns:
allocated probe id
Throws:
JasmineProbeException

changeProbe

public void changeProbe(JasmineProbe newprobe)
                 throws JasmineProbeException
Specified by:
changeProbe in interface JasmineProbeManager
Throws:
JasmineProbeException

removeProbe

public void removeProbe(int probeId)
                 throws JasmineProbeException
Specified by:
removeProbe in interface JasmineProbeManager
Throws:
JasmineProbeException

removeAllProbes

public void removeAllProbes()
                     throws JasmineProbeException
Remove all probes

Specified by:
removeAllProbes in interface JasmineProbeManager
Throws:
JasmineProbeException

startProbe

public void startProbe(int probeId)
                throws JasmineProbeException
Specified by:
startProbe in interface JasmineProbeManager
Throws:
JasmineProbeException

stopProbe

public void stopProbe(int probeId)
               throws JasmineProbeException
Specified by:
stopProbe in interface JasmineProbeManager
Throws:
JasmineProbeException

stopAllProbes

public void stopAllProbes()
                   throws JasmineProbeException
Stop all the probes Continues stopping probe even if one is in error

Specified by:
stopAllProbes in interface JasmineProbeManager
Throws:
JasmineProbeException

startAllProbes

public void startAllProbes()
                    throws JasmineProbeException
Start all the probes Continues starting probe even if one is in error (maybe already started)

Specified by:
startAllProbes in interface JasmineProbeManager
Throws:
JasmineProbeException

getProbes

public java.util.Collection<JasmineProbe> getProbes()
Specified by:
getProbes in interface JasmineProbeManager

saveConfig

public void saveConfig(java.lang.String path)
                throws JasmineProbeException
Save back configuration in probe-config.xml

Specified by:
saveConfig in interface JasmineProbeManager
Parameters:
path - LATER: path where configuration will be saved.
Throws:
JasmineProbeException

loadConfig

public void loadConfig(java.lang.String path)
                throws JasmineProbeException
Load configuration from the specified file

Specified by:
loadConfig in interface JasmineProbeManager
Parameters:
path - File where config will be loaded
Throws:
JasmineProbeException

addProbeListener

public void addProbeListener(JasmineProbeListener listener)
Register a ProbeListener in order to be notified by probe state changes. Maybe other events will be considered...

Specified by:
addProbeListener in interface JasmineProbeManager
Parameters:
listener - object that treats the probe state change

removeProbeListener

public void removeProbeListener(JasmineProbeListener listener)
Unregister a ProbeListener

Specified by:
removeProbeListener in interface JasmineProbeManager
Parameters:
listener - object that treats the probe state change

getMBeans

public java.util.Set<javax.management.ObjectName> getMBeans(JasmineTarget jt,
                                                            java.lang.String pattern)
                                                     throws JasmineProbeException
Get the list of mbeans matching a pattern for this target. TODO: should pass the target name

Specified by:
getMBeans in interface JasmineProbeManager
Parameters:
jt - The JasmineTarget
pattern - ObjectName pattern
Returns:
Set of ObjectName
Throws:
JasmineProbeException

publishChange

public void publishChange(JasmineProbe probe)


Copyright © 2011 OW2 Consortium. All Rights Reserved.