Examples of block()


Examples of org.apache.sling.event.impl.Barrier.block()

                    }
                });
        try {
            final JobManager jobManager = this.getJobManager();
            jobManager.addJob(TOPIC, "myid1", null);
            assertTrue("No event received in the given time.", cb.block(5));
            cb.reset();
            assertFalse("Unexpected event received in the given time.", cb.block(5));
        } finally {
            jcReg.unregister();
        }
View Full Code Here

Examples of org.apache.sling.event.impl.Barrier.block()

        try {
            final JobManager jobManager = this.getJobManager();
            jobManager.addJob(TOPIC, "myid1", null);
            assertTrue("No event received in the given time.", cb.block(5));
            cb.reset();
            assertFalse("Unexpected event received in the given time.", cb.block(5));
        } finally {
            jcReg.unregister();
        }
    }
View Full Code Here

Examples of org.apache.sling.event.impl.Barrier.block()

        final ServiceRegistration jcReg = this.registerJobConsumer(TOPIC,
                new JobConsumer() {

                    @Override
                    public JobResult process(Job job) {
                        cb.block();
                        sleep(1000);
                        return JobResult.FAILED;
                    }
                });
        try {
View Full Code Here

Examples of org.apache.sling.event.impl.Barrier.block()

                    }
                });
        try {
            final JobManager jobManager = this.getJobManager();
            jobManager.addJob(TOPIC, "myid3", null);
            cb.block();

            assertEquals(1, jobManager.findJobs(JobManager.QueryType.ALL, "sling/test", -1, (Map<String, Object>[])null).size());
            // job is currently sleeping, but force cancel always waits!
            final Event e = jobManager.findJob("sling/test", Collections.singletonMap(JobUtil.PROPERTY_JOB_NAME, (Object)"myid3"));
            assertNotNull(e);
View Full Code Here

Examples of org.apache.sling.event.impl.Barrier.block()

        final ServiceRegistration reg = this.registerJobConsumer(TOPIC,
                new JobConsumer() {

            @Override
                    public JobResult process(final Job job) {
                        cb.block();
                        return JobResult.OK;
                    }
                 });

        try {
View Full Code Here

Examples of org.apache.sling.event.impl.Barrier.block()

                    }
                 });

        try {
            this.getJobManager().addJob(TOPIC, null);
            assertTrue("No event received in the given time.", cb.block(5));
            cb.reset();
            assertFalse("Unexpected event received in the given time.", cb.block(5));
        } finally {
            reg.unregister();
        }
View Full Code Here

Examples of org.apache.sling.event.impl.Barrier.block()

        try {
            this.getJobManager().addJob(TOPIC, null);
            assertTrue("No event received in the given time.", cb.block(5));
            cb.reset();
            assertFalse("Unexpected event received in the given time.", cb.block(5));
        } finally {
            reg.unregister();
        }
    }
View Full Code Here

Examples of org.apache.sling.event.impl.Barrier.block()

        final ServiceRegistration reg = this.registerJobExecutor(TOPIC,
                new JobExecutor() {

                    @Override
                    public JobExecutionResult process(final Job job, final JobExecutionContext context) {
                        cb.block();
                        return context.result().succeeded();
                    }
                });

        try {
View Full Code Here

Examples of org.apache.sling.event.impl.Barrier.block()

                    }
                });

        try {
            this.getJobManager().addJob(TOPIC, null);
            assertTrue("No event received in the given time.", cb.block(5));
            cb.reset();
            assertFalse("Unexpected event received in the given time.", cb.block(5));
        } finally {
            reg.unregister();
        }
View Full Code Here

Examples of org.apache.sling.event.impl.Barrier.block()

        try {
            this.getJobManager().addJob(TOPIC, null);
            assertTrue("No event received in the given time.", cb.block(5));
            cb.reset();
            assertFalse("Unexpected event received in the given time.", cb.block(5));
        } finally {
            reg.unregister();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.