congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
CompositeMonitor
Code IndexAdd Tabnine to your IDE (free)

How to use
CompositeMonitor
in
com.orbitz.monitoring.api

Best Java code snippets using com.orbitz.monitoring.api.CompositeMonitor (Showing top 9 results out of 315)

origin: com.orbitz.erma/erma-api

/**
 * Adds the supplied CompositeMonitor to the stack for this thread. If this is the first
 * CompositeMonitor on this thread, a new LinkedList is created and added to a map holding all
 * stacks by Thread.
 * <p>
 * 
 * This method should be called by all CompositeMonitor implementations before they call
 * monitorStarted().
 * 
 * @param compositeMonitor the monitor to add to the stack
 */
public void compositeMonitorStarted(final CompositeMonitor compositeMonitor) {
 if (!isEnabled()) {
  return;
 }
 
 // this null check can probably go away if we replace the Monitor interface
 // with AbstractMonitor
 if (compositeMonitor.getLevel() == null) {
  if (log.isDebugEnabled()) {
   log.debug("skipping composite monitor with name " + compositeMonitor.get(Attribute.NAME)
     + ", it has no defined level");
  }
  return;
 }
 
 inheritableStrategy.compositeMonitorStarted(compositeMonitor);
}

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-lib

protected void writeMonitor(HierarchicalStreamWriter writer, Monitor monitor) {
  String monitorClassName = monitor.getClass().getName();
  int classIdx = monitorClassName.lastIndexOf('.');
  if (classIdx >= 0) {
    monitorClassName = monitorClassName.substring(classIdx + 1);
  }
  writer.startNode(monitorClassName);
  appendMonitorDataAsAttributes(writer, monitor);
  // recursively add all child monitors to dom tree
  if (CompositeMonitor.class.isAssignableFrom(monitor.getClass())) {
    CompositeMonitor cm = (CompositeMonitor) monitor;
    Collection childMonitors = cm.getChildMonitors();
    Iterator childIterator = childMonitors.iterator();
    while (childIterator.hasNext()) {
      Monitor childMonitor = (Monitor) childIterator.next();
      writeMonitor(writer, childMonitor);
    }
  }
  writer.endNode();
}
origin: com.orbitz.erma/erma-api

  StackFrame stackFrame = (StackFrame) i.next();
  CompositeMonitor monitor = stackFrame.getCompositeMonitor();
  inheritable.putAll(monitor.getInheritableAttributeHolders());
parentSequenceId = parent.getAsString(Attribute.SEQUENCE_ID);
origin: com.orbitz.erma/erma-api

CompositeMonitor monitor = stackFrame.getCompositeMonitor();
if (name.equals(monitor.get(Attribute.NAME))) {
  monitorToReturn = monitor;
  break;
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

/**
 * 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-lib

Collection childMonitors = compositeMonitor.getChildMonitors();
if(!childMonitors.isEmpty()) {
  StringBuffer lastBuffer = null;
origin: com.orbitz.erma/erma-lib

private Monitor getRenamedMonitor(Monitor monitor) {
  String newName = getMonitorNamePrefix(monitor) + 
      getAttributeAsStringWithDefault(monitor, Attribute.NAME, "");
  Monitor renamedMonitor;
  if (CompositeMonitor.class.isAssignableFrom(monitor.getClass())) {
    renamedMonitor = new NonLifecycleMonitor(newName, monitor.getAll(), ((CompositeMonitor) monitor).getChildMonitors());
  } else {
    renamedMonitor = new NonLifecycleMonitor(newName, monitor.getAll());
  }
  return renamedMonitor;
}
com.orbitz.monitoring.apiCompositeMonitor

Javadoc

A monitor that holds related submonitors. This can be useful for gathering multiple monitors and correlating them with some parent monitor.

Children of CompositeMonitors will implicitly inherit their parent's inheritable attributes. CompositeMonitors can designate attributes as inheritable by using the setInheritable methods. Attributes are not inheritable when using the set methods.

Most used methods

  • addChildMonitor
    Adds a child monitor to this composite monitor. The interface makes no prescription as to whether th
  • get
  • getAsString
  • getChildMonitors
    Gets the child monitors of this monitors.
  • getInheritableAttributeHolders
    Gets all AttributeHolder for which CompositeAttributeHolder#isInheritable() is true
  • getLevel

Popular in Java

  • Reactive rest calls using spring rest template
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Option (scala)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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