Package org.jboss.invocation.pooled.interfaces

Examples of org.jboss.invocation.pooled.interfaces.ServerAddress


    * @throws Exception
    */
   public void testServerAddressHashEquals()
      throws Exception
   {
      ServerAddress sa1 = new ServerAddress("127.0.0.1", 4445, false, 60, null);
      ServerAddress sa2 = new ServerAddress("127.0.0.1", 4445, false, 61, null);
      assertEquals(sa1, sa2);
      assertEquals(sa1.hashCode(), sa2.hashCode());

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(baos);
      oos.writeObject(sa1);
      ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
      ObjectInputStream ois = new ObjectInputStream(bais);
      sa2 = (ServerAddress) ois.readObject();
      assertEquals(sa1, sa2);
      assertEquals(sa1.hashCode(), sa2.hashCode());

      // Different tcpNoDelay should not be equal
      sa2 = new ServerAddress("127.0.0.1", 4445, true, 61, null);
      assertNotSame(sa1, sa2);
      // Different ports should not be equal
      sa2 = new ServerAddress("127.0.0.1", 4446, false, 60, null);
      assertNotSame(sa1, sa2);
      // Different host should not be equal
      sa2 = new ServerAddress("127.0.0.2", 4445, false, 60, null);
      assertNotSame(sa1, sa2);
   }
View Full Code Here


           throw new Exception("Port "+serverBindPort+" is already in use",be);
       }
       serverBindPort = serverSocket.getLocalPort();
      clientConnectPort = (clientConnectPort == 0) ? serverSocket.getLocalPort() : clientConnectPort;

      ServerAddress sa = new ServerAddress(clientConnectAddress, clientConnectPort,
         enableTcpNoDelay, timeout, clientSocketFactory);
      optimizedInvokerProxy = new PooledInvokerProxy(sa, clientMaxPoolSize, clientRetryCount);

      ///////////////////////////////////////////////////////////     
      // Register the service with the rest of the JBoss Kernel
View Full Code Here

/* 230 */       throw new Exception("Port " + this.serverBindPort + " is already in use", be);
/*     */     }
/* 232 */     this.serverBindPort = this.serverSocket.getLocalPort();
/* 233 */     this.clientConnectPort = (this.clientConnectPort == 0 ? this.serverSocket.getLocalPort() : this.clientConnectPort);
/*     */
/* 235 */     ServerAddress sa = new ServerAddress(this.clientConnectAddress, this.clientConnectPort, this.enableTcpNoDelay, this.timeout, this.clientSocketFactory);
/*     */
/* 237 */     this.optimizedInvokerProxy = new PooledInvokerProxy(sa, this.clientMaxPoolSize, this.clientRetryCount);
/*     */
/* 243 */     jmxBind();
/* 244 */     log.debug("Bound invoker for JMX node");
View Full Code Here

   // JRMPInvoker.destroyService() does the right thing

   public java.io.Serializable getStub()
   {
      ServerAddress sa = new ServerAddress(clientConnectAddress,
         clientConnectPort, enableTcpNoDelay, timeout, clientSocketFactory);
      return new PooledInvokerProxy(sa, clientMaxPoolSize);
   }
View Full Code Here

TOP

Related Classes of org.jboss.invocation.pooled.interfaces.ServerAddress

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.