Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (c) 2010-2011. Axon Framework
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.axonframework.commandhandling;
Workflow interface that allows for customized command handler invocation chains. A CommandHandlerInterceptor can add customized behavior to command handler invocations, both before and after the invocation.

Allard Buijze
public interface CommandHandlerInterceptor {

The handle method is invoked each time a command is dispatched through the command bus that the CommandHandlerInterceptor is declared on. The incoming command and contextual information can be found in the given unitOfWork.

The interceptor is responsible for the continuation of the dispatch process by invoking the InterceptorChain.proceed(java.lang.Object) method on the given interceptorChain.

Any information gathered by interceptors may be attached to the unitOfWork. This information is made available to the CommandCallback provided by the dispatching component.

Interceptors are highly recommended not to change the type of the command handling result, as the dispatching component might expect a result of a specific type.

command The command being dispatched
unitOfWork The UnitOfWork in which
interceptorChain The interceptor chain that allows this interceptor to proceed the dispatch process
the result of the command handler. May have been modified by interceptors.
java.lang.Throwable any exception that occurs while handling the command
    Object handle(Object commandUnitOfWork unitOfWorkInterceptorChain interceptorChainthrows Throwable;
New to GrepCode? Check out our FAQ X