groovyx.gpars
Class MessagingRunnable<T>

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by groovy.lang.Closure
          extended by groovyx.gpars.MessagingRunnable<T>
All Implemented Interfaces:
groovy.lang.GroovyCallable, groovy.lang.GroovyObject, java.io.Serializable, java.lang.Cloneable, java.lang.Runnable, java.util.concurrent.Callable
Direct Known Subclasses:
ThenMessagingRunnable

public abstract class MessagingRunnable<T>
extends groovy.lang.Closure

Represents a single-argument Closure when using GPars agents, actors or dataflow concurrency through the Java API. The doRun() method is meant to be defined by implementers to specify the closure body.

Author:
Vaclav Pech
See Also:
Serialized Form

Field Summary
private static java.lang.String MESSAGING_RUNNABLE_NEED_EXACTLY_ONE_ARGUMENT_TO_RUN
           
private static java.lang.Class[] PARAMETER_TYPES
           
private static long serialVersionUID
           
 
Fields inherited from class groovy.lang.Closure
DELEGATE_FIRST, DELEGATE_ONLY, DONE, IDENTITY, maximumNumberOfParameters, OWNER_FIRST, OWNER_ONLY, parameterTypes, SKIP, TO_SELF
 
Constructor Summary
protected MessagingRunnable()
           
protected MessagingRunnable(java.lang.Object owner)
           
 
Method Summary
 java.lang.Object call()
           
 java.lang.Object call(java.lang.Object arguments)
           
 java.lang.Object call(java.lang.Object[] args)
           
protected abstract  void doRun(T argument)
          Defines the action performed by the Runnable
 int getMaximumNumberOfParameters()
           
 java.lang.Class[] getParameterTypes()
           
 
Methods inherited from class groovy.lang.Closure
asWritable, clone, curry, curry, dehydrate, getDelegate, getDirective, getOwner, getProperty, getResolveStrategy, getThisObject, isCase, leftShift, leftShift, memoize, memoizeAtLeast, memoizeAtMost, memoizeBetween, ncurry, ncurry, rcurry, rcurry, rehydrate, rightShift, run, setDelegate, setDirective, setProperty, setResolveStrategy, throwRuntimeException, trampoline, trampoline
 
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

PARAMETER_TYPES

private static final java.lang.Class[] PARAMETER_TYPES

MESSAGING_RUNNABLE_NEED_EXACTLY_ONE_ARGUMENT_TO_RUN

private static final java.lang.String MESSAGING_RUNNABLE_NEED_EXACTLY_ONE_ARGUMENT_TO_RUN
See Also:
Constant Field Values
Constructor Detail

MessagingRunnable

protected MessagingRunnable()

MessagingRunnable

protected MessagingRunnable(java.lang.Object owner)
Method Detail

getMaximumNumberOfParameters

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

getParameterTypes

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

call

public final java.lang.Object call()
Specified by:
call in interface java.util.concurrent.Callable
Overrides:
call in class groovy.lang.Closure

call

public final java.lang.Object call(java.lang.Object[] args)
Overrides:
call in class groovy.lang.Closure

call

public final java.lang.Object call(java.lang.Object arguments)
Overrides:
call in class groovy.lang.Closure

doRun

protected abstract void doRun(T argument)
Defines the action performed by the Runnable

Parameters:
argument - The parameter passed from the caller to the closure

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