Package javax.management

Examples of javax.management.ObjectName$PatternProperty


  }

  public void loadMBean(String myObjectName, String className) {
    try {
      AsyncMBeanServer server = connectorClient.getServer();
      server.createMBean(className, new ObjectName(myObjectName));
    }
    catch (Exception ex) {
      ex.printStackTrace();
    }
  }
View Full Code Here


    /*
     * Register MBeans
     */
    try {
      MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
      ObjectName name = new ObjectName("xBus:mbean=Administrator");
      Administrator mbean = new Administrator();
      mbs.registerMBean(mbean, name);
    } catch (Exception e) {
      throw new XException(Constants.LOCATION_INTERN,
          Constants.LAYER_ADMIN, Constants.PACKAGE_ADMIN_JMX, "0", e);
View Full Code Here

      int port = getInt("port", 9999);
      String host = get("host", "0.0.0.0");
      String adaptorName = get("adaptorName", "HttpAdaptorMX4J");
      MBeanServer server = global.getJmxWrapper().getMBeanServer();
      HttpAdaptor adapter = new HttpAdaptor();
      this.name = new ObjectName("Adaptor:name=" + adaptorName);
      server.registerMBean(adapter, name);
      adapter.setHost(host);
      adapter.setPort(port);
      this.authMethod = get("authenticationMethod", null);
      log.info("Authentication Method is '" + this.authMethod + "'");
      if (this.authMethod != null) {
         this.authMethod = this.authMethod.trim();
         if ("basic".equals(this.authMethod))
            adapter.setAuthenticationMethod(this.authMethod);
         else
            log.warning("Authentication method '" + authMethod + "' not recognized, will switch to 'basic'");
         log.info("Authentication Method is '" + this.authMethod + "'");
         Map users = InfoHelper.getPropertiesStartingWith("replication.monitor.user.", this, null);
         if (users != null && users.size() > 0) {
            Iterator iter = users.entrySet().iterator();
            while (iter.hasNext()) {
               Map.Entry entry = (Map.Entry)iter.next();
               String name = (String)entry.getKey();
               String val = (String)entry.getValue();
               log.fine("name='" + name + "' value='" + val + "'");
               int pos = val.indexOf(':');
               String pwd = null;
               String roles = USER_ROLE;
               if (pos > -1) {
                  pwd = val.substring(0, pos);
                  roles = val.substring(pos+1);
               }
               else
                  pwd = val;
               log.fine("registering monitor user '" + name + "' having roles : " + roles + "'");
               adapter.addAuthorization(name, pwd);
               this.roles.put(name, roles);
            }
         }
         else
            log.info("No Users found for the monitor");
      }
     
      String xsltProcessor = get("xsltProcessor", null);
      ObjectName processorName = null;
      if (xsltProcessor != null) {

         ContextNode contextNode = new ContextNode(ContextNode.CONTRIB_MARKER_TAG, "jmx" + ContextNode.SEP + xsltProcessor,
               this.global.getContextNode());
         processorName = new ObjectName(JmxWrapper.getObjectNameLiteral(this.global, contextNode));
        
         // XSLTProcessor processor = new XSLTProcessor();
         ContribXsltProcessor processor = new ContribXsltProcessor(this.roles, this.authMethod);
        
         server.registerMBean(processor, processorName);
View Full Code Here

            objectName = ":type=" + type + ",name=" + busID;
        } else {
            objectName = ":type=" + type + ",Bus=" + busID + name;
        }
        try {
            return new ObjectName(DOMAIN_STRING + objectName);
        } catch (Exception ex) {
            LOG.log(Level.SEVERE, "OBJECT_NAME_FALUE_MSG", new Object[]{name, ex});
        }
        return null;
    }
