Package commonj.work

Examples of commonj.work.WorkListener.workAccepted()


    private void workAccepted(final WorkItemImpl workItem, final Work work) {
        WorkListener listener = workItems.get(workItem);
        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_ACCEPTED);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workAccepted(event);
        }
    }

    /*
     * Method to indicate a work start.
View Full Code Here


    private void workAccepted(final WorkItemImpl workItem, final Work work) {
        WorkListener listener = workItems.get(workItem);
        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_ACCEPTED);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workAccepted(event);
        }
    }

    /*
     * Method to indicate a work start.
View Full Code Here

    private void workAccepted(final WorkItemImpl workItem, final Work work) {
        WorkListener listener = workItems.get(workItem);
        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_ACCEPTED);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workAccepted(event);
        }
    }

    /*
     * Method to indicate a work start.
View Full Code Here

    private void workAccepted(final WorkItemImpl workItem, final Work work) {
        WorkListener listener = workItems.get(workItem);
        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_ACCEPTED);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workAccepted(event);
        }
    }

    /*
     * Method to indicate a work start.
View Full Code Here

    private void workAccepted(final DefaultWorkItem workItem, final Work work) {
        WorkListener listener = workItems.get(workItem);
        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_ACCEPTED);
            WorkEvent event = new DefaultWorkEvent(workItem);
            listener.workAccepted(event);
        }
    }

    /*
     * Method to indicate a work start.
View Full Code Here

    }

    public void testListener() throws Exception {
        final CountDownLatch latch = new CountDownLatch(1);
        WorkListener listener = createStrictMock(WorkListener.class);
        listener.workAccepted(isA(WorkEvent.class));
        listener.workStarted(isA(WorkEvent.class));
        listener.workCompleted(isA(WorkEvent.class));
        expectLastCall();
        replay(listener);
        Work work = createMock(Work.class);
View Full Code Here

    public void testDelayListener() throws Exception {
        final CountDownLatch latch = new CountDownLatch(1);
        final CountDownLatch latch2 = new CountDownLatch(1);
        WorkListener listener = createStrictMock(WorkListener.class);
        listener.workAccepted(isA(WorkEvent.class));
        listener.workStarted(isA(WorkEvent.class));
        listener.workCompleted(isA(WorkEvent.class));
        expectLastCall().andStubAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                latch2.countDown();
View Full Code Here

    }

    public void testErrorListener() throws Exception {
        final CountDownLatch latch = new CountDownLatch(1);
        WorkListener listener = createStrictMock(WorkListener.class);
        listener.workAccepted(isA(WorkEvent.class));
        listener.workStarted(isA(WorkEvent.class));
        listener.workCompleted(isA(WorkEvent.class));
        replay(listener);
        Work work = createMock(Work.class);
        work.run();
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.