Package com.sun.sgs.service

Examples of com.sun.sgs.service.Node


        nodeMappingService.assignNode(NodeMappingService.class, id);

        GetNodeTask task = new GetNodeTask(id);
        txnScheduler.runTask(task, taskOwner);;
        long firstNodeId = task.getNodeId();
        Node firstNode = task.getNode();
        TestListener firstNodeListener = nodeListenerMap.get(firstNodeId);
        TestRelocationListener idListener = moveMap.get(firstNodeId);

  firstNodeListener.waitForNotification();
View Full Code Here


        nodeMappingService.assignNode(NodeMappingService.class, id);

        GetNodeTask task = new GetNodeTask(id);
        txnScheduler.runTask(task, taskOwner);;
        long firstNodeId = task.getNodeId();
        Node firstNode = task.getNode();
        TestListener firstNodeListener = nodeListenerMap.get(firstNodeId);
        TestRelocationListener idListener = moveMap.get(firstNodeId);

  firstNodeListener.waitForNotification();
View Full Code Here

        nodeMappingService.assignNode(NodeMappingService.class, id);

        GetNodeTask task = new GetNodeTask(id);
        txnScheduler.runTask(task, taskOwner);;
        long firstNodeId = task.getNodeId();
        Node firstNode = task.getNode();
        TestRelocationListener idListener = moveMap.get(firstNodeId);

        NodeMappingServerImpl server =
            (NodeMappingServerImpl)serverImplField.get(nodeMappingService);
View Full Code Here

       
        Object oldServer = swapToEvilServer(nodeMappingService);
       
        txnScheduler.runTask(new TestAbstractKernelRunnable(){
                public void run() throws Exception {
                    Node node = nodeMappingService.getNode(id1);
        Set<Identity> foundSet = new HashSet<Identity>();
                    Iterator<Identity> idIter =
                        nodeMappingService.getIdentities(node.getId());  
                    while (idIter.hasNext()) {
                        foundSet.add(idIter.next());
        }
        assertTrue(foundSet.contains(id1));
                }
View Full Code Here

        }
       
        public Node get(Identity identity) throws UnknownIdentityException {
            assert identity != null;
            // Check the cache
            Node node = idcache.get(identity);
            if (node != null) {
                return node;
            }
           
      String key = NodeMapUtil.getIdentityKey(identity);
      try {               
    IdentityMO idmo =
        (IdentityMO) dataService.getServiceBinding(key);
                node = watchdogService.getNode(idmo.getNodeId());
                if (node == null) {
                    // The identity is on a failed node, where the node has
                    // been removed from the data store but the identity hasn't
                    // yet.
                    throw new UnknownIdentityException("id: " + identity);
                }
                Node old = idcache.put(identity, node);
                assert (old == null);
                return node;
      } catch (NameNotBoundException e) {
                throw new UnknownIdentityException("id: " + identity);
      } catch (ObjectNotFoundException e1) {
View Full Code Here

        callStarted();   
        try {
            if (identity == null) {
                throw new NullPointerException("null id");
            }
            Node node = null;   // old node assignment
            final String serviceName = service.getName();

            // Check to see if we already have an assignment.  If so, we just
            // need to update the status.  Otherwise, we need to make our
            // persistent updates and notify listeners.  
View Full Code Here

        if (moveTask == null) {
            // There's nothing to do.
            return;
        }
        Identity id = moveTask.id;
        final Node oldNode = moveTask.oldNode;
        final long newNodeId = moveTask.newNodeId;
        try {
            runTransactionally(moveTask);
            GetNodeTask atask = new GetNodeTask(newNodeId);
            runTransactionally(atask);
View Full Code Here

  /** {@inheritDoc} */
  public void run() {
      WatchdogService watchdogService =
    txnProxy.getService(WatchdogService.class);
      Node node = watchdogService.getNode(nodeId);
      isAlive = node != null && node.isAlive();
  }
View Full Code Here

    private Health getNodeHealthTransactional() {
  if (!isLocalAlive()) {
      return Health.RED;
  } else {
      Node node = NodeImpl.getNode(dataService, localNodeId);
            if (node == null || !node.isAlive()) {
                reportFailure(localNodeId, CLASSNAME);
                return Health.RED;
            } else {
                return node.getHealth();
            }
  }
    }
View Full Code Here

      for (int i = 0; i < ids.length; i++) {
    if (ids[i] == localNodeId && health[i].isAlive()) {
        /* Don't notify the local node that it is alive. */
        continue;
    }
    Node node =
                        new NodeImpl(ids[i], hosts[i], health[i], backups[i]);
    notifyNodeListeners(node);
    if (!health[i].isAlive() && backups[i] == localNodeId) {
        notifyRecoveryListeners(node);
    }
View Full Code Here

TOP

Related Classes of com.sun.sgs.service.Node

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.