*** empty log message ***
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / common / Init.java
1 package edu.internet2.middleware.shibboleth.common;
2
3 import javax.xml.parsers.ParserConfigurationException;
4
5 import edu.internet2.middleware.shibboleth.common.XML.SchemaResolver;
6
7 /**
8  *  Handles one-time library initialization
9  *
10  * @author     Scott Cantor
11  * @created    May 18, 2002
12  */
13 public class Init
14 {
15     private static boolean initialized = false;
16
17     /**  Initializes library */
18     public static synchronized void init()
19     {
20         if (initialized)
21             return;
22
23         initialized = true;
24         
25         org.opensaml.Init.init();
26         try
27         {
28             org.opensaml.XML.parserPool.registerExtension(XML.SHIB_NS, XML.SHIB_SCHEMA_ID, new XML.SchemaResolver());
29         }
30         catch (ParserConfigurationException e)
31         {
32             throw new RuntimeException("Init.init() unable to register extension schema");
33         }
34     }
35
36     static
37     {
38         Init.init();
39     }
40 }
41