Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.3.6
-
Fix Version/s: 2.3-M2
-
Component/s: None
-
Labels:None
-
Environment:Linux 2.6.35-zen2 x86_64 Intel(R) Core(TM)2 Duo CPU T9500
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Description
There appears to be no clean way to hook into application startup or shutdown events. For application start one could hook into the ant tasks using something like the following in _Events.grovy:
eventRunAppStart = { doStartThing() }
bq. eventRunAppHttpsStart = { doStartThing() }
eventRunWarStart = { doStartThing() }
bq. eventRunWarHttpsStart = { doStartThing() }
but this method does not seem to be the cleanest of approaches.
As for server shutdown I cannot see any way of hooking into the DevelopmentShutdownHook without modifying the application.
It would be very useful if the _GrailsRun script would issue specific events (e.g. in the runServer closure) for changes in the EmbeddableServer lifecycle.
Can you please elaborate on ?but this method does not seem to be the cleanest of approaches?.