org.axonframework.saga.annotation
Class SagaMethodMessageHandlerInspector<T extends AbstractAnnotatedSaga>

java.lang.Object
  extended by org.axonframework.saga.annotation.SagaMethodMessageHandlerInspector<T>
Type Parameters:
T - The type of saga targeted by this inspector

public class SagaMethodMessageHandlerInspector<T extends AbstractAnnotatedSaga>
extends Object

Utility class that inspects annotation on a Saga instance and returns the relevant configuration for its Event Handlers.

Since:
0.7
Author:
Allard Buijze

Constructor Summary
protected SagaMethodMessageHandlerInspector(Class<T> sagaType)
          Initialize the inspector to handle events for the given sagaType.
 
Method Summary
static
<T extends AbstractAnnotatedSaga>
SagaMethodMessageHandlerInspector<T>
getInstance(Class<T> sagaType)
          Returns a SagaMethodMessageHandlerInspector for the given sagaType.
 SagaMethodMessageHandler getMessageHandler(EventMessage event)
          Find the configuration for the handler on the given sagaType for the given event.
 Class<T> getSagaType()
          Returns the type of saga this inspector handles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SagaMethodMessageHandlerInspector

protected SagaMethodMessageHandlerInspector(Class<T> sagaType)
Initialize the inspector to handle events for the given sagaType.

Parameters:
sagaType - The type of saga this inspector handles
Method Detail

getInstance

public static <T extends AbstractAnnotatedSaga> SagaMethodMessageHandlerInspector<T> getInstance(Class<T> sagaType)
Returns a SagaMethodMessageHandlerInspector for the given sagaType. The inspector provides information about @SagaEventHandler annotated handler methods.

Type Parameters:
T - The type of Saga to get the inspector for
Parameters:
sagaType - The type of Saga to get the inspector for
Returns:
The inspector for the given saga type

getMessageHandler

public SagaMethodMessageHandler getMessageHandler(EventMessage event)
Find the configuration for the handler on the given sagaType for the given event. If no suitable handler is found, the NoOpHandler is returned, that does nothing when invoked.

Parameters:
event - The Event to investigate the handler for
Returns:
the configuration of the handler, as defined by the annotations.

getSagaType

public Class<T> getSagaType()
Returns the type of saga this inspector handles.

Returns:
the type of saga (Class) this inspector handles


Copyright © 2010-2012. All Rights Reserved.