Examples of workAccepted()


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

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

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

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

Examples of commonj.work.WorkListener.workAccepted()

    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

Examples of commonj.work.WorkListener.workAccepted()

    }

    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

Examples of commonj.work.WorkListener.workAccepted()

    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

Examples of commonj.work.WorkListener.workAccepted()

    }

    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

Examples of javax.resource.spi.work.WorkListener.workAccepted()

      WorkException wex = new WorkException("TaskExecutor failed to execute Work: " + work, ex);
      wex.setErrorCode(WorkException.INTERNAL);
      throw wex;
    }
    if (isAsync) {
      workListenerToUse.workAccepted(new WorkEvent(this, WorkEvent.WORK_ACCEPTED, work, null));
    }

    if (blockUntilStarted) {
      long acceptanceTime = System.currentTimeMillis();
      synchronized (workHandle.monitor) {
View Full Code Here

Examples of javax.resource.spi.work.WorkListener.workAccepted()

      WorkException wex = new WorkException("TaskExecutor failed to execute Work: " + work, ex);
      wex.setErrorCode(WorkException.INTERNAL);
      throw wex;
    }
    if (isAsync) {
      workListenerToUse.workAccepted(new WorkEvent(this, WorkEvent.WORK_ACCEPTED, work, null));
    }

    if (blockUntilStarted) {
      long acceptanceTime = System.currentTimeMillis();
      synchronized (workHandle.monitor) {
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.