Package com.sun.sgs.auth

Examples of com.sun.sgs.auth.Identity


      for (int i = 0; i < iterations; i++) {
    for (SgsTestNode node : nodes) {
        TransactionScheduler localTxnScheduler =
      node.getSystemRegistry().
          getComponent(TransactionScheduler.class);
        Identity identity = node.getProxy().getCurrentOwner();
        localTxnScheduler.scheduleTask(
            new TestAbstractKernelRunnable() {
          public void run() {
        DataManager dataManager =
            AppContext.getDataManager();
View Full Code Here


            // The server node that reported the remote
            // failure should be unaffected
            TransactionScheduler sched = server.getSystemRegistry().
                    getComponent(TransactionScheduler.class);
            Identity own = server.getProxy().getCurrentOwner();
            sched.runTask(new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    assertTrue(server.getWatchdogService().isLocalNodeAlive());
                }
            }, own);
View Full Code Here

            NodeMappingServerImpl nodeMappingServer =
                    (NodeMappingServerImpl) mapServer.get(nodeMappingService);
           
            // Create a new identity and assign it to a node
            // Since there is only 1 app node, it will be assigned to that one
            final Identity id = new IdentityImpl(appName + "_identity");
            nodeMappingService.assignNode(NodeMappingService.class, id);
            System.err.println("AppNode id: "+appNode.getNodeId());

            txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() throws Exception {
View Full Code Here

    @Test
    public void testRunImmediateTasks() throws Exception {
        // test with application identity
        runImmediateTest(taskOwner);
        // test with un-mapped identity
        Identity newOwner = new IdentityImpl("id");
        runImmediateTest(newOwner);
        // test with mapped identity
        mappingService.assignNode(TestTaskServiceImpl.class,
                                  newOwner);
        runImmediateTest(newOwner);
View Full Code Here

    @Test
    public void testRunPendingTasks() throws Exception {
        // test with application identity
        runPendingTest(taskOwner);
        // test with un-mapped identity
        Identity newOwner = new IdentityImpl("id");
        runPendingTest(newOwner);
        // test with mapped identity
        mappingService.assignNode(TestTaskServiceImpl.class, newOwner);
        runPendingTest(newOwner);
    }
View Full Code Here

    @Test
    public void testRunPeriodicTasks() throws Exception {
        // test with application identity
        runPeriodicTest(taskOwner);
        // test with un-mapped identity
        Identity newOwner = new IdentityImpl("id");
        runPeriodicTest(newOwner);
        // test with mapped identity
        mappingService.assignNode(TestTaskServiceImpl.class, newOwner);
        runPeriodicTest(newOwner);
    }
View Full Code Here

    @Test
    public void testRunNonDurableWithNewIdentity() throws Exception {
        final CountDownLatch latch = new CountDownLatch(1);
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    Identity owner = txnProxy.getCurrentOwner();
                    KernelRunnable r =
                        new NewIdentityKernelRunnable(owner, latch);
                    taskService.scheduleNonDurableTask(r, true);
                }
            }, taskOwner);
View Full Code Here

    @Test
    public void testRunDelayedNonDurableWithNewIdentity() throws Exception {
        final CountDownLatch latch = new CountDownLatch(1);
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    Identity owner = txnProxy.getCurrentOwner();
                    KernelRunnable r =
                        new NewIdentityKernelRunnable(owner, latch);
                    taskService.scheduleNonDurableTask(r, 50L, true);
                }
            }, taskOwner);
View Full Code Here

        // Use an exchanger to synchronize between the threads and communicate
        // any problems.
        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        final Identity positiveOwner = new DummyIdentity("never-used");
        final Identity negativeOwner = new DummyIdentity("neg-owner");
        SimpleTestListener test = new SimpleTestListener(
            new CounterReportRunnable(name, negativeOwner, positiveOwner,
                                      errorExchanger, 1));
        profileCollector.addListener(test, true);
View Full Code Here

        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        // Set up a couple of test listeners, each listening for a different
        // task owner
        final Identity positiveOwner = new DummyIdentity("hello");
        final Identity negativeOwner = new DummyIdentity("neg-hello");
        SimpleTestListener test = new SimpleTestListener(
            new CounterReportRunnable(counter.getName(),
                                      negativeOwner, positiveOwner,
                                      errorExchanger, 1));
        profileCollector.addListener(test, true);
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.