Package org.jnp.server

Examples of org.jnp.server.NamingBeanImpl


            return;
         }
         try
         {
            jndiServer = new Main();
            namingBean = new NamingBeanImpl();
            jndiServer.setNamingInfo(namingBean);
            executor = Executors.newCachedThreadPool();
            jndiServer.setLookupExector(executor);
            jndiServer.setPort(port);
            jndiServer.setBindAddress(bindAddress);
View Full Code Here


            return;
         }
         try
         {
            jndiServer = new Main();
            namingBean = new NamingBeanImpl();
            jndiServer.setNamingInfo(namingBean);
            executor = Executors.newCachedThreadPool();
            jndiServer.setLookupExector(executor);
            jndiServer.setPort(port);
            jndiServer.setBindAddress(bindAddress);
View Full Code Here

    }
   
    public static void start() throws Exception {
        LOG.debug("Initializing the JNP server");
       
        NamingBeanImpl nbi = new NamingBeanImpl();
        getInstance().jnpServer.setNamingInfo(nbi);
        nbi.start();
       
        LOG.debug("Binding kachny");
       
        nbi.getNamingInstance().bind(new CompoundName("kachny", new Properties()), "KACHNY!", String.class.getName());
       
        LOG.debug("Starting the JNP server");
       
        getInstance().jnpServer.start();
    }
View Full Code Here

   }

   protected void setUp() throws Exception
   {
      super.setUp();
      namingBean = new NamingBeanImpl();
      namingServer = new Main();
      namingServer.setPort(10099);
      namingServer.setNamingInfo(namingBean);
      namingBean.start();
      namingServer.start();
View Full Code Here

      {
         System.setProperty("java.rmi.server.hostname", "localhost");
         System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
         System.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");

         final NamingBeanImpl namingInfo = new NamingBeanImpl();
         namingInfo.start();
         final Main jndiServer = new Main();
         jndiServer.setNamingInfo(namingInfo);
         jndiServer.setPort(1099);
         jndiServer.setBindAddress("localhost");
         jndiServer.setRmiPort(1098);
         jndiServer.setRmiBindAddress("localhost");
         jndiServer.start();

         Configuration conf = new ConfigurationImpl();
         conf.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
         conf.setSecurityEnabled(false);
         conf.setFileDeploymentEnabled(false);

         // disable server persistence since JORAM tests do not restart server
         final HornetQServer server = HornetQServers.newHornetQServer(conf, false);

         Hashtable<String, String> env = new Hashtable<String, String>();
         env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
         env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
         JMSServerManager serverManager = new JMSServerManagerImpl(server);
         serverManager.setContext(new InitialContext(env));
         serverManager.start();

         System.out.println("Server started, ready to start client test");

         // create the reader before printing OK so that if the test is quick
         // we will still capture the STOP message sent by the client
         InputStreamReader isr = new InputStreamReader(System.in);
         BufferedReader br = new BufferedReader(isr);

         System.out.println("OK");

         String line = null;
         while ((line = br.readLine()) != null)
         {
            if ("STOP".equals(line.trim()))
            {
               server.stop();
               jndiServer.stop();
               namingInfo.stop();
               System.out.println("Server stopped");
               System.exit(0);
            }
            else
            {
View Full Code Here

            return;
         }
         try
         {
            jndiServer = new Main();
            namingBean = new NamingBeanImpl();
            jndiServer.setNamingInfo(namingBean);
            executor = Executors.newCachedThreadPool();
            jndiServer.setLookupExector(executor);
            jndiServer.setPort(port);
            jndiServer.setBindAddress(bindAddress);
View Full Code Here

      {
         System.setProperty("java.rmi.server.hostname", "localhost");
         System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
         System.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");

         final NamingBeanImpl namingInfo = new NamingBeanImpl();
         namingInfo.start();
         final Main jndiServer = new Main();
         jndiServer.setNamingInfo(namingInfo);
         jndiServer.setPort(1099);
         jndiServer.setBindAddress("localhost");
         jndiServer.setRmiPort(1098);
         jndiServer.setRmiBindAddress("localhost");
         jndiServer.start();

         Configuration conf = new ConfigurationImpl();
         conf.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
         conf.setSecurityEnabled(false);
         conf.setFileDeploymentEnabled(false);
        
        
         conf.getConnectorConfigurations().put("netty", new TransportConfiguration(NettyConnectorFactory.class.getName()));

         // disable server persistence since JORAM tests do not restart server
         final HornetQServer server = HornetQServers.newHornetQServer(conf, false);

         Hashtable<String, String> env = new Hashtable<String, String>();
         env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
         env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
         JMSServerManager serverManager = new JMSServerManagerImpl(server);
         serverManager.setContext(new InitialContext(env));
         serverManager.start();

         System.out.println("Server started, ready to start client test");

         // create the reader before printing OK so that if the test is quick
         // we will still capture the STOP message sent by the client
         InputStreamReader isr = new InputStreamReader(System.in);
         BufferedReader br = new BufferedReader(isr);

         System.out.println("OK");

         String line = null;
         while ((line = br.readLine()) != null)
         {
            if ("STOP".equals(line.trim()))
            {
               server.stop();
               jndiServer.stop();
               namingInfo.stop();
               System.out.println("Server stopped");
               System.exit(0);
            }
            else
            {
View Full Code Here

   @Override
   protected void setUp() throws Exception
   {
      super.setUp();
      log.info("+++ setUp, creating NamingBean");
      namingBean = new NamingBeanImpl();
      namingBean.setInstallGlobalService(true);
      namingBean.setUseGlobalService(false);
      namingBean.setEventMgr(new ExecutorEventMgr());
      namingBean.start();
View Full Code Here

   @Override
   protected void setUp() throws Exception
   {
      super.setUp();
      namingBean = new NamingBeanImpl();
      namingBean.setUseGlobalService(false);
      namingBean.setInstallGlobalService(true);
      namingBean.setEventMgr(new ExecutorEventMgr());
      namingBean.start();
   }
View Full Code Here

   protected void setUp() throws Exception
   {
      super.setUp();
      if (namingBean == null)
      {
         namingBean = new NamingBeanImpl();
         namingBean.start();
      }
      namingMain = new Main("org.jnp.server");
      namingMain.setNamingInfo(namingBean);
   }
View Full Code Here

TOP

Related Classes of org.jnp.server.NamingBeanImpl

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.