Package org.jboss.cache

Examples of org.jboss.cache.InternalNode


   // TODO: What is this rubbish?!??
   private void integrateRetainedNode(Fqn ancFqn, Fqn descFqn)
   {
      prepareContextOptions();
      InternalNode ancestor = cache.getNode(ancFqn).getDelegationTarget();
      Object name = descFqn.get(ancFqn.size());
      InternalNode child = ancestor.getChild(name);
      if (ancFqn.size() == descFqn.size() + 1)
      {
         if (child == null)
         {
            prepareContextOptions();
            InternalNode descendant = cache.getNode(descFqn).getDelegationTarget();
            prepareContextOptions();
            ancestor.addChild(name, descendant);
         }
         else
         {
View Full Code Here


            wrapNodeForWriting(context, fqn.getParent(), true, true, includeInvalidNodes, false, force);
         }
      } else {
         // else, fetch from dataContainer.
         InternalNode[] nodes = dataContainer.peekInternalNodeAndDirectParent(fqn, includeInvalidNodes);
         InternalNode in = nodes[0];
         if (in != null) {
            // exists in cache!  Just acquire lock if needed, and wrap.
            // do we need a lock?
            boolean needToCopy = false;
            if (lockForWriting && acquireLock(context, fqn)) {
View Full Code Here

    * @param ctx    invocation context
    * @return true if parent lock is needed, false otherwise.
    */
   private boolean isParentLockNeeded(Fqn parent, InvocationContext ctx) {
      ReadCommittedNode parentNodeTmp = (ReadCommittedNode) ctx.lookUpNode(parent);
      InternalNode in = parentNodeTmp == null ? dataContainer.peekInternalNode(parent, true) : parentNodeTmp.getDelegationTarget();
      return isParentLockNeeded(in);
   }
View Full Code Here

      if (trace) log.trace("Can provide state? " + canProvideState);
      if (canProvideState && (fetchPersistentState || fetchTransientState))
      {
         marshaller.objectToObjectStream(true, out);
         long startTime = System.currentTimeMillis();
         InternalNode subtreeRoot = fqn.isRoot() ? cache.getRoot().getDelegationTarget() : cache.getNode(fqn).getDelegationTarget();

         // we don't need READ locks for MVCC based state transfer!
         if (log.isDebugEnabled())
            log.debug("Generating in-memory (transient) state for subtree " + fqn);
View Full Code Here

    * Then notify the listeners that the node has been activated.
    */
   private void removeNodeFromCacheLoader(Fqn fqn) throws Throwable
   {
      if (fqn == null) return;
      InternalNode n;
      if (((n = dataContainer.peekInternalNode(fqn, true)) != null) && n.isDataLoaded() && loader.exists(fqn))
      {
         // node not null and attributes have been loaded?
         if (n.hasChildren())
         {
            boolean result = childrenLoaded(n);
            if (result)
            {
               log.debug("children all initialized");
View Full Code Here

      private void handlePutCommand(InvocationContext ctx, Fqn fqn)
            throws Exception
      {
         if (fqn != null && dataContainer.exists(fqn) && loader.exists(fqn))
         {
            InternalNode n = dataContainer.peekInternalNode(fqn, true);// don't load
            // node not null and attributes have been loaded?
            if (n != null && n.isDataLoaded())
            {
               // has children?
               boolean result = childrenLoaded(n);
               if (n.hasChildren() && result)
               {
                  // children have been loaded, remove the node
                  addRemoveMod(ctx, cacheLoaderModifications, fqn, n.getData());
                  txActs++;
               }
               // doesn't have children, check the cache loader
               else if (loaderNoChildren(fqn))
               {
                  addRemoveMod(ctx, cacheLoaderModifications, fqn, n.getData());
                  txActs++;
               }
            }
         }
      }
View Full Code Here

   /**
    * @return a Set of child node names that hang directly off the backup tree root, or null if the backup tree root doesn't exist.
    */
   protected Set<Object> getBackupRoots()
   {
      InternalNode backupSubtree = dataContainer.peekInternalNode(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN, false);
      if (backupSubtree == null) return null;
      return backupSubtree.getChildrenNames();
   }
View Full Code Here

      if (trace) log.trace("Can provide state? " + canProvideState);
      if (canProvideState && (fetchPersistentState || fetchTransientState))
      {
         marshaller.objectToObjectStream(true, out);
         long startTime = System.currentTimeMillis();
         InternalNode subtreeRoot = fqn.isRoot() ? cache.getRoot().getDelegationTarget() : cache.getNode(fqn).getDelegationTarget();

         // we don't need READ locks for MVCC based state transfer!
         if (log.isDebugEnabled())
            log.debug("Generating in-memory (transient) state for subtree " + fqn);
View Full Code Here

   // TODO: What is this rubbish?!??
   private void integrateRetainedNode(Fqn ancFqn, Fqn descFqn)
   {
      prepareContextOptions();
      InternalNode ancestor = cache.getNode(ancFqn).getDelegationTarget();
      Object name = descFqn.get(ancFqn.size());
      InternalNode child = ancestor.getChild(name);
      if (ancFqn.size() == descFqn.size() + 1)
      {
         if (child == null)
         {
            prepareContextOptions();
            InternalNode descendant = cache.getNode(descFqn).getDelegationTarget();
            prepareContextOptions();
            ancestor.addChild(name, descendant);
         }
         else
         {
View Full Code Here

            return false;
         }
         else
         {
            if (trace) log.trace("removing NODE as it is a leaf: evict(" + fqn + ")");
            InternalNode parentNode = lookupInAllScopes(ctx, fqn.getParent());

            if (parentNode != null)
            {
               parentNode.removeChild(fqn.getLastElement());
               parentNode.setChildrenLoaded(false);
            }
            node.setValid(false, false);
            node.markAsDeleted(true);
            node.setDataLoaded(false);
            node.getDelegationTarget().clear();
View Full Code Here

TOP

Related Classes of org.jboss.cache.InternalNode

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.