Examples of addJob()


Examples of org.apache.sling.event.jobs.JobManager.addJob()

        final JobManager jobManager = this.getJobManager();
        try {
            jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"1"));
            jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"2"));
            jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"3"));
            jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"4"));
            jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"5"));

            int count = 0;
            final long startTime = System.currentTimeMillis();
            do {
View Full Code Here

Examples of org.apache.sling.event.jobs.JobManager.addJob()

        try {
            jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"1"));
            jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"2"));
            jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"3"));
            jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"4"));
            jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"5"));

            int count = 0;
            final long startTime = System.currentTimeMillis();
            do {
                count = finished.size() + cancelled.size();
View Full Code Here

Examples of org.apache.sling.event.jobs.JobManager.addJob()

            // we start 20 jobs, every second job has no processor
            final int COUNT = 20;
            for(int i = 0; i < COUNT; i++ ) {
                final String jobTopic = (i % 2 == 0 ? TOPIC : TOPIC + "2");

                jobManager.addJob(jobTopic, null);
            }
            while ( count.get() < COUNT / 2) {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException ie) {
View Full Code Here

Examples of org.apache.sling.event.jobs.JobManager.addJob()

            props.put("int", new Integer(5));
            props.put("long", new Long(7));
            props.put("list", list);
            props.put("map", map);

            final String jobId = jobManager.addJob(TOPIC, props).getId();

            new RetryLoop(Conditions.collectionIsNotEmptyCondition(finishedEvents,
                    "Waiting for finishedEvents to have at least one element"), 5, 50);

            // no jobs queued, none processed and no available
View Full Code Here

Examples of org.apache.sling.event.jobs.JobManager.addJob()

            // we start a single job
            final Map<String, Object> props = new HashMap<String, Object>();
            props.put("dao", dao);

            final String id = jobManager.addJob(TOPIC + "/failed", props).getId();

            // wait until the conditions are met
            new RetryLoop(new RetryLoop.Condition() {

                @Override
View Full Code Here

Examples of org.apache.sling.event.jobs.JobManager.addJob()

        try {
            // we first sent one event to get the queue started
            final Map<String, Object> properties = new HashMap<String, Object>();
            properties.put("counter", -1);
            jobManager.addJob("sling/orderedtest/start", properties);
            assertTrue("No event received in the given time.", cb.block(5));
            cb.reset();

            // get the queue
            final Queue q = jobManager.getQueue("orderedtest");
View Full Code Here

Examples of org.apache.sling.event.jobs.JobManager.addJob()

            // we start "some" jobs:
            for(int i = 0; i < NUM_JOBS; i++ ) {
                final String subTopic = "sling/orderedtest/sub" + (i % 10);
                properties.clear();
                properties.put("counter", i);
                jobManager.addJob(subTopic, properties);
            }
            // start the queue
            q.resume();
            while ( count.get() < NUM_JOBS +1 ) {
                try {
View Full Code Here

Examples of org.apache.sling.event.jobs.JobManager.addJob()

                    }
                });

        try {
            // we first sent one event to get the queue started
            jobManager.addJob(TOPIC + "/start", null);
            assertTrue("No event received in the given time.", cb.block(5));
            cb.reset();

            // get the queue
            final Queue q = jobManager.getQueue(QUEUE_NAME);
View Full Code Here

Examples of org.apache.sling.event.jobs.JobManager.addJob()

            // we start "some" jobs:
            // first jobs without id
            for(int i = 0; i < NUM_JOBS; i++ ) {
                final String subTopic = TOPIC + "/sub" + (i % 10);
                jobManager.addJob(subTopic, null);
            }
            // second jobs with id
            for(int i = 0; i < NUM_JOBS; i++ ) {
                final String subTopic = TOPIC + "/sub" + (i % 10);
                jobManager.addJob(subTopic, "id" + i, null);
View Full Code Here

Examples of org.quartz.Scheduler.addJob()

                JobDetail job = JobBuilder.newJob(EjbTimeoutJob.class)
                        .withIdentity(OPENEJB_TIMEOUT_JOB_NAME, OPENEJB_TIMEOUT_JOB_GROUP_NAME)
                        .storeDurably(true)
                        .requestRecovery(false)
                        .build();
                scheduler.addJob(job, true);
            } catch (SchedulerException e) {
                throw new OpenEJBRuntimeException("Fail to initialize the default scheduler", e);
            }
            SystemInstance.get().setComponent(Scheduler.class, scheduler);
        }
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.