groovyx.gpars.actor.impl
Class SequentialProcessingActor.MultiMessageReaction

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by groovy.lang.Closure
          extended by groovyx.gpars.actor.impl.SequentialProcessingActor.MultiMessageReaction
All Implemented Interfaces:
groovy.lang.GroovyObject, java.io.Serializable, java.lang.Cloneable, java.lang.Runnable, org.codehaus.groovy.runtime.GeneratedClosure
Enclosing class:
SequentialProcessingActor

private final class SequentialProcessingActor.MultiMessageReaction
extends groovy.lang.Closure
implements org.codehaus.groovy.runtime.GeneratedClosure

Enables multiple argument closures to be passed to react(). The MultiMessageReaction class takes just one argument and will wrap the intended closure. After invoking the MultiMessageReaction will curry the obtained value onto the wrapped multi-argument closure. The whole process of wrapping a multi-argument closure with MultiMessageReaction class instances is repeated until all arguments are curried. At that moment the original closure, now worth all arguments curried, gets invoked.

Author:
Vaclav Pech

Field Summary
private  groovy.lang.Closure code
           
private  java.util.List<MessageStream> localSenders
           
private  int maxNumberOfParameters
           
private static long serialVersionUID
           
private  long timeout
           
 
Fields inherited from class groovy.lang.Closure
DELEGATE_FIRST, DELEGATE_ONLY, DONE, maximumNumberOfParameters, OWNER_FIRST, OWNER_ONLY, parameterTypes, SKIP, TO_SELF
 
Constructor Summary
private SequentialProcessingActor.MultiMessageReaction(groovy.lang.Closure code, int maxNumberOfParameters, long timeout, java.util.List<MessageStream> localSenders)
           
 
Method Summary
 java.lang.Object doCall(java.lang.Object args)
           
 int getMaximumNumberOfParameters()
           
 java.lang.Class<?>[] getParameterTypes()
           
 
Methods inherited from class groovy.lang.Closure
asWritable, call, call, call, clone, curry, getDelegate, getDirective, getOwner, getProperty, getResolveStrategy, getThisObject, isCase, run, setDelegate, setDirective, setProperty, setResolveStrategy, throwRuntimeException
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, invokeMethod, setMetaClass
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

code

private final groovy.lang.Closure code

maxNumberOfParameters

private final int maxNumberOfParameters

timeout

private final long timeout

localSenders

private final java.util.List<MessageStream> localSenders
Constructor Detail

SequentialProcessingActor.MultiMessageReaction

private SequentialProcessingActor.MultiMessageReaction(groovy.lang.Closure code,
                                                       int maxNumberOfParameters,
                                                       long timeout,
                                                       java.util.List<MessageStream> localSenders)
Method Detail

getMaximumNumberOfParameters

public int getMaximumNumberOfParameters()
Overrides:
getMaximumNumberOfParameters in class groovy.lang.Closure

getParameterTypes

public java.lang.Class<?>[] getParameterTypes()
Overrides:
getParameterTypes in class groovy.lang.Closure

doCall

public java.lang.Object doCall(java.lang.Object args)

Copyright © 2008–2010 Václav Pech. All Rights Reserved.