Package org.jboss.jmx.adaptor.snmp.config.attribute

Examples of org.jboss.jmx.adaptor.snmp.config.attribute.AttributeMappings


   {
      log.debug("Reading resource: '" + resourceName + "'");
     
      ObjectModelFactory omf = new AttributeMappingsBinding();
      InputStream is = null;
      AttributeMappings mappings = null;
      try
      {
         // locate resource
         is = SecurityActions.getThreadContextClassLoaderResource(resourceName);
        
         // create unmarshaller
         Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();

         // let JBossXB do it's magic using the AttributeMappingsBinding
         mappings = (AttributeMappings)unmarshaller.unmarshal(is, omf, null);        
      }
      catch (Exception e)
      {
         log.error("Accessing resource '" + resourceName + "'");
         throw e;
      }
      finally
      {
         if (is != null)
         {
            // close the XML stream
            is.close();           
         }
      }
      if (mappings == null)
      {
         log.warn("No bindings found in " + resourceName);
         return;        
      }
      log.debug("Found " + mappings.size() + " attribute mappings");    
    /**
     * We have the MBeans now. Put them into the bindungs.
     */

    Iterator it = mappings.iterator();
    while (it.hasNext())
      {
       ManagedBean mmb = (ManagedBean)it.next();
       String oidPrefix = mmb.getOidPrefix();
       List attrs = mmb.getAttributes();
View Full Code Here


   {
     if (!localName.equals("attribute-mappings"))
      {
        throw new IllegalStateException("Unexpected root " + localName + ". Expected <attribute-mappings>");
    }
     return new AttributeMappings();
  }
View Full Code Here

   {
      log.debug("Reading resource: '" + resourceName + "'");
     
      ObjectModelFactory omf = new AttributeMappingsBinding();
      InputStream is = null;
      AttributeMappings mappings = null;
      try
      {
         // locate resource
         is = getClass().getResourceAsStream(resourceName);
        
         // create unmarshaller
         Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();

         // let JBossXB do it's magic using the AttributeMappingsBinding
         mappings = (AttributeMappings)unmarshaller.unmarshal(is, omf, null);        
      }
      catch (Exception e)
      {
         log.error("Accessing resource '" + resourceName + "'");
         throw e;
      }
      finally
      {
         if (is != null)
         {
            // close the XML stream
            is.close();           
         }
      }
      if (mappings == null)
      {
         log.warn("No bindings found in " + resourceName);
         return;        
      }
      log.debug("Found " + mappings.size() + " attribute mappings");    
    /**
     * We have the MBeans now. Put them into the bindungs.
     */

    Iterator it = mappings.iterator();
    while (it.hasNext())
      {
       ManagedBean mmb = (ManagedBean)it.next();
       String oidPrefix = mmb.getOidPrefix();
       List attrs = mmb.getAttributes();
View Full Code Here

TOP

Related Classes of org.jboss.jmx.adaptor.snmp.config.attribute.AttributeMappings

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.