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, org.ow2.jasmine.probe.outer.JasmineOuter, JOuterMBean

public abstract class JOuter
extends Thread
implements org.ow2.jasmine.probe.outer.JasmineOuter, JOuterMBean

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, danesa

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  org.ow2.jasmine.probe.JasmineOutput output
           
protected static String SEPARATOR
          CSV separator.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
JOuter(org.ow2.jasmine.probe.JasmineOutput output)
           
 
Method Summary
 String composeName(org.ow2.jasmine.probe.JasmineIndicatorValue jiv, String jsrName)
          Compose name of value
 String findDomain(org.ow2.jasmine.probe.JasmineIndicatorValue jiv)
           
 String findMbean(org.ow2.jasmine.probe.JasmineSingleResult jsr)
          Find the mbean property or generate one if do not exist.
 String findServer(org.ow2.jasmine.probe.JasmineIndicatorValue jiv)
           
 void flushData()
          Flush the Outer.
 int getMaxQueueSize()
           
 int getNbInserted()
           
 int getNbRejected()
           
 int getNbRetrieved()
           
 org.ow2.jasmine.probe.JasmineOutput getOutput()
           
 String getOutputName()
          Return the name of the indicator corresponding to this Collector
 String getOutputType()
           
 String getPublishLocation()
           
 int getQueueSize()
           
 boolean isRemoved()
           
protected  String outputProps(String output, HashMap<String,String> props, String separator)
          Construct a String containing properties to be published.
abstract  void processData(org.ow2.jasmine.probe.JasmineProbeResult result)
           
 void publishData(org.ow2.jasmine.probe.JasmineProbeResult result)
          Publish data on this Output
 void remove()
          Mark outer as removed.
 void resetMaxQueueSize()
           
 void resetNbInserted()
           
 void resetNbRejected()
           
 void resetNbRetrieved()
           
 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 org.ow2.jasmine.probe.JasmineOutput output

dateformat

protected SimpleDateFormat dateformat
Std format for the date.

Constructor Detail

JOuter

public JOuter(org.ow2.jasmine.probe.JasmineOutput output)
Method Detail

processData

public abstract void processData(org.ow2.jasmine.probe.JasmineProbeResult result)

getOutput

public org.ow2.jasmine.probe.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 org.ow2.jasmine.probe.outer.JasmineOuter

composeName

public String composeName(org.ow2.jasmine.probe.JasmineIndicatorValue jiv,
                          String jsrName)
Compose name of value

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

findMbean

public String findMbean(org.ow2.jasmine.probe.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

findDomain

public String findDomain(org.ow2.jasmine.probe.JasmineIndicatorValue jiv)

findServer

public String findServer(org.ow2.jasmine.probe.JasmineIndicatorValue jiv)

getOutputName

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

Specified by:
getOutputName in interface org.ow2.jasmine.probe.outer.JasmineOuter
Specified by:
getOutputName in interface JOuterMBean
Returns:
the name of the output

publishData

public void publishData(org.ow2.jasmine.probe.JasmineProbeResult result)
Publish data on this Output

Specified by:
publishData in interface org.ow2.jasmine.probe.outer.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 org.ow2.jasmine.probe.outer.JasmineOuter

isRemoved

public boolean isRemoved()
Specified by:
isRemoved in interface org.ow2.jasmine.probe.outer.JasmineOuter
Returns:
true if collector marked as removed.

getQueueSize

public int getQueueSize()
Specified by:
getQueueSize in interface JOuterMBean
Returns:
the size of the internal queue used to cache results

getOutputType

public String getOutputType()
Specified by:
getOutputType in interface JOuterMBean
Returns:
the output type

getMaxQueueSize

public int getMaxQueueSize()
Specified by:
getMaxQueueSize in interface JOuterMBean
Returns:
the maximum size of the queue

resetMaxQueueSize

public void resetMaxQueueSize()
Specified by:
resetMaxQueueSize in interface JOuterMBean

getNbInserted

public int getNbInserted()
Specified by:
getNbInserted in interface JOuterMBean
Returns:
the number of elements inserted in the queue

resetNbInserted

public void resetNbInserted()
Specified by:
resetNbInserted in interface JOuterMBean

getNbRejected

public int getNbRejected()
Specified by:
getNbRejected in interface JOuterMBean
Returns:
the number of elements rejected when trying to insert in the queue

resetNbRejected

public void resetNbRejected()
Specified by:
resetNbRejected in interface JOuterMBean

getNbRetrieved

public int getNbRetrieved()
Specified by:
getNbRetrieved in interface JOuterMBean
Returns:
the number of elements retrieved from the queue in order to be published

resetNbRetrieved

public void resetNbRetrieved()
Specified by:
resetNbRetrieved in interface JOuterMBean

getPublishLocation

public String getPublishLocation()
Specified by:
getPublishLocation in interface JOuterMBean
Returns:
the address used by the outer to publish results


Copyright © 2013 OW2 Consortium. All Rights Reserved.