Package org.jboss.jms.client.remoting

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


         // 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


         // 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);

         QueueBrowser browser = session1.createBrowser(queue[1]);
View Full Code Here

         conn1 = createConnectionOnServer(cf, 1);

         assertEquals(1, getServerId(conn1));

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

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

         ServerManagement.kill(1);
View Full Code Here

         conn1 = createConnectionOnServer(cf, 1);

         assertEquals(1, getServerId(conn1));

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

         ServerManagement.kill(1);

         conn1.close();
      }
View Full Code Here

         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, typeOfFailure);

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

         if(trace) { log.trace(connectionDelegate + " not configured, configuring ..."); }

         int serverID = connectionDelegate.getServerID();
         Version versionToUse = connectionDelegate.getVersionToUse();
         JMSRemotingConnection remotingConnection = connectionDelegate.getRemotingConnection();

         if (versionToUse == null)
         {
            throw new IllegalStateException("Connection version is null");
         }

         ConnectionState connectionState =
            new ConnectionState(serverID, connectionDelegate,
                                remotingConnection, versionToUse,
                                connectionDelegate.isEnableOrderingGroup(), connectionDelegate.getDefaultOrderingGroupName(),
                                connectionDelegate.getMaxRetryChangeRate(), connectionDelegate.getRetryChangeRateInterval());

         remotingConnection.getConnectionListener().setConnectionState(connectionState);
         remotingConnection.getConnectionListener().start();
         
         connectionDelegate.setState(connectionState);
      }

      return res;
View Full Code Here

     {
        //Always cleanup in a finally - we need to cleanup if the server call to close fails too
      
        ConnectionState state = getConnectionState(invocation);
 
        JMSRemotingConnection remotingConnection = state.getRemotingConnection();
 
        // remove the consolidated remoting connection listener
 
        ConsolidatedRemotingConnectionListener l = remotingConnection.removeConnectionListener();
        if (l != null)
        {
           l.clear();
        }
 
        // Finished with the connection - we need to shutdown callback server
        remotingConnection.stop();
        
        // And to resource manager
        ResourceManagerFactory.instance.checkInResourceManager(state.getServerID());
     }
   }
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);
        
         connectionDelegate.setMaxRetryChangeRate(this.maxRetryChangeRate);
        
         connectionDelegate.setRetryChangeRateInterval(this.retryChangeRateInterval);
      }
      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

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.