Examples of Monitor


Examples of org.apache.derby.iapi.services.monitor.Monitor

    // that the monitor instance and the class is not garbage collected
    // See Sun's bug 4057924 in Java Developer Section 97/08/06

    Object[] keepItems = new Object[3];
    keepItems[0] = this;
    keepItems[1] = new Monitor();
    keepItems[2] = msgService;
    dontGC = new AntiGC(keepItems);

    Thread dontGCthread = getDaemonThread(dontGC, "antiGC", true);
    dontGCthread.start();
View Full Code Here

Examples of org.apache.derby.iapi.services.monitor.Monitor

    // that the monitor instance and the class is not garbage collected
    // See Sun's bug 4057924 in Java Developer Section 97/08/06

    Object[] keepItems = new Object[3];
    keepItems[0] = this;
    keepItems[1] = new Monitor();
    keepItems[2] = msgService;
    dontGC = new AntiGC(keepItems);

    Thread dontGCthread = getDaemonThread(dontGC, "antiGC", true);
    dontGCthread.start();
View Full Code Here

Examples of org.apache.derby.iapi.services.monitor.Monitor

    // that the monitor instance and the class is not garbage collected
    // See Sun's bug 4057924 in Java Developer Section 97/08/06

    Object[] keepItems = new Object[3];
    keepItems[0] = this;
    keepItems[1] = new Monitor();
    keepItems[2] = msgService;
    dontGC = new AntiGC(keepItems);

    Thread dontGCthread = getDaemonThread(dontGC, "antiGC", true);
    dontGCthread.start();
View Full Code Here

