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