Wednesday, June 17, 2009

AutoLoad Classes in ATG DAS


I was trying to enable autoreload functionality for dynamo like we have in JBoss (loading war or ear based on 'scanPeriod') or 'touch' web.xml to reload classes however I couldnt find a solution for that. Fortunately its possible to reload nucleus components including the changes in properties file and java using Disposable Class Loader.

In case of Dynamo we need to follow these steps

1) Modify C:\ATG\DAS6.3.0\home\localconfig\environment.bat



Add reference to the classes we need to load to a System parameter defined by ATG i.e. 'atg.nucleus.class.path'

Eg:- set JAVA_ARGS=%JAVA_ARGS% -Datg.nucleus.class.path=file:///C:\ATG\ATG7.1\whitelabel\framework\classes



2) While DAS is running load ACC and browse to the required component & ‘Stop’ it .

3) Go to Tools -> Make new Class Loader



4) Start the component



However this will only allow to change existing methods or properties not for adding new methods .



On 2006.3 and up wecan add $reloadable=true to the .properties file for your component. In that case Nucleus will create a proxy for your component using cglib.If wego to the admin page for your "reloadable" component it'll now show a link for "Reload". When you click reload, the "real" object that your proxy was pointing at will be thrown away and a new one will be loaded.That'll give the effect of loading a new class.

No comments: