Package net.shibboleth.shared.scripting

# Class ScriptedRunnable

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.shared.scripting.ScriptedRunnable

All Implemented Interfaces:
  `Runnable`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`, `UnmodifiableComponent`

public class ScriptedRunnable extends AbstractIdentifiableInitializableComponent implements Runnable, UnmodifiableComponent
A Runnable which executes a script.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`private class`
`ScriptedRunnable.RunnableScriptEvaluator`
The thing that runs the script.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Object`
`customObject`
Custom object for script.
`private final org.slf4j.Logger`
`log`
The log.
`private EvaluableScript`
`script`
What is run.
`private ScriptedRunnable.RunnableScriptEvaluator`
`scriptEvaluator`
Evaluator.

## Constructor Summary

Constructors
Constructor
Description
`ScriptedRunnable()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
This method checks to ensure that the component ID is not null.
`Object`
`getCustomObject()`
Return the custom (externally provided) object.
`EvaluableScript`
`getScript()`
Gets the script to be evaluated.
`void`
`run()`
`void`
`setCustomObject(Object object)`
Set the custom (externally provided) object.
`void`
`setScript(EvaluableScript matcherScript)`
Sets the script to be evaluated.

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

## Field Details

### script

@NonnullAfterInit private EvaluableScript script
What is run.

### scriptEvaluator

@NonnullAfterInit private ScriptedRunnable.RunnableScriptEvaluator scriptEvaluator
Evaluator.

### log

@Nonnull private final org.slf4j.Logger log
The log.

### customObject

@Nullable private Object customObject
Custom object for script.

## Constructor Details

### ScriptedRunnable

public ScriptedRunnable()

## Method Details

### doInitialize

protected void doInitialize() throws ComponentInitializationException
This method checks to ensure that the component ID is not null. Performs the initialization of the component. This method is executed within the lock on the object being initialized. The default implementation of this method is a no-op.

Overrides:
  `doInitialize` in class `AbstractIdentifiedInitializableComponent`
Throws:
  `ComponentInitializationException` - thrown if there is a problem initializing the component

### getCustomObject

@Nullable public Object getCustomObject()
Return the custom (externally provided) object.

Returns:
  the custom object

### setCustomObject

public void setCustomObject(@Nullable Object object)
Set the custom (externally provided) object.

Parameters:
  `object` - the custom object

### getScript

@NonnullAfterInit public EvaluableScript getScript()
Gets the script to be evaluated.

Returns:
  the script to be evaluated

### setScript

public void setScript(@Nonnull EvaluableScript matcherScript)
Sets the script to be evaluated.

Parameters:
  `matcherScript` - the script to be evaluated

### run

public void run()

Specified by:
  `run` in interface `Runnable`