Package org.jboss.cache.factories

Examples of org.jboss.cache.factories.NodeFactory


   {
      DataNode parent = root;
      DataNode child = null;
      Object owner = getOwnerForLock();
      Object name = null;
      NodeFactory factory = NodeFactory.getInstance();
      byte type = isNodeLockingOptimistic()
              ? NodeFactory.NODE_TYPE_OPTIMISTIC_NODE
              : NodeFactory.NODE_TYPE_TREENODE;

      for (int i = 0; i < subtree.size(); i++)
      {
         name = subtree.get(i);
         child = (DataNode) parent.getChild(name);
         if (child == null)
         {
            // Lock the parent, create and add the child
            try
            {
               parent.acquire(owner, state_fetch_timeout, DataNode.LOCK_TYPE_WRITE);
            }
            catch (InterruptedException e)
            {
               log.error("Interrupted while locking" + parent.getFqn(), e);
               throw new CacheException(e.getLocalizedMessage(), e);
            }

            try
            {
               child = factory.createDataNode(type, name,
                       subtree.getFqnChild(i + 1),
                       parent, null, this);
               parent.addChild(name, child);
            }
            finally
View Full Code Here


   {
      DataNode parent = root;
      DataNode child = null;
      Object owner = getOwnerForLock();
      Object name = null;
      NodeFactory factory = NodeFactory.getInstance();
      byte type = isNodeLockingOptimistic()
              ? NodeFactory.NODE_TYPE_OPTIMISTIC_NODE
              : NodeFactory.NODE_TYPE_TREENODE;

      for (int i = 0; i < subtree.size(); i++)
      {
         name = subtree.get(i);
         child = (DataNode) parent.getChild(name);
         if (child == null)
         {
            // Lock the parent, create and add the child
            try
            {
               parent.acquire(owner, state_fetch_timeout, DataNode.LOCK_TYPE_WRITE);
            }
            catch (InterruptedException e)
            {
               log.error("Interrupted while locking" + parent.getFqn(), e);
               throw new CacheException(e.getLocalizedMessage(), e);
            }

            try
            {
               child = factory.createDataNode(type, name,
                       subtree.getFqnChild(i + 1),
                       parent, null, this);
               // Add uninitialized flag so that data stored at the root of the
               // region can be loaded/preloaded from the cache loader.
               child.put(UNINITIALIZED, null);
View Full Code Here

   {
      DataNode parent = root;
      DataNode child = null;
      Object owner = getOwnerForLock();
      Object name = null;
      NodeFactory factory = NodeFactory.getInstance();
      byte type = isNodeLockingOptimistic()
              ? NodeFactory.NODE_TYPE_OPTIMISTIC_NODE
              : NodeFactory.NODE_TYPE_TREENODE;

      for (int i = 0; i < subtree.size(); i++)
      {
         name = subtree.get(i);
         child = (DataNode) parent.getChild(name);
         if (child == null)
         {
            // Lock the parent, create and add the child
            try
            {
               parent.acquire(owner, state_fetch_timeout, DataNode.LOCK_TYPE_WRITE);
            }
            catch (InterruptedException e)
            {
               log.error("Interrupted while locking" + parent.getFqn(), e);
               throw new CacheException(e.getLocalizedMessage(), e);
            }

            try
            {
               child = factory.createDataNode(type, name,
                       subtree.getFqnChild(i + 1),
                       parent, null, this);
               parent.addChild(name, child);
            }
            finally
View Full Code Here

   {
      DataNode parent = root;
      DataNode child = null;
      Object owner = getOwnerForLock();
      Object name = null;
      NodeFactory factory = NodeFactory.getInstance();
      byte type = isNodeLockingOptimistic()
              ? NodeFactory.NODE_TYPE_OPTIMISTIC_NODE
              : NodeFactory.NODE_TYPE_TREENODE;

      for (int i = 0; i < subtree.size(); i++)
      {
         name = subtree.get(i);
         child = (DataNode) parent.getChild(name);
         if (child == null)
         {
            // Lock the parent, create and add the child
            try
            {
               parent.acquire(owner, state_fetch_timeout, DataNode.LOCK_TYPE_WRITE);
            }
            catch (InterruptedException e)
            {
               log.error("Interrupted while locking" + parent.getFqn(), e);
               throw new CacheException(e.getLocalizedMessage(), e);
            }

            try
            {
               child = factory.createDataNode(type, name,
                       subtree.getFqnChild(i + 1),
                       parent, null, this);
               parent.addChild(name, child);
            }
            finally
View Full Code Here

TOP

Related Classes of org.jboss.cache.factories.NodeFactory

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.