![JAR search and dependency download from the Maven repository](/logo.png)
it.eng.spago.init.PortletInitializerManager Maven / Gradle / Ivy
/**
Copyright 2004, 2007 Engineering Ingegneria Informatica S.p.A. & Sinapsi S.p.A.
This file is part of Spago.
Spago is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
any later version.
Spago is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Spago; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
**/
package it.eng.spago.init;
import java.util.List;
import it.eng.spago.base.Constants;
import it.eng.spago.base.SourceBean;
import it.eng.spago.configuration.ConfigSingleton;
import it.eng.spago.tracing.TracerSingleton;
/**
* @author zoppello
*/
public class PortletInitializerManager {
private PortletInitializerManager() {
super();
} // private PortletInitializerManager()
public static void init(){
init("PORTLETINITIALIZERS.INITIALIZER");
}
public static void init(String cgfInitializerPath){
ConfigSingleton configure = ConfigSingleton.getInstance();
String startupConsoleStr =
(String) configure.getAttribute("COMMON.startup_console");
if ((startupConsoleStr == null)
|| (!startupConsoleStr.equalsIgnoreCase("FALSE")))
System.out.println(
"PortletInitializerManager::init: configuration\n"
+ configure.toXML(false));
List initializers =
configure.getAttributeAsList("PORTLETINITIALIZERS.INITIALIZER");
for (int i = 0; i < initializers.size(); i++) {
try {
SourceBean initializerDefinition =
(SourceBean) (initializers.get(i));
String initializerClassName =
(String) (initializerDefinition.getAttribute("CLASS"));
String initializerConfigName =
(String) (initializerDefinition.getAttribute("CONFIG"));
TracerSingleton.log(
Constants.NOME_MODULO,
TracerSingleton.DEBUG,
"PortletInitializerManager::init: "
+ initializerClassName
+ " ["
+ initializerConfigName
+ "]");
SourceBean initializerConfig =
(SourceBean) (configure
.getAttribute(initializerConfigName));
InitializerIFace initializer =
(InitializerIFace) (Class
.forName(initializerClassName)
.newInstance());
initializer.init(initializerConfig);
} // try
catch (Exception ex) {
TracerSingleton.log(
Constants.NOME_MODULO,
TracerSingleton.CRITICAL,
"PortletInitializerManager::init:",
ex);
} // catch (Exception ex) try
} // for (int i = 0; i < initializers.size(); i++)
} // public static void init()
} // public class PortletInitializerManager
© 2015 - 2025 Weber Informatics LLC | Privacy Policy