Package javax.management

Examples of javax.management.ObjectInstance


               this.html = new HtmlAdaptorServer(port);
            }

            ObjectName html_name = new ObjectName("Adaptor:name=html,port="+port);

            ObjectInstance objectInstance = this.mbeanServer.registerMBean(this.html, html_name);
            JmxMBeanHandle handle = new JmxMBeanHandle(objectInstance, null, this.html);
            this.mbeanMap.put(html_name.toString(), handle);

            if (loginName == null) {
               log.info("Registered JMX HTML adaptor on http://"+hostname+":"+port +
View Full Code Here


            if (log.isLoggable(Level.FINE)) log.fine("JMX rename registration from '" + oldName + "' to '" + newRootName + "', nothing found for '" + query + "'");
            return count;
         }
         Iterator it = mbeanSet.iterator();
         while (it.hasNext()) {
            ObjectInstance instance = (ObjectInstance)it.next();
            ObjectName tmp = instance.getObjectName();
            JmxMBeanHandle mbeanHandle = (JmxMBeanHandle)this.mbeanMap.get(tmp.toString());
            if (mbeanHandle == null) {
               log.severe("Internal problem: Can't find registration of MBean '" + tmp.toString() + "'");
               continue;
            }
View Full Code Here

            if (log.isLoggable(Level.FINE)) log.fine("JMX rename registration from '" + oldName + "' to '" + classNameToChange + "=" + instanceName + "', nothing found for '" + query + "'");
            return count;
         }
         Iterator it = mbeanSet.iterator();
         while (it.hasNext()) {
            ObjectInstance instance = (ObjectInstance)it.next();
            ObjectName tmp = instance.getObjectName();
            JmxMBeanHandle mbeanHandle = (JmxMBeanHandle)this.mbeanMap.get(tmp.toString());
            if (mbeanHandle == null) {
               log.severe("Internal problem: Can't find registration of MBean '" + tmp.toString() + "'");
               continue;
            }
View Full Code Here

      String hierarchy = getObjectNameLiteral(this.glob, contextNode);
      ObjectName objectName = null;
      try {
         objectName = new ObjectName( getObjectNameLiteral(this.glob, contextNode));
         ObjectInstance objectInstance = this.mbeanServer.registerMBean(mbean, objectName);
         if (mbeanHandle == null) {
            mbeanHandle = new JmxMBeanHandle(objectInstance, contextNode, mbean);
            this.mbeanMap.put(objectName.toString(), mbeanHandle);
         }
         else {
View Full Code Here

      if(entry == null && oname != null)
      {
         System.out.println("Searching for MBean: "+oname);
         try
         {
            ObjectInstance oi = mbeanServer.getObjectInstance(oname);
            System.out.println("Found "+oname+", "+oi.getClassName());
         }
         catch (InstanceNotFoundException e)
         {
            e.printStackTrace();
         }
View Full Code Here

      ObjectName provider = null;
      ObjectName providerQuery = new ObjectName("jboss.j2ee:service=EJB,*");
      Iterator mbeans = server.queryMBeans(providerQuery, null).iterator();
      while (provider == null)
      {
         ObjectInstance providerInstance = (ObjectInstance)mbeans.next();
         String name = providerInstance.getObjectName().toString();
         if (name.contains("Mdb") && !name.contains("plugin"))
            provider = providerInstance.getObjectName();
      }
     
      Object[] params = {};
      String[] sig = {};
      Object success = server.invoke(provider, "stop", params, sig);
     
      ObjectName jmsContainerInvokerQuery = new ObjectName("jboss.j2ee:binding=my-message-driven-bean,*");
      Set mbeansSet = server.queryMBeans(jmsContainerInvokerQuery, null);
      assertEquals(1, mbeansSet.size());
      ObjectInstance jmsContainerInvokerInstance = (ObjectInstance)mbeansSet.iterator().next();
      ObjectName jmsContainerInvoker = jmsContainerInvokerInstance.getObjectName();
      //      int numActiveSessions = (Integer)server.getAttribute(jmsContainerInvoker, "NumActiveSessions");
      //      assertEquals(1, numActiveSessions);
      /*boolean forceClear = (Boolean)server.getAttribute(jmsContainerInvoker, "ForceClearOnShutdown");
      assertFalse(forceClear);
      int forceClearAttempts = (Integer)server.getAttribute(jmsContainerInvoker, "ForceClearAttempts");
View Full Code Here

      {
         //AS ToDo: must be checked later how to go ahead here
         throw new RemoteException("Could not create a MBean on the cluster", e);
      }
      Iterator i = lValues.iterator();
      ObjectInstance lInstance = null;
      Throwable lException = null;
      while (i.hasNext())
      {
         Object lValue = i.next();
         if (lValue instanceof ObjectInstance)
         {
            if (lInstance == null)
            {
               lInstance = (ObjectInstance) lValue;
            }
         }
         else if (lValue instanceof Throwable)
         {
            if (lException == null)
            {
               lException = (Throwable) lValue;
            }
         }
      }
      if (lException != null)
      {
         if (lInstance != null)
         {
            // Remove all existing MBeans
            try
            {
               unregisterMBean(lInstance.getObjectName());
            }
            catch (Exception e)
            {
               // Ignore any exception
            }
View Full Code Here

      if (className == null)
         throw new CommandException("Missing class name");

      MBeanServerConnection server = getMBeanServer();

      ObjectInstance obj;

      if (loaderName == null) {
         obj = server.createMBean(className, objectName);
      }
      else {
         obj = server.createMBean(className, objectName, loaderName);
      }

      if (!context.isQuiet()) {
         PrintWriter out = context.getWriter();
         out.println(obj.getObjectName());
         out.flush();
      }
      closeServer();
   }
View Full Code Here

         ObjectName objectName = new ObjectName(onStr);
         Set set = mBeanServer.queryMBeans(objectName, null);
         Iterator iterator = set.iterator();
         while (iterator.hasNext())
         {
            ObjectInstance oi = (ObjectInstance) iterator.next();
            protocolHandlers.addElement(oi.getObjectName());
         }

         // Query Thread Pools
         onStr = "*:type=ThreadPool,*";
         objectName = new ObjectName(onStr);
         set = mBeanServer.queryMBeans(objectName, null);
         iterator = set.iterator();
         while (iterator.hasNext())
         {
            ObjectInstance oi = (ObjectInstance) iterator.next();
            threadPools.addElement(oi.getObjectName());
         }

         // Query Global Request Processors
         onStr = "*:type=GlobalRequestProcessor,*";
         objectName = new ObjectName(onStr);
         set = mBeanServer.queryMBeans(objectName, null);
         iterator = set.iterator();
         while (iterator.hasNext())
         {
            ObjectInstance oi = (ObjectInstance) iterator.next();
            globalRequestProcessors.addElement(oi.getObjectName());
         }

         // Query Request Processors
         onStr = "*:type=RequestProcessor,*";
         objectName = new ObjectName(onStr);
         set = mBeanServer.queryMBeans(objectName, null);
         iterator = set.iterator();
         while (iterator.hasNext())
         {
            ObjectInstance oi = (ObjectInstance) iterator.next();
            requestProcessors.addElement(oi.getObjectName());
         }

         // Register with MBean server
         onStr = "JMImplementation:type=MBeanServerDelegate";
         objectName = new ObjectName(onStr);
View Full Code Here

      String xmbeanCode = mbeanElement.getAttribute("xmbean-code");
      if( xmbeanCode.length() == 0 )
         xmbeanCode = XMBEAN_CODE;

      // Create the mbean instance
      ObjectInstance instance = null;
      try
      {
         if ( xmbeandd == null )
         {
            // Check for the explicit management interface in case of a standard MBean
View Full Code Here

TOP

Related Classes of javax.management.ObjectInstance

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.