Package org.jboss.jms.client.remoting

Examples of org.jboss.jms.client.remoting.JMSRemotingConnection


         assertEquals(1, getServerId(conn));

         // we "cripple" the remoting connection by removing ConnectionListener. This way, failures
         // cannot be "cleanly" detected by the client-side pinger, and we'll fail on an invocation
         JMSRemotingConnection rc = ((ClientConnectionDelegate)((JBossConnection)conn).
            getDelegate()).getRemotingConnection();
         rc.removeConnectionListener();

         // poison the server
         ServerManagement.poisonTheServer(1, PoisonInterceptor.FAIL_BEFORE_SENDTRANSACTION);

         Session session = conn.createSession(true, Session.SESSION_TRANSACTED);
View Full Code Here


         // Objects Server1
         conn1 = createConnectionOnServer(cf, 1);

         assertEquals(1, getServerId(conn1));

         JMSRemotingConnection rc = ((ClientConnectionDelegate)((JBossConnection)conn1).
            getDelegate()).getRemotingConnection();
         rc.removeConnectionListener();

         Session session1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);

         MessageConsumer consumer = session1.createConsumer(queue[1]);
View Full Code Here

     
      Version version = getVersionToUse(serverVersion);
     
      byte v = version.getProviderIncrementingVersion();
                      
      JMSRemotingConnection remotingConnection = null;
     
      CreateConnectionResult res;
     
      try
      {        
         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)
      {
         //If we were invoking createConnectionDelegate and failure occurs then we need to clear
         // up the JMSRemotingConnection

         if (remotingConnection != null)
         {
            try
            {
               remotingConnection.stop();
            }
            catch (Throwable ignore)
            {
            }
         }
        
         throw handleThrowable(t);
      }
        
      ClientConnectionDelegate connectionDelegate = (ClientConnectionDelegate)res.getDelegate();
     
      if (connectionDelegate != null)
      {
         connectionDelegate.setRemotingConnection(remotingConnection);
        
         connectionDelegate.setVersionToUse(version);
        
         connectionDelegate.setEnableOrderingGroup(this.enableOrderingGroup);
        
         connectionDelegate.setDefaultOrderingGroup(this.defaultOrderingGroupName);
      }
      else
      {
         //Wrong server redirect on failure
         //close the remoting connection
         try
         {
            remotingConnection.stop();
         }
         catch (Throwable ignore)
         {
         }
      }
View Full Code Here

      // synchronize (recursively) the client-side state

      state.synchronizeWith(newDelegate.getState());
     
      JMSRemotingConnection conn = ((ConnectionState)state.getParent()).getRemotingConnection();

      client = conn.getRemotingClient();
     
      onewayClient = conn.getOnewayClient();
     
      strictTck = conn.isStrictTck();
     
      sendAcksAsync = conn.isSendAcksAsync();
   }
View Full Code Here

   public void setState(HierarchicalState state)
   {
      super.setState(state);
     
      JMSRemotingConnection conn = ((ConnectionState)state.getParent()).getRemotingConnection();

      client = conn.getRemotingClient();
     
      onewayClient = conn.getOnewayClient();
     
      strictTck = conn.isStrictTck();
     
      sendAcksAsync = conn.isSendAcksAsync();
   }
View Full Code Here

         closeCallback(isConnFailure);

         if (trace) log.trace("Trying communication on server(" + server + ")=" + delegates[server].getServerLocatorURI());
         try
         {
            remoting = new JMSRemotingConnection(delegates[server].getServerLocatorURI(), true, delegates[server].getStrictTck(), delegates[server].isSendAcksAsync());
            remoting.start();
            currentDelegate = delegates[server];
            if (trace) log.trace("Adding callback");
            addCallback(delegates[server]);
            if (trace) log.trace("Getting topology");
View Full Code Here

      {
         connection = (JBossConnection)cf.createConnection();
         connection.start();

         ClientConnectionDelegate delegate = (ClientConnectionDelegate)connection.getDelegate();
         JMSRemotingConnection remotingConnection = delegate.getRemotingConnection();
         Client client = remotingConnection.getRemotingClient();

         Field field = JMSRemotingConnection.class.getDeclaredField("serverLocator");
         field.setAccessible(true);
         InvokerLocator locator = (InvokerLocator)field.get(remotingConnection);
         String transport = locator.getProtocol();
View Full Code Here

        
         connection = (JBossConnection)cf.createConnection();
         connection.start();

         ClientConnectionDelegate delegate = (ClientConnectionDelegate)connection.getDelegate();
         JMSRemotingConnection remotingConnection = delegate.getRemotingConnection();
         Client client = remotingConnection.getRemotingClient();

         Field field = JMSRemotingConnection.class.getDeclaredField("serverLocator");
         field.setAccessible(true);
         InvokerLocator locator = (InvokerLocator)field.get(remotingConnection);
         String transport = locator.getProtocol();

         if ("socket".equals(transport)
               || "sslsocket".equals(transport)
               || "bisocket".equals(transport)
               || "sslbisocket".equals(transport))
         {
            field = Client.class.getDeclaredField("callbackConnectors");
            field.setAccessible(true);
            Map callbackConnectors = (Map)field.get(client);

            InvokerCallbackHandler callbackHandler = remotingConnection.getCallbackManager();
            HashSet map = (HashSet) callbackConnectors.get(callbackHandler);
            Connector connector = (Connector)map.iterator().next();
            locator = new InvokerLocator(connector.getInvokerLocator());
            assertEquals(address, locator.getHost());
            assertEquals(freePort, locator.getPort());
View Full Code Here

         producer.send(session.createTextMessage("Hello again before failover"));

         ClientConnectionDelegate delegate = (ClientConnectionDelegate) conn.getDelegate();

         JMSRemotingConnection originalRemoting = delegate.getRemotingConnection();

         ServerManagement.kill(1);

         // wait for the client-side failover to complete
View Full Code Here

      {
         conn = createConnectionOnServer(cf, 1);

         // we "cripple" the remoting connection by removing ConnectionListener. This way, failures
         // cannot be "cleanly" detected by the client-side pinger, and we'll fail on an invocation
         JMSRemotingConnection rc = ((ClientConnectionDelegate)((JBossConnection)conn).
            getDelegate()).getRemotingConnection();
         rc.removeConnectionListener();

         ServerManagement.kill(1);

         conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      }
View Full Code Here

TOP

Related Classes of org.jboss.jms.client.remoting.JMSRemotingConnection

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.