org.ow2.jasmine.probe.outers
Class JOuter

java.lang.Object
  extended by java.lang.Thread
      extended by org.ow2.jasmine.probe.outers.JOuter
All Implemented Interfaces:
Runnable, JasmineOuter

public abstract class JOuter
extends Thread
implements JasmineOuter

Outer instance. this abstract class should be derived in different forms, depending of the type of output: console, file, mule, etc... These implementations are in separate modules.

Author:
durieuxp

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  SimpleDateFormat dateformat
          Std format for the date.
protected  org.ow2.util.log.Log logger
          logger used for outers
protected  JasmineOutput output
           
protected static String SEPARATOR
          CSV separator.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
JOuter(JasmineOutput output)
           
 
Method Summary
 String composeName(JasmineIndicatorValue jiv, String jsrName)
          Compose name of value
 String findMbean(JasmineSingleResult jsr)
          Find the mbean property or generate one if do not exist.
 void flushData()
          Flush the Outer.
 JasmineOutput getOutput()
           
 String getOutputName()
          Return the name of the indicator corresponding to this Collector
 boolean isRemoved()
           
protected  String outputProps(String output, HashMap<String,String> props, String separator)
          Construct a String containing properties to be published.
abstract  void processData(JasmineProbeResult result)
           
 void publishData(JasmineProbeResult result)
          Publish data on this Output
 void remove()
          Mark outer as removed.
 void run()
          run method for Thread implementation.
 void stopIt()
          stop the AbstractOuter
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected org.ow2.util.log.Log logger
logger used for outers


SEPARATOR

protected static final String SEPARATOR
CSV separator.

See Also:
Constant Field Values

output

protected JasmineOutput output

dateformat

protected SimpleDateFormat dateformat
Std format for the date.

Constructor Detail

JOuter

public JOuter(JasmineOutput output)
Method Detail

processData

public abstract void processData(JasmineProbeResult result)

getOutput

public JasmineOutput getOutput()

run

public void run()
run method for Thread implementation.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

stopIt

public void stopIt()
stop the AbstractOuter


flushData

public void flushData()
Flush the Outer. Default implementation: do nothing.

Specified by:
flushData in interface JasmineOuter

composeName

public String composeName(JasmineIndicatorValue jiv,
                          String jsrName)
Compose name of value

Parameters:
jiv -
jsrName - name of the JasmineSingleResult
Returns:
Name of the value

findMbean

public String findMbean(JasmineSingleResult jsr)
Find the mbean property or generate one if do not exist. This is for compatibility. Will be removed in 2.0.

Parameters:
jsr -
Returns:
a mbean valid objectname

getOutputName

public String getOutputName()
Return the name of the indicator corresponding to this Collector

Specified by:
getOutputName in interface JasmineOuter

publishData

public void publishData(JasmineProbeResult result)
Publish data on this Output

Specified by:
publishData in interface JasmineOuter
Parameters:
result - data to publish

outputProps

protected String outputProps(String output,
                             HashMap<String,String> props,
                             String separator)
Construct a String containing properties to be published.

Parameters:
output - contains properties that are already treated
props - properties to treat
separator - used to delimit
Returns:
String containing properties to be published.

remove

public void remove()
Mark outer as removed. Called when a JasmineOuterService stops.

Specified by:
remove in interface JasmineOuter

isRemoved

public boolean isRemoved()
Specified by:
isRemoved in interface JasmineOuter
Returns:
true if collector marked as removed.


Copyright © 2012 OW2 Consortium. All Rights Reserved.