Package org.jboss.cache.marshall

Examples of org.jboss.cache.marshall.Region


         // Start accepting messages for the subtree, but
         // queue them for later processing.  We do this early
         // to reduce the chance of discarding a prepare call
         // whose corresponding commit will thus fail after activation
         Region region = regionManager_.getRegion(fqn);
         if (region == null)
            region = regionManager_.createRegion(fqn, null, true);

         region.startQueuing();

         // If a classloader is registered for the node's region, use it
         ClassLoader cl = region.getClassLoader();

         // Request partial state from the cluster and integrate it
         if (BuddyManager.isBackupFqn(fqn))
         {
            if (log.isDebugEnabled())
               log.debug("Not attempting to load state for a buddy backup Fqn that has just been activated: " + fqn);
         }
         else
         {
            if (buddyManager == null)
            {
               // Get the state from any node that has it and put it
               // in the main tree
               if (subtreeRoot == null)
               {
                  // We'll update this node with the state we receive
                  subtreeRoot = createSubtreeRootNode(fqn);
               }
               loadState(subtreeRoot, cl);
            }
            else
            {
               // Get the state from each DataOwner and integrate in their
               // respective buddy backup tree
               List buddies = buddyManager.getBackupDataOwners();
               for (Iterator it = buddies.iterator(); it.hasNext();)
               {
                  Address buddy = (Address) it.next();
                  if (getMembers() == null || !getMembers().contains(buddy))
                     continue;
                 
                  Object[] sources = {buddy};
                  Fqn base = new Fqn(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN, BuddyManager.getGroupNameFromAddress(buddy));
                  Fqn buddyRoot = new Fqn(base, fqn);
                  subtreeRoot = findNode(buddyRoot);
                  if (subtreeRoot == null)
                  {
                     // We'll update this node with the state we receive
                     subtreeRoot = createSubtreeRootNode(buddyRoot);
                  }
                  _loadState(fqn, subtreeRoot, sources, cl);
               }
            }
         }

         // Lock out other activity on the region while we
         // we process the queue and activate the region
         List queue = region.getMethodCallQueue();
         synchronized (queue)
         {
            processQueuedMethodCalls(queue);
            region.activate();
         }

      }
      catch (Throwable t)
      {
View Full Code Here


   public void _enqueueMethodCall(String subtree, MethodCall call)
           throws Throwable
   {
      JBCMethodCall jbcCall = (JBCMethodCall) call;
      Fqn fqn = Fqn.fromString(subtree);
      Region region = regionManager_.getRegion(fqn);
      // JBCACHE-1225 -- handle buddy region fqns
      if (region == null && BuddyManager.isBackupFqn(fqn))
      {
         // Strip out the buddy group portion
         fqn = fqn.getFqnChild(2, fqn.size());
         region = regionManager_.getRegion(fqn);
      }
      if (region == null)
         throw new IllegalStateException("No region found for " + subtree);

      List queue = region.getMethodCallQueue();
      synchronized (queue)
      {
         // Confirm we're not active yet; if we are just invoke the method
         switch (region.getStatus())
         {
            case(Region.STATUS_ACTIVE):
               if (log.isTraceEnabled())
                  log.trace("_enqueueMethodCall(): Invoking " + call.getName() +
                          " on subtree " + subtree);
View Full Code Here

         super.activateRegion(subtreeFqn);
      }
      else
      {
         // If the internal region is not activated yet, activate it first
         Region region = regionManager_.getRegion(InternalDelegate.JBOSS_INTERNAL);
         if ((region == null && inactiveOnStartup)
               || (region != null && region.isInactive()))
         {
            super.activateRegion(InternalDelegate.JBOSS_INTERNAL.toString());
         }

         // If we don't have an internal map node yet, create one.
View Full Code Here

         // Start accepting messages for the subtree, but
         // queue them for later processing.  We do this early
         // to reduce the chance of discarding a prepare call
         // whose corresponding commit will thus fail after activation
         Region region = regionManager_.getRegion(fqn);
         if (region == null)
            region = regionManager_.createRegion(fqn, null, true);

         region.startQueuing();

         // If a classloader is registered for the node's region, use it
         ClassLoader cl = region.getClassLoader();

         // Request partial state from the cluster and integrate it
         if (BuddyManager.isBackupFqn(fqn))
         {
            if (log.isDebugEnabled())
               log.debug("Not attempting to load state for a buddy backup Fqn that has just been activated: " + fqn);
         }
         else
         {
            if (buddyManager == null)
            {
               // Get the state from any node that has it and put it
               // in the main tree
               if (subtreeRoot == null)
               {
                  // We'll update this node with the state we receive
                  subtreeRoot = createSubtreeRootNode(fqn);
               }
               loadState(subtreeRoot, cl);
            }
            else
            {
               // Get the state from each DataOwner and integrate in their
               // respective buddy backup tree
               List buddies = buddyManager.getBackupDataOwners();
               for (Iterator it = buddies.iterator(); it.hasNext();)
               {
                  Address buddy = (Address) it.next();
                  if (getMembers() == null || !getMembers().contains(buddy))
                     continue;

                  Object[] sources = {buddy};
                  Fqn base = new Fqn(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN, BuddyManager.getGroupNameFromAddress(buddy));
                  Fqn buddyRoot = new Fqn(base, fqn);
                  subtreeRoot = findNode(buddyRoot);
                  if (subtreeRoot == null)
                  {
                     // We'll update this node with the state we receive
                     subtreeRoot = createSubtreeRootNode(buddyRoot);
                  }
                  _loadState(fqn, subtreeRoot, sources, cl);
               }
            }
         }

         // Lock out other activity on the region while we
         // we process the queue and activate the region
         List queue = region.getMethodCallQueue();
         synchronized (queue)
         {
            processQueuedMethodCalls(queue);
            region.activate();
         }

      }
      catch (Throwable t)
      {
View Full Code Here

   public void _enqueueMethodCall(String subtree, MethodCall call)
           throws Throwable
   {
      JBCMethodCall jbcCall = (JBCMethodCall) call;
      Fqn fqn = Fqn.fromString(subtree);
      Region region = regionManager_.getRegion(fqn);
      // JBCACHE-1225 -- handle buddy region fqns
      if (region == null && BuddyManager.isBackupFqn(fqn))
      {
         // Strip out the buddy group portion
         fqn = fqn.getFqnChild(2, fqn.size());
         region = regionManager_.getRegion(fqn);
      }
      if (region == null)
         throw new IllegalStateException("No region found for " + subtree);

      List queue = region.getMethodCallQueue();
      synchronized (queue)
      {
         // Confirm we're not active yet; if we are just invoke the method
         switch (region.getStatus())
         {
            case(Region.STATUS_ACTIVE):
               if (log.isTraceEnabled())
                  log.trace("_enqueueMethodCall(): Invoking " + call.getName() +
                          " on subtree " + subtree);
View Full Code Here

         // Start accepting messages for the subtree, but
         // queue them for later processing.  We do this early
         // to reduce the chance of discarding a prepare call
         // whose corresponding commit will thus fail after activation
         Region region = regionManager_.getRegion(fqn);
         if (region == null)
            region = regionManager_.createRegion(fqn, null, true);

         region.startQueuing();

         // If a classloader is registered for the node's region, use it
         ClassLoader cl = region.getClassLoader();

         // Request partial state from the cluster and integrate it
         if (BuddyManager.isBackupFqn(fqn))
         {
            if (log.isDebugEnabled())
               log.debug("Not attempting to load state for a buddy backup Fqn that has just been activated: " + fqn);
         }
         else
         {
            if (buddyManager == null)
            {
               // Get the state from any node that has it and put it
               // in the main tree
               if (subtreeRoot == null)
               {
                  // We'll update this node with the state we receive
                  subtreeRoot = createSubtreeRootNode(fqn);
               }
               loadState(subtreeRoot, cl);
            }
            else
            {
               // Get the state from each DataOwner and integrate in their
               // respective buddy backup tree
               List buddies = buddyManager.getBuddyAddresses();
               for (Iterator it = buddies.iterator(); it.hasNext();)
               {
                  Address buddy = (Address) it.next();
                  Object[] sources = {buddy};
                  Fqn base = new Fqn(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN, BuddyManager.getGroupNameFromAddress(buddy));
                  Fqn buddyRoot = new Fqn(base, fqn);
                  subtreeRoot = findNode(buddyRoot);
                  if (subtreeRoot == null)
                  {
                     // We'll update this node with the state we receive
                     subtreeRoot = createSubtreeRootNode(buddyRoot);
                  }
                  _loadState(fqn, subtreeRoot, sources, cl);
               }
            }
         }

         // Lock out other activity on the region while we
         // we process the queue and activate the region
         List queue = region.getMethodCallQueue();
         synchronized (queue)
         {
            processQueuedMethodCalls(queue);
            region.activate();
         }

      }
      catch (Throwable t)
      {
View Full Code Here

    */
   public void _enqueueMethodCall(String subtree, MethodCall call)
           throws Throwable
   {
      JBCMethodCall jbcCall = (JBCMethodCall) call;
      Region region = regionManager_.getRegion(subtree);
      if (region == null)
         throw new IllegalStateException("No region found for " + subtree);

      List queue = region.getMethodCallQueue();
      synchronized (queue)
      {
         // Confirm we're not active yet; if we are just invoke the method
         switch (region.getStatus())
         {
            case(Region.STATUS_ACTIVE):
               if (log.isTraceEnabled())
                  log.trace("_enqueueMethodCall(): Invoking " + call.getName() +
                          " on subtree " + subtree);
View Full Code Here

         // Start accepting messages for the subtree, but
         // queue them for later processing.  We do this early
         // to reduce the chance of discarding a prepare call
         // whose corresponding commit will thus fail after activation
         Region region = regionManager_.getRegion(fqn);
         if (region == null)
            region = regionManager_.createRegion(fqn, null, true);

         region.startQueuing();

         // If a classloader is registered for the node's region, use it
         ClassLoader cl = region.getClassLoader();

         // Request partial state from the cluster and integrate it
         if (BuddyManager.isBackupFqn(fqn))
         {
            if (log.isDebugEnabled())
               log.debug("Not attempting to load state for a buddy backup Fqn that has just been activated: " + fqn);
         }
         else
         {
            if (buddyManager == null)
            {
               // Get the state from any node that has it and put it
               // in the main tree
               if (subtreeRoot == null)
               {
                  // We'll update this node with the state we receive
                  subtreeRoot = createSubtreeRootNode(fqn);
               }
               loadState(subtreeRoot, cl);
            }
            else
            {
               // Get the state from each DataOwner and integrate in their
               // respective buddy backup tree
               List buddies = buddyManager.getBackupDataOwners();
               for (Iterator it = buddies.iterator(); it.hasNext();)
               {
                  Address buddy = (Address) it.next();
                  if (getMembers() == null || !getMembers().contains(buddy))
                     continue;
                 
                  Object[] sources = {buddy};
                  Fqn base = new Fqn(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN, BuddyManager.getGroupNameFromAddress(buddy));
                  Fqn buddyRoot = new Fqn(base, fqn);
                  subtreeRoot = findNode(buddyRoot);
                  if (subtreeRoot == null)
                  {
                     // We'll update this node with the state we receive
                     subtreeRoot = createSubtreeRootNode(buddyRoot);
                  }
                  _loadState(fqn, subtreeRoot, sources, cl);
               }
            }
         }

         // Lock out other activity on the region while we
         // we process the queue and activate the region
         List queue = region.getMethodCallQueue();
         synchronized (queue)
         {
            processQueuedMethodCalls(queue);
            region.activate();
         }

      }
      catch (Throwable t)
      {
View Full Code Here

   public void _enqueueMethodCall(String subtree, MethodCall call)
           throws Throwable
   {
      JBCMethodCall jbcCall = (JBCMethodCall) call;
      Fqn fqn = Fqn.fromString(subtree);
      Region region = regionManager_.getRegion(fqn);
      // JBCACHE-1225 -- handle buddy region fqns
      if (region == null && BuddyManager.isBackupFqn(fqn))
      {
         // Strip out the buddy group portion
         fqn = fqn.getFqnChild(2, fqn.size());
         region = regionManager_.getRegion(fqn);
      }
      if (region == null)
         throw new IllegalStateException("No region found for " + subtree);

      List queue = region.getMethodCallQueue();
      synchronized (queue)
      {
         // Confirm we're not active yet; if we are just invoke the method
         switch (region.getStatus())
         {
            case(Region.STATUS_ACTIVE):
               if (log.isTraceEnabled())
                  log.trace("_enqueueMethodCall(): Invoking " + call.getName() +
                          " on subtree " + subtree);
View Full Code Here

TOP

Related Classes of org.jboss.cache.marshall.Region

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.