Package javax.management

Examples of javax.management.Notification


        // Notify our interested LifecycleListeners
        lifecycle.fireLifecycleEvent(BEFORE_STOP_EVENT, null);
       
        // Send j2ee.state.stopping notification
        if (this.getObjectName() != null) {
            Notification notification =
                new Notification("j2ee.state.stopping", this.getObjectName(),
                                sequenceNumber++);
            broadcaster.sendNotification(notification);
        }
       
        // Mark this application as unavailable while we shut down
        setAvailable(false);

        // Binding thread
        ClassLoader oldCCL = bindThread();

        // Stop our filters
        filterStop();

        // Stop ContainerBackgroundProcessor thread
        super.threadStop();

        if ((manager != null) && (manager instanceof Lifecycle)) {
            ((Lifecycle) manager).stop();
        }

        // Finalize our character set mapper
        setCharsetMapper(null);

        // Normal container shutdown processing
        if (log.isDebugEnabled())
            log.debug("Processing standard container shutdown");
        // Notify our interested LifecycleListeners
        lifecycle.fireLifecycleEvent(STOP_EVENT, null);
        started = false;

        try {

            // Stop the Valves in our pipeline (including the basic), if any
            if (pipeline instanceof Lifecycle) {
                ((Lifecycle) pipeline).stop();
            }

            // Stop our child containers, if any
            Container[] children = findChildren();
            for (int i = 0; i < children.length; i++) {
                if (children[i] instanceof Lifecycle)
                    ((Lifecycle) children[i]).stop();
            }

            // Stop our application listeners
            listenerStop();

            // Stop resources
            resourcesStop();

            if ((realm != null) && (realm instanceof Lifecycle)) {
                ((Lifecycle) realm).stop();
            }
            if ((cluster != null) && (cluster instanceof Lifecycle)) {
                ((Lifecycle) cluster).stop();
            }
            if ((logger != null) && (logger instanceof Lifecycle)) {
                ((Lifecycle) logger).stop();
            }
            if ((loader != null) && (loader instanceof Lifecycle)) {
                ((Lifecycle) loader).stop();
            }

        } finally {

            // Unbinding thread
            unbindThread(oldCCL);

        }

        // Send j2ee.state.stopped notification
        if (this.getObjectName() != null) {
            Notification notification =
                new Notification("j2ee.state.stopped", this.getObjectName(),
                                sequenceNumber++);
            broadcaster.sendNotification(notification);
        }
       
        // Reset application context
View Full Code Here


     *
     */
    public void destroy() throws Exception {
        if( oname != null ) {
            // Send j2ee.object.deleted notification
            Notification notification =
                new Notification("j2ee.object.deleted", this.getObjectName(),
                                sequenceNumber++);
            broadcaster.sendNotification(notification);
        }
        super.destroy();

View Full Code Here

                Registry.getRegistry(null, null)
                    .registerComponent(this, oname, null);
               
                // Send j2ee.object.created notification
                if (this.getObjectName() != null) {
                    Notification notification = new Notification(
                                                        "j2ee.object.created",
                                                        this.getObjectName(),
                                                        sequenceNumber++);
                    broadcaster.sendNotification(notification);
                }
View Full Code Here

        // Notify our interested LifecycleListeners
        lifecycle.fireLifecycleEvent(INIT_EVENT, null);

        // Send j2ee.state.starting notification
        if (this.getObjectName() != null) {
            Notification notification = new Notification("j2ee.state.starting",
                                                        this.getObjectName(),
                                                        sequenceNumber++);
            broadcaster.sendNotification(notification);
        }
       
View Full Code Here

        if ((newValue == null  && oldValue == null)
            || (newValue != null  && newValue.equals(oldValue))) {
            return;
        }
        m_sequenceNumber++;
        Notification notification = new AttributeChangeNotification(this,
            m_sequenceNumber, timeStamp, msg, attributeName, attributeType,
            oldValue, newValue);
        sendNotification(notification);
        m_instanceManager.getFactory().getLogger().log(Logger.INFO,
            "Notification sent");
View Full Code Here

    try {
      updateMetricNames();
      long channelCount = SharedChannelGroup.getInstance().size();
      //log.info("\n\tChanne,l Count:" + channelCount);
      submitMetric("netty.channels.count", channelCount);
      Notification notif = new Notification(MetricProvider.METRIC_NOTIFICATION, OBJECT_NAME, tick.incrementAndGet(), System.currentTimeMillis());
      final JSONObject json = new JSONObject();
      final JSONObject envelope = new JSONObject();
      envelope.put("metrics", json);
      notif.setUserData(json);
      pushRemoteMetrics(json);
      json.put("ts", System.currentTimeMillis());     
      json.put("heap", processMemoryUsage(memMxBean.getHeapMemoryUsage()));
      json.put("non-heap", processMemoryUsage(memMxBean.getNonHeapMemoryUsage()))
      json.put("thread-states*", new JSONObject(getThreadStates()));
View Full Code Here

  /**
   * Collects metric names from participating metric providers
   * @throws JSONException thrown on any json exception
   */
  protected void updateMetricNames() throws JSONException {
    Notification notif = new Notification(MetricProvider.METRIC_NAME_NOTIFICATION, OBJECT_NAME, tick.incrementAndGet(), System.currentTimeMillis());
    final Set<String> names = new HashSet<String>();
    final Set<String> newNames = new HashSet<String>();
    notif.setUserData(names);
    sendNotification(notif);
    for(String s: names) {
      if(metricNames.add(s)) {
        newNames.add(s);
      }
View Full Code Here

        }
        try {
            ObjectName source = new ObjectName(ObjectNames.UA_SERVICE);
            String message = "User Admin event: Role "
                    + event.getRole().getName() + typedesc;
            Notification notification = new Notification(
                    AgentConstants.USER_ADMIN_NOTIFICATION_TYPE, source,
                    sequenceNumber++, message);
            CompositeData userData = OSGi2JMXCodec.encodeUserAdminEvent(event);
            notification.setUserData(userData);
            sendNotification(notification);
        } catch (Exception e) {
            ac.error("Unexpected exception", e);
        }
    }
View Full Code Here

      }

      // It may be possible that a notification arrived after the client already removed the listener
      if (tuple == null) return;

      Notification notif = notification.getNotification();


      if (tuple.getInvokeFilter())
      {
         // Invoke the filter on client side
View Full Code Here

        startTime=System.currentTimeMillis();
       
        // Send j2ee.state.running notification
        if (ok && (this.getObjectName() != null)) {
            Notification notification =
                new Notification("j2ee.state.running", this.getObjectName(),
                                sequenceNumber++);
            broadcaster.sendNotification(notification);
        }

        // Close all JARs right away to avoid always opening a peak number
View Full Code Here

TOP

Related Classes of javax.management.Notification

Copyright © 2018 www.massapicom. 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.