aboutsummaryrefslogtreecommitdiff
path: root/spss.server/src/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java
diff options
context:
space:
mode:
author(no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d>2003-12-22 17:28:21 +0000
committer(no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d>2003-12-22 17:28:21 +0000
commit057f884903954203339182649daa100ef4ce89e3 (patch)
tree7d6d5b0dc4aea4a63674b90800ebbf6ffcc0ca4d /spss.server/src/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java
parent92cca056c7935075012576b684c3678a9ec9f4ad (diff)
downloadmoa-id-spss-057f884903954203339182649daa100ef4ce89e3.tar.gz
moa-id-spss-057f884903954203339182649daa100ef4ce89e3.tar.bz2
moa-id-spss-057f884903954203339182649daa100ef4ce89e3.zip
This commit was manufactured by cvs2svn to create tag 'Build_001'.tags/Build_001
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/Build_001@85 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss.server/src/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java')
-rw-r--r--spss.server/src/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java122
1 files changed, 0 insertions, 122 deletions
diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java b/spss.server/src/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java
deleted file mode 100644
index f968778d7..000000000
--- a/spss.server/src/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package at.gv.egovernment.moa.spss.server.init;
-
-import java.io.IOException;
-import java.security.Security;
-
-import javax.net.ssl.SSLSocketFactory;
-
-import iaik.ixsil.init.IXSILInit;
-
-import at.gv.egovernment.moa.logging.LogMsg;
-import at.gv.egovernment.moa.logging.Logger;
-import at.gv.egovernment.moa.logging.LoggingContext;
-import at.gv.egovernment.moa.logging.LoggingContextManager;
-import at.gv.egovernment.moa.util.Constants;
-import at.gv.egovernment.moa.util.DOMUtils;
-
-import at.gv.egovernment.moa.spss.MOAException;
-import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider;
-import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator;
-import at.gv.egovernment.moa.spss.server.logging.IaikLog;
-import at.gv.egovernment.moa.spss.server.service.RevocationArchiveCleaner;
-import at.gv.egovernment.moa.spss.util.MessageProvider;
-
-/**
- * MOA SP/SS web service initialization.
- *
- * @author Patrick Peck
- * @version $Id$
- */
-public class SystemInitializer {
- /** Interval between archive cleanups in seconds */
- private static final long ARCHIVE_CLEANUP_INTERVAL = 60 * 60; // 1h
- /** The MOA SP/SS logging hierarchy. */
- private static final String LOGGING_HIERARCHY = "moa.spss.server";
- /** Whether XML schema grammars have been initialized. */
- private static boolean grammarsInitialized = false;
-
- /**
- * Initialize the MOA SP/SS webservice.
- */
- public static void init() {
- MessageProvider msg = MessageProvider.getInstance();
- ClassLoader cl = SystemInitializer.class.getClassLoader();
- Thread archiveCleaner;
-
- // set up the MOA SPSS logging hierarchy
- Logger.setHierarchy(LOGGING_HIERARCHY);
-
- // set up a logging context for logging the startup
- LoggingContextManager.getInstance().setLoggingContext(
- new LoggingContext("startup"));
-
- // load some jsse classes so that the integrity of the jars can be verified
- // before the iaik jce is installed as the security provider
- // this workaround is only needed when sun jsse is used in conjunction with
- // iaik-jce (on jdk1.3)
- try {
- cl.loadClass("javax.security.cert.Certificate"); // from jcert.jar
- } catch (ClassNotFoundException e) {
- Logger.warn(msg.getMessage("init.03", null), e);
- }
-
- // set up SUN JSSE SSL
- Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
- System.setProperty(
- "java.protocol.handler.pkgs",
- "com.sun.net.ssl.internal.www.protocol");
- SSLSocketFactory.getDefault();
-
- // initialize preparsed Xerces grammar pool for faster XML
- // parsing/validating
- try {
- if (!grammarsInitialized) {
- Class clazz = SystemInitializer.class;
- // preparse XML schema
- DOMUtils.addSchemaToPool(
- clazz.getResourceAsStream(Constants.XML_SCHEMA_LOCATION),
- Constants.XML_NS_URI);
- // preparse XMLDsig Filter2 schema
- DOMUtils.addSchemaToPool(
- clazz.getResourceAsStream(Constants.DSIG_FILTER2_SCHEMA_LOCATION),
- Constants.DSIG_FILTER2_NS_URI);
- // preparse XMLDsig schema
- DOMUtils.addSchemaToPool(
- clazz.getResourceAsStream(Constants.DSIG_SCHEMA_LOCATION),
- Constants.DSIG_NS_URI);
- // preparse MOA schema
- DOMUtils.addSchemaToPool(
- clazz.getResourceAsStream(Constants.MOA_SCHEMA_LOCATION),
- Constants.MOA_NS_URI);
- grammarsInitialized = true;
- }
- } catch (IOException e) {
- Logger.warn(new LogMsg(msg.getMessage("init.04", null)), e);
- }
-
- // initialize configuration
- try {
- ConfigurationProvider config = ConfigurationProvider.getInstance();
- new IaikConfigurator().configure(config);
- Logger.info(new LogMsg(msg.getMessage("init.01", null)));
- } catch (MOAException e) {
- Logger.fatal(new LogMsg(msg.getMessage("init.00", null)), e);
- }
-
- // set IXSIL debug output
- IXSILInit.setPrintDebugLog(
- Logger.isDebugEnabled(IaikLog.IAIK_LOG_HIERARCHY));
-
- // start the archive cleanup thread
- archiveCleaner =
- new Thread(new RevocationArchiveCleaner(ARCHIVE_CLEANUP_INTERVAL));
- archiveCleaner.setName("RevocationArchiveCleaner");
- archiveCleaner.setDaemon(true);
- archiveCleaner.setPriority(Thread.MIN_PRIORITY);
- archiveCleaner.start();
-
- // unset the startup logging context
- LoggingContextManager.getInstance().setLoggingContext(null);
- }
-
-}