Package com.sun.sgs.auth

Examples of com.sun.sgs.auth.Identity


                    // Find an identity on the node
                    runTransactionally(task);
               
                    // Move it, removing old mapping
                    if (!task.done()) {
                        Identity id = task.getId().getIdentity();
                        try {
                            // If we're already trying to move the identity,
                            // but the old node failed before preparations are
                            // complete, just make the move now.
                            MoveIdTask moveTask = moveMap.remove(id);
View Full Code Here


    public void testMyAccessCoordinator() throws Exception {
  properties.setProperty(ACCESS_COORDINATOR_PROPERTY,
             MyAccessCoordinator.class.getName());
  SgsTestNode node = new SgsTestNode(
      "TestKernelSetAccessCoordinator", null, properties);
        Identity taskOwner = node.getProxy().getCurrentOwner();
        TransactionScheduler txnScheduler =
      node.getSystemRegistry().getComponent(TransactionScheduler.class);
  final DataService dataService = node.getDataService();
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
View Full Code Here

        if (shuttingDown()) {
            throw new IllegalStateException("Service is shutdown");
        }

        // persist the task regardless of where it will ultimately run
        Identity owner = getTaskOwner(task);
        TaskRunner runner = getRunner(task, owner, appStartTime, PERIOD_NONE);

        // check where the owner is active to get the task running
        if (!isMappedLocally(owner)) {
            if (handoffTask(generateObjName(owner, runner.getObjId()), owner)) {
View Full Code Here

            logger.log(Level.FINEST, "scheduling a periodic task starting " +
                       "at {0}", appStartTime);
        }

        // persist the task regardless of where it will ultimately run
        Identity owner = getTaskOwner(task);
        TaskRunner runner = getRunner(task, owner, appStartTime, period);
        BigInteger objId = runner.getObjId();

        // check where the owner is active to get the task running
        if (!isMappedLocally(owner)) {
View Full Code Here

        if (shuttingDown()) {
            throw new IllegalStateException("Service is shutdown");
        }
        serviceStats.scheduleNDTaskOp.report();

        Identity owner = getTaskOwner(task);
        scheduleTask(new NonDurableTask(task, owner, transactional), owner,
                     START_NOW, false);
    }
View Full Code Here

        if (shuttingDown()) {
            throw new IllegalStateException("Service is shutdown");
        }
        serviceStats.scheduleNDTaskDelayedOp.report();

        Identity owner = getTaskOwner(task);
        scheduleTask(new NonDurableTask(task, owner, transactional), owner,
                     watchdogService.currentAppTimeMillis() + delay, false);
    }
View Full Code Here

            return;
        }

        // check that the task is supposed to run here, or if not, that
        // we were able to hand it off
        Identity identity = ptask.getIdentity();
        if (!isMappedLocally(identity)) {
            // if we handed off the task, we're done
            if (handoffTask(objName, identity)) {
                return;
            }
View Full Code Here

        for (AffinityGroup group : sample1) {
            ArrayList<Identity> groupList =
                    new ArrayList<Identity>(group.getIdentities());
            int size = groupList.size();
            for (int i = 0; i < size - 1; i++) {
                Identity v1 = groupList.get(i);
                for (int j = i + 1; j < size; j++) {
                    Identity v2 = groupList.get(j);
                    // v1 and v2 are in the same group in sample1.  Are they
                    // in the same group in sample2?
                    if (inSameGroup(v1, v2, sample2)) {
                        a++;
                    } else {
                        b++;
                    }
                }
            }
        }

        for (AffinityGroup group : sample2) {
            ArrayList<Identity> groupList =
                    new ArrayList<Identity>(group.getIdentities());
            int size = groupList.size();
            for (int i = 0; i < size - 1; i++) {
                Identity v1 = groupList.get(i);
                for (int j = i + 1; j < size; j++) {
                    Identity v2 = groupList.get(j);
                    // v1 and v2 are in the same group in sample2.  Count those
                    // that are not in the same group in sample1.
                    if (!inSameGroup(v1, v2, sample1)) {
                        c++;
                    }
View Full Code Here

    public void run() {
        AssertionError error = null;
        ProfileReport report = SimpleTestListener.report;
        // Check to see if we expected the sample values to be
        // updated in this report.
        Identity owner = report.getTaskOwner();
        boolean update = owner.equals(positiveOwner);
        if (!update && !owner.equals(negativeOwner)) {
            return;
        }
        List<Long> values = report.getUpdatedTaskSamples().get(name);
        try {
            if (update) {
View Full Code Here

  props.setProperty("com.sun.sgs.txn.timeout", "10000");
  serverNode = new SgsTestNode("TestDataServicePerformance", null, props);
  final DataService service = serverNode.getDataService();
        TransactionScheduler txnScheduler = serverNode.getSystemRegistry().
            getComponent(TransactionScheduler.class);
        Identity taskOwner = serverNode.getProxy().getCurrentOwner();
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() {
                    service.setBinding("counters", new Counters(items));
                }}, taskOwner);
        for (int r = 0; r < repeat; r++) {
View Full Code Here

TOP

Related Classes of com.sun.sgs.auth.Identity

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.