Package org.jboss.cache.invocation

Examples of org.jboss.cache.invocation.NodeInvocationDelegate


   }

   public void testLockReentrancy() throws InterruptedException
   {
      Fqn fqn = Fqn.fromString("/a/b/c");
      NodeSPI node = new NodeInvocationDelegate(new UnversionedNode(fqn));

      assert lm.lock(fqn, WRITE, null);
      assert lm.isLocked(node);

      assert lm.lock(node, WRITE, null);
View Full Code Here


   /**
    * Constructs with a node and workspace.
    */
   public WorkspaceNodeImpl(NodeSPI<K, V> node, TransactionWorkspace workspace, NodeFactory<K, V> nodeFactory)
   {
      NodeInvocationDelegate delegate = (NodeInvocationDelegate) node;
      if (!(delegate.getDelegationTarget() instanceof VersionedNode))
      {
         throw new IllegalArgumentException("node " + delegate.getDelegationTarget() + " not VersionedNode");
      }
      this.node = node;
      this.workspace = workspace;
      Map<K, V> nodeData = node.getDataDirect();
      if (!nodeData.isEmpty()) optimisticDataMap = new HashMap<K, V>(nodeData);
View Full Code Here

   }

   protected NodeSPI createNode(Fqn fqn)
   {
      UnversionedNode un = new UnversionedNode(fqn);
      return new NodeInvocationDelegate(un);
   }
View Full Code Here

   }

   public void testLockReentrancy() throws InterruptedException
   {
      Fqn fqn = Fqn.fromString("/a/b/c");
      NodeSPI node = new NodeInvocationDelegate(new UnversionedNode(fqn));

      assert lm.lock(fqn, WRITE, null);
      assert lm.isLocked(node);

      assert lm.lock(node, WRITE, null);
View Full Code Here

   protected NodeSPI createNode(Fqn fqn)
   {
      PessimisticUnversionedNode un = new PessimisticUnversionedNode(fqn.getLastElement(), fqn, null, null);
      un.injectDependencies(null, null, null);
      un.injectLockStrategyFactory(new LockStrategyFactory());
      return new NodeInvocationDelegate(un);
   }
View Full Code Here

   protected NodeSPI createNode(Fqn fqn)
   {
      PessimisticUnversionedNode un = new PessimisticUnversionedNode(fqn.getLastElement(), fqn, null, null);
      un.injectDependencies(null, null, null);
      un.injectLockStrategyFactory(new LockStrategyFactory());
      return new NodeInvocationDelegate(un);
   }
View Full Code Here

   public NodeSPI<K, V> createDataNode(Object childName, Fqn fqn, NodeSPI<K, V> parent, Map<K, V> data, boolean mapSafe)
   {
      UnversionedNode un = optimistic ? new VersionedNode<K, V>(fqn, parent, data, cache) : new UnversionedNode<K, V>(childName, fqn, data, mapSafe, cache);
      // always assume that new nodes do not have data loaded
      un.setDataLoaded(false);
      NodeInvocationDelegate<K, V> nid = new NodeInvocationDelegate(un);

      // Too slow to have these autowired for now.  Look at manually wiring them.
      nid.initialize(configuration, invocationContextContainer, componentRegistry, interceptorChain);
      nid.injectDependencies(cache);
      un.injectDependencies(cache, commandsFactory, lockStrategyFactory);

//      componentRegistry.wireDependencies(nid);
//      componentRegistry.wireDependencies(un);
      // back ref
View Full Code Here

   /**
    * Constructs with a node and workspace.
    */
   public WorkspaceNodeImpl(NodeSPI<K, V> node, TransactionWorkspace workspace)
   {
      NodeInvocationDelegate delegate = (NodeInvocationDelegate) node;
      if (!(delegate.getDelegationTarget() instanceof VersionedNode))
      {
         throw new IllegalArgumentException("node " + delegate.getDelegationTarget() + " not VersionedNode");
      }
      this.node = node;
      this.workspace = workspace;
      Map<K, V> nodeData = node.getDataDirect();
      if (!nodeData.isEmpty()) optimisticDataMap = new HashMap<K, V>(nodeData);
View Full Code Here

   /**
    * Constructs with a node and workspace.
    */
   public WorkspaceNodeImpl(NodeSPI<K, V> node, TransactionWorkspace workspace)
   {
      NodeInvocationDelegate delegate = (NodeInvocationDelegate) node;
      if (!(delegate.getDelegationTarget() instanceof VersionedNode))
      {
         throw new IllegalArgumentException("node " + delegate.getDelegationTarget() + " not VersionedNode");
      }
      this.node = node;
      this.workspace = workspace;
      Map<K, V> nodeData = node.getDataDirect();
      if (!nodeData.isEmpty()) optimisticDataMap = new HashMap<K, V>(nodeData);
View Full Code Here

   public NodeSPI<K, V> createDataNode(Object childName, Fqn fqn, NodeSPI<K, V> parent, Map<K, V> data, boolean mapSafe)
   {
      UnversionedNode un = optimistic ? new VersionedNode<K, V>(fqn, parent, data, cache) : new UnversionedNode<K, V>(childName, fqn, data, mapSafe, cache);
      // always assume that new nodes do not have data loaded
      un.setDataLoaded(false);
      NodeInvocationDelegate<K, V> nid = new NodeInvocationDelegate(un);
      componentRegistry.wireDependencies(nid);
      componentRegistry.wireDependencies(un);
      // back ref
      un.setDelegate(nid);
      return nid;
View Full Code Here

TOP

Related Classes of org.jboss.cache.invocation.NodeInvocationDelegate

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.