Examples of handle()


Examples of org.atomojo.app.client.FeedClient.handle()

                        Representation rep = getResponse.getEntity();
                        if (contentType!=null) {
                           rep.setMediaType(contentType);
                        }
                        putRequest.setEntity(rep);
                        Response putResponse = targetClient.handle(putRequest);
                        if (!putResponse.getStatus().isSuccess()) {
                           log.severe("Cannot put media update to "+targetLocation+", status="+putResponse.getStatus().getCode());
                        }
                     } else {
                        if (!getResponse.getStatus().isSuccess()) {
View Full Code Here

Examples of org.atomojo.app.client.IntrospectionClient.handle()

                                    request.getCookies().add(cookie);
                                 } else {
                                    request.setChallengeResponse(new ChallengeResponse(ChallengeScheme.HTTP_BASIC,auth.getName(),auth.getPassword()));
                                 }
                              }
                              Response response = client.handle(request);
                              if (!response.getStatus().isSuccess()) {
                                 log.log(Level.SEVERE,"Failed to retrieve media, status="+response.getStatus().getCode()+", src="+srcRef);
                                 errorCount++;
                                 return;
                              }
View Full Code Here

Examples of org.axonframework.commandhandling.CommandDispatchInterceptor.handle()

    @SuppressWarnings("unchecked")
    @Test
    public void testCallbackInvokedBeforeUnitOfWorkCleanup() throws Throwable {
        CommandHandlerInterceptor mockHandlerInterceptor = mock(CommandHandlerInterceptor.class);
        CommandDispatchInterceptor mockDispatchInterceptor = mock(CommandDispatchInterceptor.class);
        when(mockDispatchInterceptor.handle(isA(CommandMessage.class))).thenAnswer(new Parameter(0));
        ExecutorService customExecutor = Executors.newCachedThreadPool();
        testSubject = new DisruptorCommandBus(
                inMemoryEventStore, eventBus,
                new DisruptorConfiguration().setInvokerInterceptors(Arrays.asList(mockHandlerInterceptor))
                                            .setDispatchInterceptors(Arrays.asList(mockDispatchInterceptor))
View Full Code Here

Examples of org.axonframework.commandhandling.CommandHandlerInterceptor.handle()

        stubHandler.setRepository(testSubject
                                          .createRepository(new GenericAggregateFactory<StubAggregate>(StubAggregate.class)));
        final UnitOfWorkListener mockUnitOfWorkListener = mock(UnitOfWorkListener.class);
        when(mockUnitOfWorkListener.onEventRegistered(isA(UnitOfWork.class), any(EventMessage.class)))
                .thenAnswer(new ReturnsArgumentAt(1));
        when(mockHandlerInterceptor.handle(any(CommandMessage.class),
                                           any(UnitOfWork.class),
                                           any(InterceptorChain.class)))
                .thenAnswer(new Answer<Object>() {
                    @Override
                    public Object answer(InvocationOnMock invocation) throws Throwable {
View Full Code Here

Examples of org.axonframework.eventhandling.EventListener.handle()

        assertTrue(postProcessedBean instanceof SyncEventListener);

        EventListener eventListener = (EventListener) postProcessedBean;
        SyncEventListener annotatedEventListener = (SyncEventListener) postProcessedBean;
        StubDomainEvent domainEvent = new StubDomainEvent();
        eventListener.handle(new GenericEventMessage<StubDomainEvent>(domainEvent));

        assertEquals(1, annotatedEventListener.getInvocationCount());
    }

    @Test
View Full Code Here

Examples of org.axonframework.saga.Saga.handle()

        for (Saga saga : processedSagas.values()) {
            if (sagaType.isInstance(saga) && saga.isActive()
                    && containsAny(saga.getAssociationValues(), entry.getAssociationValues())) {
                try {
                    ensureActiveUnitOfWork();
                    saga.handle(entry.getPublishedEvent());
                } catch (Exception e) {
                    logger.error("Saga threw an exception while handling an Event. Ignoring and moving on...", e);
                }
                sagaInvoked = true;
            }
View Full Code Here

Examples of org.axonframework.saga.SagaManager.handle()

        final GenericDomainEventMessage<SimpleEvent> event = new GenericDomainEventMessage<SimpleEvent>(identifier,
                                                                                                        (long) 0,
                                                                                                        new SimpleEvent(
                                                                                                                identifier),
                                                                                                        MetaData.emptyInstance());
        sagaManager.handle(event);

        verify(correlationDataProvider, times(2)).correlationDataFor(event);
        verify(sagaFactory).createSaga(StubSaga.class);
    }
View Full Code Here

Examples of org.axonframework.saga.annotation.AsyncAnnotatedSagaManager.handle()

        final GenericDomainEventMessage<SimpleEvent> event = new GenericDomainEventMessage<SimpleEvent>(identifier,
                                                                                                        (long) 0,
                                                                                                        new SimpleEvent(
                                                                                                                identifier),
                                                                                                        MetaData.emptyInstance());
        sagaManager.handle(event);
        sagaManager.unsubscribe();
        verify(sagaFactory).createSaga(eq(StubSaga.class));
        sagaManager.stop();

        verify(correlationDataProvider).correlationDataFor(event);
View Full Code Here

Examples of org.axonframework.test.utils.CallbackBehavior.handle()

    public void testFixtureApi_WhenTimeElapses_UsingCallbackBehavior() throws Throwable {
        UUID identifier = UUID.randomUUID();
        UUID identifier2 = UUID.randomUUID();
        AnnotatedSagaTestFixture fixture = new AnnotatedSagaTestFixture(StubSaga.class);
        CallbackBehavior commandHandler = mock(CallbackBehavior.class);
        when(commandHandler.handle(eq("Say hi!"), isA(MetaData.class))).thenReturn("Hi again!");
        fixture.setCallbackBehavior(commandHandler);
        fixture.registerCommandGateway(StubGateway.class);

        fixture.givenAggregate(identifier).published(new TriggerSagaStartEvent(identifier.toString()))
               .andThenAggregate(identifier2).published(new TriggerExistingSagaEvent(identifier2.toString()))
View Full Code Here

Examples of org.chromium.sdk.internal.v8native.protocol.input.data.SomeHandle.handle()

  public static ScriptHandle validScript(ScriptHandle script, List<SomeHandle> refs,
      V8ContextFilter contextFilter) {
    Long contextRef = V8ProtocolUtil.getObjectRef(script.context());
    for (int i = 0, size = refs.size(); i < size; i++) {
      SomeHandle ref = refs.get(i);
      if (ref.handle() != contextRef.longValue()) {
        continue;
      }
      ContextHandle contextHandle;
      try {
        contextHandle = ref.asContextHandle();
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.