Package javax.management

Examples of javax.management.AttributeChangeNotificationFilter


     * @throws RuntimeOperationsException
     * @throws IllegalArgumentException
     */
    public void addAttributeChangeNotificationListener(NotificationListener l, String attrName, Object handback) throws MBeanException,
                    RuntimeOperationsException, IllegalArgumentException {
        AttributeChangeNotificationFilter currFilter = new AttributeChangeNotificationFilter();
        currFilter.enableAttribute(attrName);
        broadcasterSupport.addNotificationListener(l, currFilter, handback);
    }
View Full Code Here


     * @throws RuntimeOperationsException
     * @throws IllegalArgumentException
     */
    public void addAttributeChangeNotificationListener(NotificationListener l, String attrName, Object handback)
            throws MBeanException, RuntimeOperationsException, IllegalArgumentException {
        AttributeChangeNotificationFilter currFilter = new AttributeChangeNotificationFilter();
        currFilter.enableAttribute(attrName);
        broadcasterSupport.addNotificationListener(l, currFilter, handback);
    }
View Full Code Here

          TMInformation transactionManagerInformation = new TMInformation(trmName);
          transactionManagerInformation.make(configuration);
          TransactionManager tm =  new TransactionManager(jndi, transactionManagerInformation, this);
          new Thread(tm).start();
   
          AttributeChangeNotificationFilter nf = new AttributeChangeNotificationFilter();
          nf.enableAttribute("TMState");
          this.addNotificationListener((NotificationListener) tm, nf, this);
   
          logger.info(transactionManagerInformation.getIdtrn()+"|Configurado e iniciado.|");
        }
    } catch (ConfigurationException e) {
View Full Code Here

        logger.debug(tmInformation.getIdtrn()+"|Mensaje recibido por el Trans.Manager|"+m.toString());
      TransactionInformation ti = tmInformation.getTransactionInformation(m);
      String trnName = tmInformation.getIdtrn()+"-" + new GregorianCalendar().getTimeInMillis();
      Transaction trn = new Transaction(trnName, ti , message.getStringProperty("connection"));
     
      AttributeChangeNotificationFilter nf = new AttributeChangeNotificationFilter();
      nf.enableAttribute("TMState");
      configurator.addNotificationListener((NotificationListener) trn, nf, this);
     
      trn.setMessage(m);
      new TransactionTimeOut(trn,ti.getTimeOut());
    }catch (Exception e){
View Full Code Here

          jndi = "localhost:1099";
       
        logger.info(channelName+"| Iniciando connection...|");
        logger.info(channelName+"| Servicio jndi: "+jndi+"|");

        AttributeChangeNotificationFilter nf = new AttributeChangeNotificationFilter();
        nf.enableAttribute("ChannelState");

        incomingTopic = configuration.getAttribute("incomingTopic");
        outgoingTopic = configuration.getAttribute("outgoingTopic");
        idxLink = 0;
View Full Code Here

  }

  public void registerLinkChannel(ILink link) {
    if (logger.isDebugEnabled())
      logger.debug(channelName+"| registerLinkChannel - link "+link+" registrado. |");
    AttributeChangeNotificationFilter nf = new AttributeChangeNotificationFilter();
    nf.disableAllAttributes();
    nf.enableAttribute("ChannelState");
    this.addNotificationListener((NotificationListener) link, nf, this);
  }
View Full Code Here

      String attributeName,
      Object handback) throws MBeanException
   {
      // Check the attribute info
      ModelMBeanInfo minfo = (ModelMBeanInfo) info;
      AttributeChangeNotificationFilter filter = null;
      if (attributeName != null)
      {
         ModelMBeanAttributeInfo ainfo = minfo.getAttribute(attributeName);
         if( ainfo == null )
         {
            throw new RuntimeOperationsException(
               new IllegalArgumentException("Attribute does not exist: "+attributeName));        
         }
         filter = new AttributeChangeNotificationFilter();
         filter.enableAttribute(attributeName);
      }
      else
      {
         filter = new AttributeChangeNotificationFilter();
         MBeanAttributeInfo[] allAttributes = minfo.getAttributes();
         for (int i = 0; i < allAttributes.length; ++i)
            filter.enableAttribute(allAttributes[i].getName());
      }
      notifier.addNotificationListener(listener, filter, handback);
   }
