{
// initialize
super.init(config);
// get jetspeed component manager configuration for decorations
ComponentManager cm = Jetspeed.getComponentManager();
int count =0;
while(cm == null) {
try {
Thread.sleep(200);
} catch(InterruptedException ie) {
}
cm = Jetspeed.getComponentManager();
if( count > 5 ) {
if (null == cm)
throw new ServletException("Could not get Jetspeed Component Manager after "+count+"tries");
}
count++;
}
decorationLocator = (TemplateLocator) cm.getComponent("DecorationLocator");
// initialize thread safe velocity engine cache
int cacheSize = (int) getLongInitParameter(config, CACHE_SIZE_PARAMETER, DEFAULT_CACHE_SIZE);
velocityEngineConfigCache = new LRUMap(cacheSize);
velocityEngineCache = new LRUMap(cacheSize/2);