Package org.hornetq.core.persistence

Examples of org.hornetq.core.persistence.OperationContext


      }
   }

   public void close(final boolean failed)
   {
      OperationContext formerCtx = storageManager.getContext();

      try
      {
         storageManager.setContext(sessionContext);
View Full Code Here


   {
      synchronized (replicationLock)
      {
         while (!pendingTokens.isEmpty())
         {
            OperationContext ctx = pendingTokens.poll();
            try
            {
               ctx.replicationDone();
            }
            catch (Throwable e)
            {
               HornetQServerLogger.LOGGER.errorCompletingCallbackOnReplicationManager(e);
            }
View Full Code Here

   {
      if (!enabled)
         return;
      boolean runItNow = false;

      OperationContext repliToken = OperationContextImpl.getContext(executorFactory);
      if (lineUp)
      {
         repliToken.replicationLineUp();
      }

      synchronized (replicationLock)
      {
         if (enabled)
         {
            pendingTokens.add(repliToken);
            replicatingChannel.send(packet);
         }
         else
         {
            // Already replicating channel failed, so just play the action now
            runItNow = true;
         }
      }

      // Execute outside lock

      if (runItNow)
      {
         repliToken.replicationDone();
      }
   }
View Full Code Here

    *            response. If your packets are triggering this exception, it may be because the
    *            packets were not sent with {@link #sendReplicatePacket(Packet)}.
    */
   private void replicated()
   {
      OperationContext ctx = pendingTokens.poll();

      if (ctx == null)
      {
         throw new IllegalStateException("Missing replication token on the queue.");
      }

      ctx.replicationDone();
   }
View Full Code Here

      return getContext(null);
   }

   public static OperationContext getContext(final ExecutorFactory executorFactory)
   {
      OperationContext token = OperationContextImpl.threadLocalContext.get();
      if (token == null)
      {
         if (executorFactory == null)
         {
            return null;
View Full Code Here

      return name;
   }

   public Response propose(final Proposal proposal) throws Exception
   {
      OperationContext originalCtx = storageManager.getContext();

      try
      {
         // the waitCompletion cannot be done inside an ordered executor or we would starve when the thread pool is full
         storageManager.setContext(storageManager.newSingleThreadContext());
View Full Code Here

      // since sendLiveIsStoping my issue a close back from the channel
      // and we want to ensure a stop here just in case
      ReplicationManager replicatorInUse = replicator;
      if (replicatorInUse != null)
      {
         final OperationContext token = replicator.sendLiveIsStopping(LiveStopping.FAIL_OVER);
         if (token != null)
         {
            try
            {
               token.waitCompletion(5000);
            }
            catch (Exception e)
            {
               // ignore it
            }
View Full Code Here

      setStarted(false);
   }

   public void waitContextCompletion()
   {
      OperationContext formerCtx = storageManager.getContext();

      try
      {
         try
         {
View Full Code Here

      }
   }

   public void close(final boolean failed)
   {
      OperationContext formerCtx = storageManager.getContext();

      try
      {
         storageManager.setContext(sessionContext);
View Full Code Here

      // Complete any pending operations...
      // Case the backup crashed, this should clean up any pending requests
      while (!pendingTokens.isEmpty())
      {
         OperationContext ctx = pendingTokens.poll();
         try
         {
            ctx.replicationDone();
         }
         catch (Throwable e)
         {
            ReplicationManagerImpl.log.warn("Error completing callback on replication manager", e);
         }
View Full Code Here

TOP

Related Classes of org.hornetq.core.persistence.OperationContext

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.