Package org.jboss.jms.client

Examples of org.jboss.jms.client.FailoverCommandCenter


         }
        
         connectionState = (ConnectionState)hs;
      }
     
      FailoverCommandCenter fcc = connectionState.getFailoverCommandCenter();
           
      // non clustered, send the invocation forward
      if (fcc == null)
      {
         return invocation.invokeNext();
      }
     
      FailoverValve2 valve = fcc.getValve();
     
      JMSRemotingConnection remotingConnection = null;
      String methodName = ((MethodInvocation)invocation).getMethod().getName();

      boolean left = false;
     
      try
      {
         valve.enter();

         // it's important to retrieve the remotingConnection while inside the Valve
         remotingConnection = fcc.getRemotingConnection();
         return invocation.invokeNext();
      }
      catch (MessagingNetworkFailureException e)
      {
         valve.leave();
         left = true;
        
         log.debug(this + " detected network failure, putting " + methodName +
         "() on hold until failover completes");
     
         fcc.failureDetected(e, this, remotingConnection);
        
         // Set retry flag as true on send() and sendTransaction()
         // more details at http://jira.jboss.org/jira/browse/JBMESSAGING-809

         if (invocation.getTargetObject() instanceof ClientSessionDelegate &&
View Full Code Here


               ConnectionState state = (ConnectionState)((DelegateSupport)cd).getState();

               state.initializeFailoverCommandCenter();

               FailoverCommandCenter fcc = state.getFailoverCommandCenter();

               // add a connection listener to detect failure; the consolidated remoting connection
               // listener must be already in place and configured
               state.getRemotingConnection().getConnectionListener().
                  addDelegateListener(new ConnectionFailureListener(fcc, state.getRemotingConnection()));
View Full Code Here

      return fcc;
   }

   public void initializeFailoverCommandCenter()
   {
      fcc = new FailoverCommandCenter(this);
   }
View Full Code Here

      int prefetchSize = consumerState.getBufferSize();
      Executor executor = sessionState.getExecutor();
      int maxDeliveries = consumerState.getMaxDeliveries();
      long redeliveryDelay = consumerState.getRedeliveryDelay();
     
      FailoverCommandCenter fcc = connectionState.getFailoverCommandCenter();
     
      //We need the queue name for recovering any deliveries after failover
      String queueName = null;
      if (consumerState.getSubscriptionName() != null)
      {
View Full Code Here

      return fcc;
   }

   public void initializeFailoverCommandCenter()
   {
      fcc = new FailoverCommandCenter(this);
   }
View Full Code Here

      return fcc;
   }

   public void initializeFailoverCommandCenter()
   {
      fcc = new FailoverCommandCenter(this);
   }
View Full Code Here

      return fcc;
   }

   public void initializeFailoverCommandCenter()
   {
      fcc = new FailoverCommandCenter(this);
   }
View Full Code Here

         }
        
         connectionState = (ConnectionState)hs;
      }
     
      FailoverCommandCenter fcc = connectionState.getFailoverCommandCenter();
           
      // non clustered, send the invocation forward
      if (fcc == null)
      {
         return invocation.invokeNext();
      }
     
      FailoverValve2 valve = fcc.getValve();
     
      JMSRemotingConnection remotingConnection = null;
      String methodName = ((MethodInvocation)invocation).getMethod().getName();
     
      if (methodName.equals("startAfterFailover"))
      {
         //We don't use the valve on this method
         return invocation.invokeNext();
      }

      boolean left = false;
     
      try
      {
         valve.enter();

         // it's important to retrieve the remotingConnection while inside the Valve
         remotingConnection = fcc.getRemotingConnection();
         return invocation.invokeNext();
      }
      catch (MessagingNetworkFailureException e)
      {
         valve.leave();
         left = true;
        
         log.debug(this + " detected network failure, putting " + methodName +
         "() on hold until failover completes");
     
         fcc.failureDetected(e, this, remotingConnection);
        
         // Set retry flag as true on send() and sendTransaction()
         // more details at http://jira.jboss.org/jira/browse/JBMESSAGING-809

         if ((invocation.getTargetObject() instanceof ClientSessionDelegate && methodName.equals("send")) ||
View Full Code Here

               {
                 ConnectionState state = (ConnectionState)((DelegateSupport)cd).getState();
 
                 state.initializeFailoverCommandCenter();
 
                 FailoverCommandCenter fcc = state.getFailoverCommandCenter();
 
                 // add a connection listener to detect failure; the consolidated remoting connection
                 // listener must be already in place and configured
                 state.getRemotingConnection().getConnectionListener().
                    setDelegateListener(new ConnectionFailureListener(fcc, state.getRemotingConnection()));
View Full Code Here

      return fcc;
   }

   public void initializeFailoverCommandCenter()
   {
      fcc = new FailoverCommandCenter(this);
   }
View Full Code Here

TOP

Related Classes of org.jboss.jms.client.FailoverCommandCenter

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.