@Override public void init(Config config, Properties properties, DecoratorMapper decoratorMapper) throws InstantiationException { target.init(config, properties, decoratorMapper); }
/** * Get the decorator mapper for this module. This method will return an initialised decorator mapper. In order to * initialise it though, it needs a parent decorator mapper and configuration, that's why getModule() isn't used. * * @param config The Sitemesh configuration * @param parent The parent decorator mapper * @return An initialised decorator mapper */ @ClusterSafe("Local. We are just manipulating the sitemesh configuration in the local web app.") public synchronized DecoratorMapper getDecoratorMapper(Config config, DecoratorMapper parent) { if (decoratorMapper == null) { decoratorMapper = createDecoratorMapper(); try { decoratorMapper.init(config, new Properties(), parent); } catch (InstantiationException ie) { log.error("Error initialising decorator mapper in plugin " + getKey(), ie); decoratorMapper = null; } } return decoratorMapper; }
/** Push new DecoratorMapper onto end of chain. */ protected void pushDecoratorMapper(String className, Properties properties) { try { Class decoratorMapperClass = ClassLoaderUtil.loadClass(className, getClass()); DecoratorMapper newMapper = getDecoratorMapper(decoratorMapperClass); newMapper.init(config, properties, decoratorMapper); decoratorMapper = newMapper; } catch (ClassNotFoundException e) { throw new FactoryException("Could not load DecoratorMapper class : " + className, e); } catch (Exception e) { throw new FactoryException("Could not initialize DecoratorMapper : " + className, e); } }