org.oddjob.scheduling
Class ExecutorThrottleType

java.lang.Object
  extended by org.oddjob.scheduling.ExecutorThrottleType
All Implemented Interfaces:
ArooaValue, ValueFactory<ExecutorService>

public class ExecutorThrottleType
extends Object
implements ValueFactory<ExecutorService>

Description

Throttle parallel execution. This will limit the number of jobs running in parallel.

Example

Throttling parallel execution.
<oddjob>
    <job>
        <parallel id="parallel">
            <executorService>
                <throttle limit="2"/>
            </executorService>
            <jobs>
                <wait name="Wait 1"/>
                <wait name="Wait 2"/>
                <wait name="Wait 3"/>
                <wait name="Wait 4"/>
            </jobs>
        </parallel>
    </job>
</oddjob>
Author:
rob

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.oddjob.arooa.types.ValueFactory
ValueFactory.Conversions
 
Constructor Summary
ExecutorThrottleType()
           
 
Method Summary
 int getLimit()
           
 ExecutorService getOriginal()
           
 void setLimit(int max)
           
 void setOriginal(ExecutorService original)
           
 String toString()
           
 ExecutorService toValue()
          Provide an instance of the type this is a factory for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExecutorThrottleType

public ExecutorThrottleType()
Method Detail

toValue

public ExecutorService toValue()
                        throws ArooaConversionException
Description copied from interface: ValueFactory
Provide an instance of the type this is a factory for.

Specified by:
toValue in interface ValueFactory<ExecutorService>
Returns:
An instance of the type. May be null.
Throws:
ArooaConversionException - If unable to provide a value.

getLimit

public int getLimit()

setLimit

public void setLimit(int max)

getOriginal

public ExecutorService getOriginal()

setOriginal

@Inject
public void setOriginal(ExecutorService original)

toString

public String toString()
Overrides:
toString in class Object