org.logicblaze.lingo
Class DefaultResultJoinStrategy

java.lang.Object
  extended by org.logicblaze.lingo.DefaultResultJoinStrategy
All Implemented Interfaces:
ResultJoinStrategy

public class DefaultResultJoinStrategy
extends Object
implements ResultJoinStrategy

A default implementation of ResultJoinStrategy which will add together collection results, unblock the calling thread when there is a single result and let the handler timeout with whatever the default handler timeout policy is.

Version:
$Revision$

Constructor Summary
DefaultResultJoinStrategy()
           
 
Method Summary
 int getMaximumResults()
           
 int getMinimumResults()
           
 org.springframework.remoting.support.RemoteInvocationResult mergeResponses(org.springframework.remoting.support.RemoteInvocationResult currentResult, org.springframework.remoting.support.RemoteInvocationResult newResult, int responseCount)
          Merges the new response with the previous response object.
 boolean removeHandler(org.springframework.remoting.support.RemoteInvocationResult response, int responseCount)
          Returns true if there have been sufficient responses to remove the handler from the system.
 void setMaximumResults(int maximumResults)
           
 void setMinimumResults(int minimiumResults)
           
 boolean unblockCallerThread(org.springframework.remoting.support.RemoteInvocationResult response, int responseCount)
          Returns true if the calling thread should be unblocked after calling the method and so returning the current value of the invocation result; future responses could still mutate the result object if required.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultResultJoinStrategy

public DefaultResultJoinStrategy()
Method Detail

unblockCallerThread

public boolean unblockCallerThread(org.springframework.remoting.support.RemoteInvocationResult response,
                                   int responseCount)
Description copied from interface: ResultJoinStrategy
Returns true if the calling thread should be unblocked after calling the method and so returning the current value of the invocation result; future responses could still mutate the result object if required. The default implementation will return true after a single response is returned.

Specified by:
unblockCallerThread in interface ResultJoinStrategy

removeHandler

public boolean removeHandler(org.springframework.remoting.support.RemoteInvocationResult response,
                             int responseCount)
Description copied from interface: ResultJoinStrategy
Returns true if there have been sufficient responses to remove the handler from the system. Typically handlers should expire after some inactivity timeout.

Specified by:
removeHandler in interface ResultJoinStrategy

mergeResponses

public org.springframework.remoting.support.RemoteInvocationResult mergeResponses(org.springframework.remoting.support.RemoteInvocationResult currentResult,
                                                                                  org.springframework.remoting.support.RemoteInvocationResult newResult,
                                                                                  int responseCount)
Description copied from interface: ResultJoinStrategy
Merges the new response with the previous response object. The default implementation just merges collections together otherwise the first response wins.

Specified by:
mergeResponses in interface ResultJoinStrategy

getMaximumResults

public int getMaximumResults()

setMaximumResults

public void setMaximumResults(int maximumResults)

getMinimumResults

public int getMinimumResults()

setMinimumResults

public void setMinimumResults(int minimiumResults)


Copyright © 2005-2006 LogicBlaze, Inc.. All Rights Reserved.