Package org.jboss.remoting

Examples of org.jboss.remoting.ServerConfiguration


//   }
  
  
   ServerConfiguration getServerConfiguration(int minPort, int maxPort) throws UnknownHostException
   {
      ServerConfiguration serverConfiguration = new ServerConfiguration("socket");
      Map invokerLocatorParameters = new HashMap();
      invokerLocatorParameters.put("serverBindAddress", InetAddress.getLocalHost().getHostAddress());
      serverConfiguration.setInvokerLocatorParameters(invokerLocatorParameters);
      Map serverParameters = new HashMap();
      if (minPort > -1)
      {
         serverParameters.put(PortUtil.MIN_PORT, Integer.toString(minPort));
      }
      if (maxPort > -1)
      {
         serverParameters.put(PortUtil.MAX_PORT, Integer.toString(maxPort));  
      }
      serverConfiguration.setServerParameters(serverParameters);
      Map invocationHandlers = new HashMap();
      invocationHandlers.put("test", TestInvocationHandler.class.getName());
      serverConfiguration.setInvocationHandlers(invocationHandlers);
      return serverConfiguration;
   }
View Full Code Here


   public void testServerConfigurationWithoutHost() throws Throwable
   {
      log.info("entering " + getName());
     
      // Create ServerConfiguration.
      ServerConfiguration config = new ServerConfiguration("socket");
      Map locatorConfig = new HashMap();

      // Add invokerLocatorParameters.
      locatorConfig.put("serverBindPort", Integer.toString(port));
      locatorConfig.put("timeout", "10000");
      config.setInvokerLocatorParameters(locatorConfig);

      // Add invocation handler.
      Map handlers = new HashMap();
      ServerInvocationHandler handler = new SampleInvocationHandler();
      handlers.put("test", handler);
      config.setInvocationHandlers(handlers);

      // Create Connector.
      Connector connector = new Connector();
      try
      {
View Full Code Here


   protected boolean doServerConfigurationTest(String host, int port) throws Exception
   {
      // Create ServerConfiguration.
      ServerConfiguration config = new ServerConfiguration("socket");
      Map locatorConfig = new HashMap();

      // Add invokerLocatorParameters.
      locatorConfig.put("serverBindAddress", host);
      locatorConfig.put("serverBindPort", Integer.toString(port));
      locatorConfig.put("timeout", "10000");
      config.setInvokerLocatorParameters(locatorConfig);

      // Add invocation handler.
      Map handlers = new HashMap();
      ServerInvocationHandler handler = new SampleInvocationHandler();
      handlers.put("test", handler);
      config.setInvocationHandlers(handlers);

      // Create Connector.
      Connector connector = new Connector();
      try
      {
View Full Code Here

            connector.setRemoteClassLoaders(classLoaders);
            break;
           
         case BY_SERVER_CONFIGURATION:
            log.info("injecting: BY_SERVER_CONFIGURATION");
            ServerConfiguration serverConfiguration = new ServerConfiguration(getTransport());
            Map serverParameters = new HashMap();
            serverParameters.put(Remoting.REMOTE_CLASS_LOADERS, classLoaders);
            serverConfiguration.setServerParameters(serverParameters);
            Map invokerLocatorParameters = new HashMap();
            invokerLocatorParameters.put(InvokerLocator.LOADER_PORT, loaderPort);
            serverConfiguration.setInvokerLocatorParameters(invokerLocatorParameters);
            connector = new Connector(config);
            connector.setServerConfiguration(serverConfiguration);
            break;
           
         case BY_CONFIG_MAP:
View Full Code Here

TOP

Related Classes of org.jboss.remoting.ServerConfiguration

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.