Module initialization |
Joined: 14-March-2005 Posts: 60 Location: Amsterdam, The Netherlands | Posted:
10-April-2006 11:33 Dear all,
I would like to execute an active URI, e.g. a DPML script, the moment a module is loaded and before external connections are allowed. In this special case I want to check that some derivatives from my source data are created and already load them into the cache so also the first client requests get the proper performance. It looks like there are no provisions for this, at least I couldn't find them in the documentations, but I hope I'm wrong ...
I'm aware of one partial solution and that is to add a cron entrypoint that is executed only once, but this job would be executed when external connections are already allowed and I rather wouldn't block those for a "long" time.
Thanks in advance for any ideas,
Menzo Windhouwer[/i] |
Solutions |

Joined: 7-February-2005 Posts: 249 Location: Uncharted territory | Posted:
10-April-2006 15:58 Hi Menzo, Yes CRON is the most flexible solution but it does have the disadvantage that other external requests will be admitted in parallel at that time. Generally I wouldn't recommend that you do special pushing into the cache to "warm" the system before use. In our experience the additional complexity just isn't worth it. However I do understand that sometimes you may want to run one of executions. The solution is to use a custom init hook created by a post_install entrypoint See: http://docs.1060.org/docs/3.0.0/book/solutiondeveloperguide/doc_guide_ext_kernel.htmland http://docs.1060.org/docs/3.0.0/book/solutiondeveloperguide/doc_entrypoint_guide.htmlThis will ensure a request is issued and executed before any external requests are admitted everytime the module is commissioned (i.e. every startup or cold restart) Hope this helps, let me know if you have more questions, Tony |
Works |
Joined: 14-March-2005 Posts: 60 Location: Amsterdam, The Netherlands | Posted:
11-April-2006 09:32 |
Works (2) |
Joined: 14-March-2005 Posts: 60 Location: Amsterdam, The Netherlands | Posted:
11-April-2006 09:43 [ Sorry, pressed the enter key a bit too early ... ]
Hi Tony,
After some wandering around I've got it to work, using a postInstall entrypoint to install a hook. Which then nicely runs after each restart.
I'm still thinking a bit about warming the cache. Our data document is pretty large and takes too long to load, i.e. the connection will time out before the user sees anything. So I want it to stay in the memory. One way is to make sure it stays in the cache. Another approach I may follow is to add a static: URI scheme (e.g. static:active:tds.data), which will allow me to bypass the cache to keep some (in fact 2: the data and the meta data) documents always in memory.
Thanks,
Menzo |
Thoughts |

Joined: 7-February-2005 Posts: 249 Location: Uncharted territory | Posted:
11-April-2006 10:33 After some wandering around I've got it to work, using a postInstall entrypoint to install a hook. Which then nicely runs after each restart. | That's great. It is a bit of an esoteric feature. I was hoping that CRON would eventually replace it. Maybe it can't. :-( I'm still thinking a bit about warming the cache. Our data document is pretty large and takes too long to load, i.e. the connection will time out before the user sees anything. So I want it to stay in the memory. One way is to make sure it stays in the cache. Another approach I may follow is to add a static: URI scheme (e.g. static:active:tds.data), which will allow me to bypass the cache to keep some (in fact 2: the data and the meta data) documents always in memory. | I would hope that the cache would be smart enough to keep this high value item around. If it isn't then you could consider raising it's creation cost value. Another possibility is that you're running in to tight a heap? If the value truely wants to be kept and it's lifecycle actively managed (We do this with the entrypoints table in the backend fulcrum) then you could store it in some static location. You have at least two choices: 1) like you say, create a new scheme and map a data storage service, either in memory or on the filesystem or db to it. (See the transient accessor in the ping pong demo for an example of this) 2) just use the ffcpl: scheme to store values on the filesystem in a module private way. Hope this helps, Tony |
Module Initialization - Practicalities |
Joined: 28-July-2007 Posts: 62 Location: Boston, MA USA | Posted:
15-July-2008 20:01 How does one updates the initHooks XML?
Do I have to create another module that SINKs the updated initHooks XML to the System Component Accessor? If that is the case how do I make sure that my new module is called upon start-up?
Or do I unpack ext-kernel-1.0.9.jar, modify initHooks and redeploy as an unpacked directory?
Or is there a better option (I really do not prefer either of the two options listed above)?
Please advise with an example. |
Module Initialization |
Joined: 28-July-2007 Posts: 62 Location: Boston, MA USA | Posted:
15-July-2008 20:25 Specifically, I am looking for an example of using a postInstall entrypoint to install a hook
| Both the entrypoint and script?? |
An example |

Joined: 7-February-2005 Posts: 249 Location: Uncharted territory | Posted:
15-July-2008 22:47 |