com.google.code.rees.scope.conversation.configuration
Class DefaultConversationArbitrator

java.lang.Object
  extended by com.google.code.rees.scope.conversation.configuration.DefaultConversationArbitrator
All Implemented Interfaces:
ConversationArbitrator, Serializable
Direct Known Subclasses:
SpringConversationArbitrator, StrutsConversationArbitrator

public class DefaultConversationArbitrator
extends Object
implements ConversationArbitrator

The default implementation of ConversationArbitrator

Author:
rees.byars
See Also:
Serialized Form

Field Summary
protected  String actionSuffix
           
 
Constructor Summary
DefaultConversationArbitrator()
           
 
Method Summary
 Collection<String> getBeginConversations(Class<?> clazz, Method method)
          returns a collection of conversation names for the method as a begin point
 Collection<Field> getCandidateConversationFields(Class<?> clazz)
          Returns a collection of candidate conversation fields from a class.
 Collection<Method> getCandidateConversationMethods(Class<?> clazz)
          Returns a collection of candidate conversation action methods from a class.
protected  Set<Class<?>> getConversationControllers(Class<?> clazz)
           
 Collection<String> getConversations(Class<?> clazz)
           
 Collection<String> getConversations(Class<?> clazz, Field field)
          Returns a collection of conversation names for the field
 Collection<String> getConversations(Class<?> clazz, Method method)
          returns a collection of conversation names for the method as an intermediate point
 Collection<String> getConversations(Class<?> clazz, Method method, String actionSuffix)
           
 Collection<String> getConversations(Class<?> clazz, String actionSuffix)
           
protected  String[] getConversationsWithInheritance(Class<?> clazz, String actionSuffix)
           
protected  String[] getConversationsWithoutInheritance(Class<?> clazz, String actionSuffix)
           
 Collection<String> getEndConversations(Class<?> clazz, Method method)
          returns a collection of conversation names for the method as an end point
 String getName(Field field)
          returns the name to be used for the field as a key in the conversation context
 String getName(Method method)
          returns the name to be used as an actionId
protected  boolean isAction(Method method)
           
protected  boolean isConversationController(Class<?> clazz)
           
 void setActionSuffix(String suffix)
          The default suffix is "Controller".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actionSuffix

protected String actionSuffix
Constructor Detail

DefaultConversationArbitrator

public DefaultConversationArbitrator()
Method Detail

setActionSuffix

public void setActionSuffix(String suffix)
The default suffix is "Controller". So the conversation for a class named MyExampleFlowController would be my-example-flow. Use this setter to use a different suffix.

Specified by:
setActionSuffix in interface ConversationArbitrator

getCandidateConversationFields

public Collection<Field> getCandidateConversationFields(Class<?> clazz)
Returns a collection of candidate conversation fields from a class. Subsequent calls are made to the ConversationArbitrator.getConversations(Class, Field) to determine which, if any, conversations the field should be included with

Specified by:
getCandidateConversationFields in interface ConversationArbitrator
Returns:

getCandidateConversationMethods

public Collection<Method> getCandidateConversationMethods(Class<?> clazz)
Returns a collection of candidate conversation action methods from a class. Subsequent calls are made to the ConversationArbitrator.getConversations(Class, Method) to determine which, if any, conversations the method should be included with

Specified by:
getCandidateConversationMethods in interface ConversationArbitrator
Returns:

getConversations

public Collection<String> getConversations(Class<?> clazz,
                                           Field field)
Returns a collection of conversation names for the field

Specified by:
getConversations in interface ConversationArbitrator
Returns:

getConversations

public Collection<String> getConversations(Class<?> clazz,
                                           Method method)
returns a collection of conversation names for the method as an intermediate point

Specified by:
getConversations in interface ConversationArbitrator
Returns:
See Also:
com.google.code.rees.scope.conversation.annotations.ConversationAction ConversationAction}

getName

public String getName(Field field)
returns the name to be used for the field as a key in the conversation context

Specified by:
getName in interface ConversationArbitrator
Returns:

getName

public String getName(Method method)
returns the name to be used as an actionId

Specified by:
getName in interface ConversationArbitrator
Returns:
See Also:
ConversationAdapter#getActionId()}

getBeginConversations

public Collection<String> getBeginConversations(Class<?> clazz,
                                                Method method)
returns a collection of conversation names for the method as a begin point

Specified by:
getBeginConversations in interface ConversationArbitrator
Returns:
See Also:
com.google.code.rees.scope.conversation.annotations.BeginConversation BeginConversation}

getEndConversations

public Collection<String> getEndConversations(Class<?> clazz,
                                              Method method)
returns a collection of conversation names for the method as an end point

Specified by:
getEndConversations in interface ConversationArbitrator
Returns:
See Also:
com.google.code.rees.scope.conversation.annotations.EndConversation EndConversation}

getConversations

public Collection<String> getConversations(Class<?> clazz)

getConversations

public Collection<String> getConversations(Class<?> clazz,
                                           String actionSuffix)

getConversations

public Collection<String> getConversations(Class<?> clazz,
                                           Method method,
                                           String actionSuffix)

getConversationsWithInheritance

protected String[] getConversationsWithInheritance(Class<?> clazz,
                                                   String actionSuffix)

getConversationsWithoutInheritance

protected String[] getConversationsWithoutInheritance(Class<?> clazz,
                                                      String actionSuffix)

getConversationControllers

protected Set<Class<?>> getConversationControllers(Class<?> clazz)

isAction

protected boolean isAction(Method method)

isConversationController

protected boolean isConversationController(Class<?> clazz)


Copyright © 2012-2013. All Rights Reserved.