Examples of workCompleted()


Examples of commonj.work.WorkListener.workCompleted()

        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_COMPLETED);
            workItem.setResult(work);
            workItem.setException(exception);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workCompleted(event);
            workItems.remove(workItem);
        }
    }

    /*
 
View Full Code Here

Examples of commonj.work.WorkListener.workCompleted()

        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_COMPLETED);
            workItem.setResult(work);
            workItem.setException(exception);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workCompleted(event);
            workItems.remove(workItem);
        }
    }

    /*
 
View Full Code Here

Examples of commonj.work.WorkListener.workCompleted()

        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_COMPLETED);
            workItem.setResult(work);
            workItem.setException(exception);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workCompleted(event);
            workItems.remove(workItem);
        }
    }

    /*
 
View Full Code Here

Examples of commonj.work.WorkListener.workCompleted()

        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_COMPLETED);
            workItem.setResult(work);
            workItem.setException(exception);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workCompleted(event);
            workItems.remove(workItem);
        }
    }

    /*
 
View Full Code Here

Examples of commonj.work.WorkListener.workCompleted()

        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_COMPLETED);
            workItem.setResult(work);
            workItem.setException(exception);
            WorkEvent event = new DefaultWorkEvent(workItem);
            listener.workCompleted(event);
            workItems.remove(workItem);
        }
    }

    /*
 
View Full Code Here

Examples of commonj.work.WorkListener.workCompleted()

    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);
        work.run();
        expectLastCall().andStubAnswer(new IAnswer<Object>() {
View Full Code Here

Examples of commonj.work.WorkListener.workCompleted()

        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();
                return null;
            }
View Full Code Here

Examples of commonj.work.WorkListener.workCompleted()

    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();
        expectLastCall().andStubAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
View Full Code Here

Examples of org.hibernate.search.exception.impl.ErrorContextBuilder.workCompleted()

      // (this thread waits even in async backend mode)
      for ( int i = 0; i < queueSize; i++ ) {
        Future task = submittedTasks[i];
        try {
          task.get();
          errorContextBuilder.workCompleted( queue.get( i ) );
        }
        catch (ExecutionException e) {
          if ( failedUpdates == null ) {
            failedUpdates = new LinkedList<LuceneWork>();
          }
View Full Code Here

Examples of org.hibernate.search.exception.impl.ErrorContextBuilder.workCompleted()

      LinkedList<LuceneWork> failedUpdates = new LinkedList<LuceneWork>();
      for ( int i = 0; i < queueSize; i++ ) {
        Future task = submittedTasks[i];
        try {
          task.get();
          errorContextBuilder.workCompleted( queue.get( i ) );
        }
        catch (ExecutionException e) {
          someFailureHappened = true;
          failedUpdates.add( queue.get( i ) );
          errorContextBuilder.errorThatOccurred( e.getCause() );
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.