Issue Details (XML | Word | Printable)

Key: GROOVY-1745
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Jochen Theodorou
Reporter: Marc DeXeT
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
groovy

DefaultGroovyStaticMethods addShutdownHook( Object obj, Closure closure)

Created: 23/Feb/07 08:30 AM   Updated: 23/Feb/07 08:54 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1-beta-1

Time Tracking:
Not Specified


 Description  « Hide
Add the possibility to add a groovy-way shutdown hook as
addShutDownHook { myRessource.close() };
addShutDownHook { plants.each{ plant -> plant.sprinkle()} });
addShutDownHook { lights.each{ light -> light.switchOff()} });

There's only one method to add to org.codehaus.groovy.runtime.DefaultGroovyStaticMethods

public static void addShutDownHook (Object obj, Closure closure) {
    Runtime.getRuntime().addShutDownHook( new Thread( closure) );
}


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Marc DeXeT added a comment - 23/Feb/07 08:32 AM
Please. Could does a admin lower priority of this ?

Jochen Theodorou added a comment - 23/Feb/07 08:54 AM
implemented as addShutdownHook