View Full Code Here

            }               

          
            if (meFilter.isRemovedEvent(event)) {
               // unregist the component and distroy it.
                ObjectName name;                
                name = JMXUtils.getObjectName(instrumentation.getInstrumentationName(),
                    instrumentation.getUniqueInstrumentationName(),
                    busID);              
                unregisterMBean(name);
                if (LOG.isLoggable(Level.INFO)) {
View Full Code Here

     
    String namespace = objectname.getDomain();
   
    if (handler instanceof Context) {
      Context ctx = (Context) handler;
      objectname = new ObjectName(namespace + ":type=HttpContext" + ", name=[" + ctx.getContextPath() + "]");
     
      for (IHttpRequestHandler hdl : ctx.getHandlers()) {
        exportMbean(mbeanServer, objectname, hdl);
      }
     
    } else if (handler instanceof RequestHandlerChain) {
      RequestHandlerChain chain = (RequestHandlerChain) handler;
      objectname = new ObjectName(namespace + ":type=HttpRequestHandlerChain" + ", name=" + chain.hashCode());
     
      for (IHttpRequestHandler hdl : chain.getHandlers()) {
        exportMbean(mbeanServer, objectname, hdl);
      }
     
     
    } else {
   
      objectname = new ObjectName(namespace + ":type=HttpRequestHandler, name=" + handler.getClass().getSimpleName());
    }
   
   
    mbeanServer.registerMBean(new IntrospectionBasedDynamicMBean(handler), objectname);
   
View Full Code Here

            echo("\n The Celtix Management Demo MBeanServer has " + mbsc.getMBeanCount() + " MBeans");
            echo("\n There are :");
           
            Set names = mbsc.queryNames(null, null);
            for (Iterator i = names.iterator(); i.hasNext();) {
                ObjectName on = (ObjectName)i.next();
                echo("\n\t get ObjectName = " + on + "\n\t Its Attributes are :");
                getInstrumentationAttributes(on);
            }

            ObjectName serviceMBeanName = new ObjectName(
                domain + ":type=ServerMBean,Bus=celtix,name=ServerMBean");
            echo("\n >>> get the ServiceMBean infor <<<");

            echo("\nServiceMBean.ServiceName = " + mbsc.getAttribute(serviceMBeanName, "ServiceName"));
            echo("\nServiceMBean.Address = " + mbsc.getAttribute(serviceMBeanName, "Address"));

            ObjectName greeterInstrumentation = new ObjectName(
                domain + ":type=GreeterInstrumentation,Bus=celtix,name=Demo.Management");
           
            echo("\n >>> get the GreeterInstrumentation counter infor <<<");

            getInstrumentationAttributes(greeterInstrumentation);
View Full Code Here

        address = "http://localhost:9000/SoapContext/SoapPort";
        Endpoint.publish(address, implementor);
        //register to the bus MBServer       
        Bus bus = Bus.getCurrent();
        MBeanServer mbserver = bus.getInstrumentationManager().getMBeanServer();
        ObjectName name = new ObjectName("org.objectweb.celtix.instrumentation:type=ServerMBean,Bus="
                        + bus.getBusID() + ",name=ServerMBean");
        mbserver.registerMBean(this, name);
    }
View Full Code Here

   */
  public ObjectName preRegister(MBeanServer mbeanServer, ObjectName name) throws Exception {
     
        ISessionManager sessionManager = ((HttpServer) server).getSessionManager();
       
        ObjectName objectName = new ObjectName(name.getDomain() + ":type=" + "sessionManager" + ",name=" + sessionManager.hashCode());
        mbeanServer.registerMBean(new SessionManagerInfo(sessionManager), objectName);


        if (requestHandler instanceof MBeanRegistration) {
            MBeanRegistration mbeanRegistration = (MBeanRegistration) requestHandler;
View Full Code Here

   */
  public ObjectName preRegister(MBeanServer mbeanServer, ObjectName name) throws Exception {
     
        ISessionManager sessionManager = ((HttpServer) server).getSessionManager();
       
        ObjectName objectName = new ObjectName(name.getDomain() + ":type=" + "sessionManager" + ",name=" + sessionManager.hashCode());
        mbeanServer.registerMBean(new SessionManagerInfo(sessionManager), objectName);


        if (requestHandler instanceof MBeanRegistration) {
            MBeanRegistration mbeanRegistration = (MBeanRegistration) requestHandler;
View Full Code Here

TOP

Related Classes of javax.management.ObjectName$PatternProperty

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.