Package javax.management

Examples of javax.management.MBeanServer.createMBean()


      {
         System.out.println("Incorrect null hostname");
      }
      // set the XSLTProcessor. If you want to use pure XML comment this out
      ObjectName processorName = new ObjectName("Http:name=XSLTProcessor");
      server.createMBean("mx4j.tools.adaptor.http.XSLTProcessor", processorName, null);
      if (path != null)
      {
         server.setAttribute(processorName, new Attribute("File", path));
      }
      server.setAttribute(processorName, new Attribute("UseCache", new Boolean(false)));
View Full Code Here


      // use basic authentication
      //server.setAttribute(serverName, new Attribute("AuthenticationMethod", "basic"));

      // SSL support
      ObjectName sslFactory = new ObjectName("Adaptor:service=SSLServerSocketFactory");
      server.createMBean("mx4j.tools.adaptor.ssl.SSLAdaptorServerSocketFactory", sslFactory, null);

      SSLAdaptorServerSocketFactoryMBean factory = (SSLAdaptorServerSocketFactoryMBean)MBeanServerInvocationHandler.newProxyInstance(server, sslFactory, SSLAdaptorServerSocketFactoryMBean.class, false);
      // Customize the values below
      factory.setKeyStoreName("certs");
      factory.setKeyStorePassword("mx4j");
View Full Code Here

      // Create an ObjectName for the MBean
      ObjectName name = new ObjectName(":mbean=helloworld");

      // Create and register the MBean in the MBeanServer
      server.createMBean("mx4j.examples.mbeans.helloworld.HelloWorld", name, null);

      // Invoke a method on it
      server.invoke(name, "reloadConfiguration", new Object[0], new String[0]);

      // Invoke an attribute on it
View Full Code Here

                        ObjectName oname=new ObjectName(objectName);
                        if( ! server.isRegistered( oname )) {
                            // We wrap everything in a model mbean.
                            // XXX need to support "StandardMBeanDescriptorsSource"
                            String modelMBean=BaseModelMBean.class.getName();                           
                            server.createMBean(modelMBean, oname,
                                    new Object[] { code, this},
                                    new String[] { String.class.getName(),
                                                  ModelerSource.class.getName() }
                                    );
                            mbeans.add(oname);
View Full Code Here

      MBeanServer server = MBeanServerFactory.createMBeanServer();
      ObjectName name = new ObjectName("rmm:invocationTest=true");
      ModelMBeanInfo info = getModelMBeanInfo();
      Object[] ctorArgs = { info };
      String[] ctorSig = { "javax.management.modelmbean.ModelMBeanInfo" };
      server.createMBean("javax.management.modelmbean.RequiredModelMBean",
         name, ctorArgs, ctorSig);

      Resource resource = new Resource();

      Object[] args = {resource, "ObjectReference"};
View Full Code Here

      MBeanServer server = MBeanServerFactory.createMBeanServer();
      ObjectName name = new ObjectName("rmm:invocationTest=true");
      ModelMBeanInfo info = getModelMBeanInfo();
      Object[] ctorArgs = { info };
      String[] ctorSig = { "javax.management.modelmbean.ModelMBeanInfo" };
      server.createMBean("javax.management.modelmbean.RequiredModelMBean",
         name, ctorArgs, ctorSig);

      Resource resource = new Resource();

      Object[] args = {resource, "objectReference"};
View Full Code Here

      // Create the ContextCL MBean using the TestClassLoader
      try
      {
         repo.newClassLoader(jarUrl, true);
         ObjectName beanName = new ObjectName("org.jboss.test.jbossmx.implementation.server.support:test=ContextCLTestCase");
         server.createMBean("org.jboss.test.jbossmx.implementation.server.support.ContextCL", beanName);
         getLog().info("Created ContextCL MBean");

         // Invoke the useTestData op to test the thread context class loader
         server.invoke(beanName, "useTestData", null, null);
         getLog().info("Invoked ContextCL.useTestData");
View Full Code Here

        super.initialize();

        final MBeanServer mBeanServer = getMBeanServer();

        final ObjectName adaptorName = new ObjectName( "Http:name=HttpAdaptor" );
        mBeanServer.createMBean( "mx4j.adaptor.http.HttpAdaptor", adaptorName, null );
        mBeanServer.setAttribute( adaptorName, new Attribute( "Port", new Integer( m_port ) ) );


        /**
         // add user names
View Full Code Here

         // use basic authentication
         m_mBeanServer.setAttribute(adaptorName, new Attribute("AuthenticationMethod", "basic"));
         */

        final ObjectName processorName = new ObjectName( "Http:name=XSLTProcessor" );
        mBeanServer.createMBean( "mx4j.adaptor.http.XSLTProcessor", processorName, null );
        mBeanServer.setAttribute( adaptorName, new Attribute( "ProcessorName", processorName ) );

        if( null != m_stylesheetDir )
        {
            final Attribute stylesheetDir = new Attribute( "File", m_stylesheetDir );
View Full Code Here

         // Redirect logging
         Log.redirectTo(new LoggerTestRedirector());

         // Create some log
         MBeanServer server = newMBeanServer();
         server.createMBean("javax.management.loading.MLet", new ObjectName(":type=test"), null);
      }
      finally
      {
         // Stop redirection
         Log.redirectTo(null);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.