Package org.jboss.remoting

Examples of org.jboss.remoting.Client


      configuration.put(Client.ENABLE_LEASE, String.valueOf(false));

      //We execute this on its own client
     
      Client theClient = null;
      try
      {
         theClient = createClient();
     
         ConnectionFactoryGetClientAOPStackRequest req =
            new ConnectionFactoryGetClientAOPStackRequest(id, v);
     
         return (byte[])doInvoke(theClient, req);
      }
      finally
      {
         if (theClient != null)
         {
            //https://jira.jboss.org/jira/browse/JBMESSAGING-1751
            theClient.disconnect();
         }
      }
   }
View Full Code Here


      }

      configuration.put(Client.ENABLE_LEASE, String.valueOf(false));

      //We execute this on it's own client
      Client client;
     
      try
      {
         client = new Client(new InvokerLocator(serverLocatorURI), configuration);
         client.setSubsystem(ServerPeer.REMOTING_JMS_SUBSYSTEM);
         client.connect();
      }
      catch (Exception e)
      {
         throw new MessagingNetworkFailureException("Failed to connect client", e);
      }

      client.setMarshaller(new JMSWireFormat());
      client.setUnMarshaller(new JMSWireFormat());
     
      return client;
   }
View Full Code Here

      InvokerLocator clientLocator = new InvokerLocator(locatorURI);
      HashMap clientConfig = new HashMap();
      clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
      clientConfig.put("timeout", "2000");
      addExtraClientConfig(clientConfig);
      Client client = new Client(clientLocator, clientConfig);
      client.connect();
      log.info("client is connected");
     
      // Test invocations.
      assertEquals("abc", client.invoke("abc"));
      log.info("first invocation succeeded");
      assertEquals("lmn", client.invoke("lmn"));
      log.info("second invocation succeeded");
      assertEquals("xyz", client.invoke("xyz"));
      log.info("third invocation succeeded");
      assertEquals(1, TestServerThread.threadCounter);
     
      client.disconnect();
      shutdownServer();
      log.info(getName() + " PASSES");
   }
View Full Code Here

      InvokerLocator clientLocator = new InvokerLocator(locatorURI);
      HashMap clientConfig = new HashMap();
      clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
      clientConfig.put("timeout", "2000");
      addExtraClientConfig(clientConfig);
      Client client = new Client(clientLocator, clientConfig);
      client.connect();
      log.info("client is connected");
     
      // Test invocations.
      assertEquals("abc", client.invoke("abc"));
      log.info("first invocation succeeded");
      assertEquals("lmn", client.invoke("lmn"));
      log.info("second invocation succeeded");
      assertEquals("xyz", client.invoke("xyz"));
      log.info("third invocation succeeded");
      assertEquals(1, TestServerThread.threadCounter);
     
      client.disconnect();
      shutdownServer();
      log.info(getName() + " PASSES");
   }
View Full Code Here

      InvokerLocator clientLocator = new InvokerLocator(locatorURI);
      HashMap clientConfig = new HashMap();
      clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
      clientConfig.put("timeout", "2000");
      addExtraClientConfig(clientConfig);
      Client client = new Client(clientLocator, clientConfig);
      client.connect();
      log.info("client is connected");
     
      // Test invocations.
      assertEquals("abc", client.invoke("abc"));
      log.info("first invocation succeeded");
      assertEquals("lmn", client.invoke("lmn"));
      log.info("second invocation succeeded");
      assertEquals("xyz", client.invoke("xyz"));
      log.info("third invocation succeeded");
      assertEquals(1, TestServerThread.threadCounter);
     
      client.disconnect();
      shutdownServer();
      log.info(getName() + " PASSES");
   }
View Full Code Here

         configureSocketFactory(metadata, owner);
        
         metadata.put(SERVER_INVOKER, owner);
         metadata.put(SERVER_INVOKER_CALLBACK_HANDLER, this);

         callBackClient = new Client(invocation.getLocator(), invocation.getSubsystem(), metadata);
         callBackClient.setSessionId(sessionId);
         createCallbackErrorHandler(owner, invocation.getSubsystem());
      }
      else
      {
View Full Code Here

      this.serverPeer.getConnectionManager().
         registerConnection(jmsClientVMID, remotingClientSessionID, this);

      this.callbackHandler = callbackHandler;

      Client callbackClient = callbackHandler.getCallbackClient();

      if (callbackClient != null)
      {
         // TODO not sure if this is the best way to do this, but the callbackClient needs to have
         //      its "subsystem" set, otherwise remoting cannot find the associated
         //      ServerInvocationHandler on the callback server
         callbackClient.setSubsystem(CallbackManager.JMS_CALLBACK_SUBSYSTEM);

         // We explictly set the Marshaller since otherwise remoting tries to resolve the marshaller
         // every time which is very slow - see org.jboss.remoting.transport.socket.ProcessInvocation
         // This can make a massive difference on performance. We also do this in
         // JMSRemotingConnection.setupConnection

         callbackClient.setMarshaller(new JMSWireFormat());
         callbackClient.setUnMarshaller(new JMSWireFormat());
      }
      else
      {
         log.trace("ServerInvokerCallbackHandler callback Client is not available: " +
                   "must be using pull callbacks");
View Full Code Here

         }
        
         config.put(MicroSocketClientInvoker.MAX_POOL_SIZE_FLAG, val);
      }

      client = new Client(serverLocator, config);

      client.setSubsystem(ServerPeer.REMOTING_JMS_SUBSYSTEM);
     
      config2.put(Client.ENABLE_LEASE, "false");
      config2.put(MicroSocketClientInvoker.MAX_POOL_SIZE_FLAG, "1");
     
      //Note we *must* use same serverLocator or invm optimisation won't work even if one param on the URI
      //is different
      onewayClient = new Client(serverLocator, config2);
     
      onewayClient.setSubsystem(ServerPeer.REMOTING_JMS_SUBSYSTEM);
                      
      if (log.isTraceEnabled()) { log.trace(this + " created client"); }

View Full Code Here

      }

      configuration.put(Client.ENABLE_LEASE, String.valueOf(false));

      //We execute this on it's own client
      Client client;
     
      try
      {
         client = new Client(new InvokerLocator(serverLocatorURI), configuration);
         client.setSubsystem(ServerPeer.REMOTING_JMS_SUBSYSTEM);
         client.connect();
      }
      catch (Exception e)
      {
         throw new MessagingNetworkFailureException("Failed to connect client", e);
      }

      client.setMarshaller(new JMSWireFormat());
      client.setUnMarshaller(new JMSWireFormat());
     
      return client;
   }
View Full Code Here

      {        
         remotingConnection = new JMSRemotingConnection(serverLocatorURI, clientPing, strictTck, new ConsolidatedRemotingConnectionListener(), sendAcksAsync);
        
         remotingConnection.start();
  
         Client client = remotingConnection.getRemotingClient();
        
         String remotingSessionId = client.getSessionId();
        
         String clientVMId = JMSClientVMIdentifier.instance;
           
         ConnectionFactoryCreateConnectionDelegateRequest req =
            new ConnectionFactoryCreateConnectionDelegateRequest(id, v,
                                                                 remotingSessionId, clientVMId,
                                                                 username, password, failedNodeID);
          
         ResponseSupport rs = (ResponseSupport)client.invoke(req, null);
        
         res = (CreateConnectionResult)rs.getResponse();
      }
      catch (Throwable t)
      {
View Full Code Here

TOP

Related Classes of org.jboss.remoting.Client

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.