Examples of org.apache.felix.upnp.basedriver.importer.core.event.structs.Monitor

    ctrl = new MyCtrlPoint(Activator.bc, subQueue, notifierQueue);
   
    //Enable CyberLink re-new for Event
    ctrl.setNMPRMode(true);
     
    this.monitor=new Monitor();
    this.notifier = new Notifier(notifierQueue,monitor);
    this.subScriber = new SubScriber(ctrl, subQueue,monitor);
   
    ctrl.start();
    subScriber.start();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.DecommissionManager.Monitor

      LOG.info("Skip counting items in the file tree");
    }

    // initialize heartbeat & leasemanager threads
    this.hbthread = new Daemon(new HeartbeatMonitor());
    this.lmthread = new Daemon(leaseManager.new Monitor());

    // start heartbeat & leasemanager threads
    hbthread.start();
    lmthread.start();

    // initialize replication threads
    this.underreplthread = new Daemon(new UnderReplicationMonitor());
    this.overreplthread = new Daemon(new OverReplicationMonitor());

    // start replication threds
    underreplthread.start();
    overreplthread.start();

    this.hostsReader = new HostsFileReader(conf.get("dfs.hosts", ""),
      conf.get("dfs.hosts.exclude", ""));
    this.dnthread = new Daemon(new DecommissionManager(this).new Monitor(
      conf.getInt("dfs.namenode.decommission.interval", 30),
      conf.getInt("dfs.namenode.decommission.nodes.per.interval", 5)));
    dnthread.start();

    this.dnsToSwitchMapping = ReflectionUtils.newInstance(
View Full Code Here

Examples of org.apache.hama.monitor.Monitor

            1000, monitorPeriod, TimeUnit.MILLISECONDS);
      }
    }

    if (conf.getBoolean("bsp.monitor.enabled", false)) {
      new Monitor(conf, zk, this.groomServerName).start();
    }

    if (conf.getBoolean("bsp.monitor.fd.enabled", false)) {
      this.sensor.set(FDProvider.createSensor(conf.getClass(
          "bsp.monitor.fd.sensor.class", UDPSensor.class, Sensor.class),
View Full Code Here

Examples of org.apache.juddi.monitor.Monitor

   */
  public AxisProcessor(Message soapResponse,MessageContext messageContext)
  {
    // get a new monitor from the MonitorFactory
   
    Monitor monitor = MonitorFactory.getMonitor();
   
    // if monitoring is turned on inspect the MessageContext

    if (monitor != null)
      monitor.inspectMessageContext(messageContext);

    // grab a reference to the SOAP request from
    // the Message Context

    Message soapRequest = messageContext.getRequestMessage();

    // write the SOAP request XML out to the log (on debug)

    try { log.debug(soapRequest.getSOAPPartAsString()); }
    catch(AxisFault af) {
      af.printStackTrace();
    }

    Element request = null;
    Element response = null;
    String function = null;
    String generic = null;

    try
    {
      // pull the uddi request xml element from
      // the body of the soapRequest

      SOAPEnvelope env = soapRequest.getSOAPEnvelope();
      SOAPBodyElement requestBody = env.getFirstBody();
      request = requestBody.getAsDOM();

      // make the monitor inspect the SOAP Body
      // DOM element
      if (monitor != null)
        monitor.inspectUDDIRequest(request);

      // grab the function name from this element -
      // we'll need this to lookup the xml handler
      // to use to unmarshal the xml into a juddi
      // object.

      function = request.getLocalName();

      // grab the generic value - we'll need it in
      // the event that an exception is thrown.

      generic = request.getAttribute("generic");
      if (generic == null)
        generic = IRegistry.UDDI_V2_GENERIC;

      // lookup the appropriate xml handler, throw
      // an UnsupportedException if one could not be
      // located.

      IHandler requestHandler = maker.lookup(function);
      if (requestHandler == null)
        throw new UnsupportedException("The request " +
          "type is unknown: " +function);

      // unmarshal the raw xml into an associated
      // jUDDI request object.

      RegistryObject uddiRequest = requestHandler.unmarshal(request);

      // make the monitor inspect the UDDI request
      // object
      if (monitor != null)
        monitor.inspectRegistryObject(uddiRequest);

      // Determine if this message came from through
      // the Publish, Inquiry or Admin API and handle
      // it appropriately.

      Object juddiServlet = messageContext.getProperty("transport.http.servlet");

      // confirm that the the appropriate endpoint
      // was used to invoke the selected jUDDI/UDDI
      // function.

      if((juddiServlet instanceof InquiryServlet) &&
         (!(uddiRequest instanceof org.apache.juddi.datatype.request.Inquiry)))
      {
        throw new RegistryException("Inquiry API " +
          "does not support function: "+function);
      }
      else if (juddiServlet instanceof PublishServlet &&
         (!(uddiRequest instanceof org.apache.juddi.datatype.request.Publish) &&
          !(uddiRequest instanceof org.apache.juddi.datatype.request.SecurityPolicy)))
      {
        throw new RegistryException("Publish API " +
          "does not support function: "+function);
      }
      else if ((juddiServlet instanceof AdminServlet) &&    // Admin
         (!(uddiRequest instanceof org.apache.juddi.datatype.request.Admin)))
      {
        throw new RegistryException("Admin API " +
          "does not support function: "+function);
      }

      // grab a reference to the shared jUDDI registry
      // instance (make sure it's running) and execute
      // the requested UDDI function.

      RegistryObject uddiResponse = null;
     
      RegistryEngine registry = RegistryServlet.getRegistry();
      if ((registry != null) && (registry.isAvailable()))
        uddiResponse = registry.execute(uddiRequest);
      else
        throw new BusyException("The Registry is unavailable");

      // create a new 'temp' XML element. This
      // element is used as a container in which
      // to marshal the UDDI response into.

      Document document = XMLUtils.createDocument();
      Element element = document.createElement("temp");

      // lookup the appropriate response handler
      // and marshal the juddi object into the
      // appropriate xml format (we only support
      // uddi v2.0 at this time) attaching results
      // to the temporary 'temp' element.

      IHandler responseHandler = maker.lookup(uddiResponse.getClass().getName());
      responseHandler.marshal(uddiResponse,element);

      // grab a reference to the 'temp' element's
      // only child here (this has the effect of
      // discarding the temp element) and appending
      // this child to the soap response body.

      response = (Element)element.getFirstChild();
    }
    catch(RegistryException rex)
    {
      log.error(rex.getMessage(),rex);

      String fCode = rex.getFaultCode();
      String fString = rex.getFaultString();
      String fActor = rex.getFaultActor();

      DispositionReport dispRpt = rex.getDispositionReport();
      if (dispRpt != null)
      {
        dispRpt.setGeneric(generic);
        dispRpt.setOperator(Config.getOperator());
      }

      if (monitor != null)
        monitor.addMonitorFault(fString);

      response = createFault(fCode,fString,fActor,dispRpt);
    }
    catch(AxisFault axf)
    {
      log.error(axf.getMessage(),axf);

      String fCode = String.valueOf(axf.getFaultCode());
      String fString = axf.getFaultString();
      String fActor = axf.getFaultActor();

      if (monitor != null)
        monitor.addMonitorFault(fString);

      response = createFault(fCode,fString,fActor,null);
    }
    catch(Exception ex)
    {
      log.error(ex.getMessage(),ex);

      String fCode = null;
      String fString = ex.getMessage();
      String fActor = null;

      if (monitor != null)
        monitor.addMonitorFault(fString);

      response = createFault(fCode,fString,fActor,null);
    }
    finally
    {
      // write the monitored information to the currently
      // configured 'Monitor' implemneted registry (the
      // default Monitor implementation writes the monitored
      // information to a database table via JDBC).

      if (monitor != null)
        monitor.log();
    }

    try {
      SOAPBodyElement soapRespBody = new SOAPBodyElement(response);
      SOAPEnvelope soapRespEnv = soapResponse.getSOAPEnvelope();
View Full Code Here

Examples of org.apache.openejb.api.Monitor

        // Used as the prefix for the MBeanAttributeInfo
        private final String method;

        public Stats(Method method, Monitor classAnnotation) {
            Monitor methodAnnotation = method.getAnnotation(Monitor.class);

            int window = (methodAnnotation != null) ? methodAnnotation.sample() : (classAnnotation != null) ? classAnnotation.sample() : 2000;

            this.samples = new SynchronizedDescriptiveStatistics(window);
            String s = ",";

            StringBuilder sb = new StringBuilder(method.getName());
View Full Code Here

Examples of org.apache.tuscany.core.system.annotation.Monitor

*/
public class MonitorProcessor extends ImplementationProcessorSupport {

    @Override
    public void visitMethod(Method method, ComponentType type) throws ConfigurationLoadException {
        Monitor annotation = method.getAnnotation(Monitor.class);
        if (annotation != null) {
            if (!Modifier.isPublic(method.getModifiers())) {
                InvalidSetterException e = new InvalidSetterException("Monitor setter method is not public");
                e.setIdentifier(method.toString());
                throw e;
View Full Code Here

Examples of org.apache.tuscany.core.system.annotation.Monitor

    }

    @Override
    public void visitField(Field field, ComponentType type) throws ConfigurationLoadException {
        int modifiers = field.getModifiers();
        Monitor annotation = field.getAnnotation(Monitor.class);
        if (annotation != null) {
            if (!Modifier.isPublic(modifiers) && !Modifier.isProtected(modifiers)) {
                InvalidSetterException e = new InvalidSetterException("Monitor field is not public or protected");
                e.setIdentifier(field.getName());
                throw e;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.