Package mx4j.tools.remote.http.jetty

Examples of mx4j.tools.remote.http.jetty.JettyWebContainer


   }

   public void testExternalWebContainer() throws Exception
   {
      // Start Jetty, externally
      JettyWebContainer jetty = new JettyWebContainer();
      try
      {
         JMXServiceURL url = new JMXServiceURL("soap", null, 8080, "/external");
         jetty.start(url, null);
         jetty.deploy(AxisServlet.class.getName(), url, null);

         // A SOAPConnector
         JMXConnectorServer cntorServer = null;
         JMXConnector cntor = null;
         try
         {
            Map environment = new HashMap();
            environment.put(HTTPConnectorServer.USE_EXTERNAL_WEB_CONTAINER, Boolean.TRUE);
            cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, environment, newMBeanServer());
            cntorServer.start();

            // Check that it works
            cntor = JMXConnectorFactory.connect(cntorServer.getAddress());
            MBeanServerConnection cntion = cntor.getMBeanServerConnection();
            Set names = cntion.queryNames(null, null);
            assertNotNull(names);
            assertFalse(names.isEmpty());
         }
         finally
         {
            if (cntor != null) cntor.close();
            if (cntorServer != null) cntorServer.stop();
         }
      }
      finally
      {
         jetty.stop();
      }
   }
View Full Code Here

TOP

Related Classes of mx4j.tools.remote.http.jetty.JettyWebContainer

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.