View Full Code Here

    */
   public NotificationFilter createNotificationFilter(Element filterConfig)
      throws Exception
   {
      // start off with a filter that does not allow any named attribute
      AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
     
      // filterConfig should point to the <filter factory="..."> element,
      // we are interested in its 'enable' children to configure the filter
      NodeList filterChildren = filterConfig.getChildNodes();
     
      for (int i = 0; i < filterChildren.getLength(); i++)
      {
         Node filterChildNode = filterChildren.item(i);
     
         // check if this is an 'enable' element, ignore everything else
         if (filterChildNode.getNodeName().equals(ENABLE_ELEMENT))
         {
            // look for 'attribute-name' attribute
            if (((Element)filterChildNode).hasAttribute(ENABLE_ATTRNAME_ATTRIBUTE))
            {
               String attributeName = ((Element)filterChildNode).getAttribute(ENABLE_ATTRNAME_ATTRIBUTE);
               // enable this type in the filter
               filter.enableAttribute(attributeName);
            }
            else
            {
               throw new Exception("'" + ENABLE_ELEMENT + "' element must have a '"
                     + ENABLE_ATTRNAME_ATTRIBUTE + "' attribute");
View Full Code Here


        if (attributeBroadcaster == null)
            attributeBroadcaster = new NotificationBroadcasterSupport();

        AttributeChangeNotificationFilter currFilter =
            new AttributeChangeNotificationFilter();

        MBeanAttributeInfo[] attrInfo = modelMBeanInfo.getAttributes();
        boolean found = false;
        if (inAttributeName == null) {
            if ((attrInfo != null) && (attrInfo.length>0)) {
                for (int i=0; i<attrInfo.length; i++) {
                    currFilter.enableAttribute(attrInfo[i].getName());
                }
            }
        } else {
            if ((attrInfo != null) && (attrInfo.length>0)) {
                for (int i=0; i<attrInfo.length; i++) {
                    if (inAttributeName.equals(attrInfo[i].getName())) {
                        found = true;
                        currFilter.enableAttribute(inAttributeName);
                        break;
                    }
                }
            }
            if (!found) {
                throw new RuntimeOperationsException(new
                    IllegalArgumentException(
                    "The attribute name does not exist"),
                    "Exception occurred trying to add an "+
                    "AttributeChangeNotification listener");
            }
        }

        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
            MODELMBEAN_LOGGER.logp(Level.FINER,
                    RequiredModelMBean.class.getName(), mth,
                "Set attribute change filter to " +
                currFilter.getEnabledAttributes().firstElement());
        }

        attributeBroadcaster.addNotificationListener(inlistener,currFilter,
                                                     inhandback);
        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
View Full Code Here

/*     */
/*     */   public void addAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback)
/*     */     throws MBeanException
/*     */   {
/* 362 */     ModelMBeanInfo minfo = (ModelMBeanInfo)this.info;
/* 363 */     AttributeChangeNotificationFilter filter = null;
/* 364 */     if (attributeName != null)
/*     */     {
/* 366 */       ModelMBeanAttributeInfo ainfo = minfo.getAttribute(attributeName);
/* 367 */       if (ainfo == null)
/*     */       {
/* 369 */         throw new RuntimeOperationsException(new IllegalArgumentException("Attribute does not exist: " + attributeName));
/*     */       }
/*     */
/* 372 */       filter = new AttributeChangeNotificationFilter();
/* 373 */       filter.enableAttribute(attributeName);
/*     */     }
/*     */     else
/*     */     {
/* 377 */       filter = new AttributeChangeNotificationFilter();
/* 378 */       MBeanAttributeInfo[] allAttributes = minfo.getAttributes();
/* 379 */       for (int i = 0; i < allAttributes.length; i++)
/* 380 */         filter.enableAttribute(allAttributes[i].getName());
/*     */     }
/* 382 */     this.notifier.addNotificationListener(listener, filter, handback);
/*     */   }
View Full Code Here

TOP

Related Classes of javax.management.AttributeChangeNotificationFilter

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.