示例#1
0
 /** This method is called by Rails's Application.rb file. */
 public static ContainerConfig loadContainerConfig(String gsnXMLpath)
     throws JiBXException, FileNotFoundException, NoSuchAlgorithmException,
         NoSuchProviderException, IOException, KeyStoreException, CertificateException,
         SecurityException, SignatureException, InvalidKeyException, ClassNotFoundException {
   if (!new File(gsnXMLpath).isFile()) {
     logger.fatal("Couldn't find the gsn.xml file @: " + (new File(gsnXMLpath).getAbsolutePath()));
     System.exit(1);
   }
   IBindingFactory bfact = BindingDirectory.getFactory(ContainerConfig.class);
   IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
   ContainerConfig conf =
       (ContainerConfig) uctx.unmarshalDocument(new FileInputStream(new File(gsnXMLpath)), null);
   Class.forName(conf.getStorage().getJdbcDriver());
   conf.setContainerConfigurationFileName(gsnXMLpath);
   return conf;
 }