Package org.jboss.mx.remote.connector.socket

Examples of org.jboss.mx.remote.connector.socket.SocketConnector


            org.apache.log4j.BasicConfigurator.configure();
            org.apache.log4j.Category.getRoot().setLevel(org.apache.log4j.Level.DEBUG);
            UnicastDetector detector=new UnicastDetector();
            detector.setPublishPort(-1);
            detector.createService();
            SocketConnector connector=new SocketConnector();
            //detector.addLocation(InetAddress.getLocalHost(),2105);
            //detector.addLocation(InetAddress.getLocalHost(),2102);
            MBeanServer server=MBeanServerFactory.createMBeanServer();
            server.registerMBean(connector,new ObjectName("jmx.remoting:type=Connector,transport=socket"));
            server.registerMBean(detector,new ObjectName("jmx.remoting:type=Detector,transport=unicast"));
            connector.start();
            detector.start();
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
View Full Code Here


    {
        System.out.println("Testing JMX Remoting Concurrency ...");
        MBeanServer server = MBeanServerFactory.createMBeanServer();

        // create a local connector
        SocketConnector connector=new SocketConnector();
        server.registerMBean(connector,new ObjectName("jmx.remoting:type=Connector,transport=socket"));
        connector.start();

        // create a remote connector looped-back to ourself
        MBeanServerConnection conn=new MBeanServerConnection("socket",JMXUtil.getServerId(server),InstanceID.getID(server),InetAddress.getLocalHost(),connector.getTransportProperties());
        MBeanServer remoteserver=ConnectorFactory.createConnector(conn);

        Thread threads[]=new Thread[THREADS];

        long start = System.currentTimeMillis();
        for (int c=0;c<THREADS;c++)
        {
            threads[c]=new TestThread(remoteserver,ITERATIONS);
            threads[c].start();
        }
        for (int c=0;c<THREADS;c++)
        {
            threads[c].join();
        }
        System.out.println(THREADS+" threads over "+ITERATIONS+" iterations took: "+(System.currentTimeMillis()-start)+" ms");

        ConnectorFactory.destroyConnector(JMXUtil.getServerId(remoteserver));
        server.unregisterMBean(new ObjectName("jmx.remoting:type=Connector,transport=socket"));

        connector.stop();
        connector.destroy();

        connector = null;
        server = null;
    }
View Full Code Here

    {
        System.out.println("Testing JMX Remoting Performance ...");
        MBeanServer server=MBeanServerFactory.createMBeanServer();

        // create a local connector
        SocketConnector connector=new SocketConnector();
        server.registerMBean(connector,new ObjectName("jmx.remoting:type=Connector,transport=socket"));
        connector.start();

        // create a remote connector looped-back to ourself
        MBeanServerConnection conn=new MBeanServerConnection("socket",JMXUtil.getServerId(server),InstanceID.getID(server),InetAddress.getLocalHost(),connector.getTransportProperties());
        MBeanServer remoteserver=ConnectorFactory.createConnector(conn);

        TestThread local=new TestThread("Local MBeanServer executed "+COUNT+" iterations ...",server,COUNT);
        TestThread remote=new TestThread("Remote MBeanServer executed "+COUNT+" iterations ...",remoteserver,COUNT);
        local.start();
        remote.start();

        local.join(1000L);
        remote.join(120000L);

        ConnectorFactory.destroyConnector(JMXUtil.getServerId(remoteserver));
        server.unregisterMBean(new ObjectName("jmx.remoting:type=Connector,transport=socket"));
        connector.stop();
        connector.destroy();

        server=null;
        local = null;
        remote = null;
        connector = null;
View Full Code Here

        {
            org.apache.log4j.BasicConfigurator.configure();
            org.apache.log4j.Category.getRoot().setLevel(org.apache.log4j.Level.INFO);
            MBeanServer server = MBeanServerFactory.createMBeanServer();

            SocketConnector connector = new SocketConnector();
            server.registerMBean(connector, new ObjectName("jmx.remoting:type=Connector,transport=socket"));
            connector.start();

            MulticastDetector detector = new MulticastDetector();
            server.registerMBean(detector, new ObjectName("jmx.remoting:type=Detector,transport=multicast"));
            detector.start();
View Full Code Here

            LocalTest testMBean = new LocalTest();
            server.registerMBean(testMBean,new ObjectName("test:type=LocalTest"));

            System.err.println("LocalTest registered: "+testMBean);

            SocketConnector connector = new SocketConnector();
            server.registerMBean(connector, new ObjectName("jmx.remoting:type=Connector,transport=socket"));
            connector.start();
            System.err.println("Starting SocketConnector");

            MulticastDetector detector = new MulticastDetector();
            server.registerMBean(detector, new ObjectName("jmx.remoting:type=Detector,transport=multicast"));
            detector.start();
View Full Code Here

TOP

Related Classes of org.jboss.mx.remote.connector.socket.SocketConnector

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.