Tabnine Logo
StackBasedInheritableStrategy
Code IndexAdd Tabnine to your IDE (free)

How to use
StackBasedInheritableStrategy
in
com.orbitz.monitoring.api.engine

Best Java code snippets using com.orbitz.monitoring.api.engine.StackBasedInheritableStrategy (Showing top 7 results out of 315)

origin: com.orbitz.erma/erma-lib

/**
 * Creates a {@link BaseMonitoringEngineManager}
 * @param factory used to create {@link MonitorProcessor MonitorProcessors}
 * @param decomposer used to make properties of monitors {@link Serializable}
 */
public BaseMonitoringEngineManager(final MonitorProcessorFactory factory, Decomposer decomposer) {
 if (decomposer == null) {
  decomposer = new AttributeDecomposer();
 }
 
 this.factory = factory;
 this.decomposer = decomposer;
 this.inheritableStrategy = new StackBasedInheritableStrategy();
}

origin: com.orbitz.erma/erma-api

public void processMonitorForCompositeMonitor(Monitor monitor) {
  LinkedList stack = getStack();
  if (stack != null) {
    if (! stack.isEmpty()) {
      StackFrame stackFrame = (StackFrame) stack.getLast();
      CompositeMonitor parentMonitor = stackFrame.getCompositeMonitor();
      // only add this monitor being processed to a parent if it is enabled
      // by its monitoring level
      MonitoringLevel monitorLevel = monitor.getLevel();
      if ((monitorLevel != null) && (monitorLevel.hasHigherOrEqualPriorityThan(getEventPatternLevel()))) {
        parentMonitor.addChildMonitor(monitor);
      }
    } else {
      threadBasedMap.remove(Thread.currentThread());
    }
  }
}
origin: com.orbitz.erma/erma-api

public int clearCurrentThread() {
  LinkedList stack = getStack();
  int count = 0;
  if (stack != null) {
    count = stack.size();
    if (count > 0) {
      StringBuffer monitorNames = new StringBuffer();
      for (Iterator i = stack.iterator(); i.hasNext();) {
        StackFrame stackFrame = (StackFrame) i.next();
        Monitor m = stackFrame.getCompositeMonitor();
        String s = (String) m.get(Attribute.NAME);
        if (monitorNames.length() > 0) {
          monitorNames.append(", ");
        }
        monitorNames.append(s);
      }
      log.warn("clearing old CompositeMonitor refs for current thread; "+count+" found; names: "+monitorNames);
      stack.clear();
    }
  }
  return count;
}
origin: com.orbitz.erma/erma-api

LinkedList stack = getStack();
origin: com.orbitz.erma/erma-api

/**
 * This method should be called by all CompositeMonitor implementations
 * before they call monitorStarted().
 *
 * @param compositeMonitor the composite monitor
 */
public void compositeMonitorStarted(CompositeMonitor compositeMonitor) {
  if (getEventPatternLevel().hasHigherPriorityThan(compositeMonitor.getLevel())) {
    if (log.isDebugEnabled()) {
      log.debug("skipping " + compositeMonitor.getAsString(Attribute.NAME));
    }
    return;
  }
  LinkedList stack = getStack();
  if (stack == null) {
    stack = new LinkedList();
    threadBasedMap.put(Thread.currentThread(), stack);
  }
  stack.addLast(new StackFrame(compositeMonitor));
}
origin: com.orbitz.erma/erma-api

/**
 * This method should be called by all CompositeMonitor implementations
 * before they call process().
 *
 * @param monitor the monitor that is completed
 */
public void compositeMonitorCompleted(CompositeMonitor monitor) {
  LinkedList stack = getStack();
  if (stack != null && !stack.isEmpty()) {
    StackFrame target = new StackFrame(monitor);
    if (!stack.getLast().equals(target) && !stack.contains(target)) {
      // This monitor is being double processed on accident.
      // Ignore it.
      return;
    }
    while (!stack.getLast().equals(target)) {
      // A child monitor was not processed, process them now.
      StackFrame stackFrame = (StackFrame) stack.removeLast();
      CompositeMonitor missedMonitor = stackFrame.getCompositeMonitor();
      String name = (String) missedMonitor.get(Attribute.NAME);
      log.warn("unfinished child monitor \""+name+"\" found so will process now and remove; app is fine");
      MonitoringEngine.getInstance().process(missedMonitor);
    }
    stack.removeLast();
  }
}
origin: com.orbitz.erma/erma-api

LinkedList stack = getStack();
com.orbitz.monitoring.api.engineStackBasedInheritableStrategy

Most used methods

  • <init>
  • getEventPatternLevel
  • getStack

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Option (scala)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now