init.java

来自「JAVA 所有包」· Java 代码 · 共 421 行 · 第 1/2 页

JAVA
421
字号
                                              exArgs));                  }               }               XX_configure_reg_c14n_end = System.currentTimeMillis();            }                                    if (tag.equals("TransformAlgorithms")){               XX_configure_reg_transforms_start = System.currentTimeMillis();               Transform.init();               Element[] tranElem = XMLUtils.selectNodes(el.getFirstChild(),CONF_NS,"TransformAlgorithm");               for (int i = 0; i < tranElem.length; i++) {                  String URI = tranElem[i].getAttributeNS(null,                                  "URI");                  String JAVACLASS =                     tranElem[i].getAttributeNS(null,                        "JAVACLASS");                  try {                     Class.forName(JAVACLASS);                     if (true)                     	if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Transform.register(" + URI + ", " + JAVACLASS                            + ")");                     Transform.register(URI, JAVACLASS);                  } catch (ClassNotFoundException e) {                     Object exArgs[] = { URI, JAVACLASS };                     log.log(java.util.logging.Level.SEVERE, I18n.translate("algorithm.classDoesNotExist",                                              exArgs));                  } catch (NoClassDefFoundError ex) {					  log.log(java.util.logging.Level.WARNING, "Not able to found dependecies for algorithm, I'm keep working.");                  }               }               XX_configure_reg_transforms_end = System.currentTimeMillis();            }                                    if ("JCEAlgorithmMappings".equals(tag)){               XX_configure_reg_jcemapper_start = System.currentTimeMillis();               JCEMapper.init((Element)el);               XX_configure_reg_jcemapper_end = System.currentTimeMillis();            }                                    if (tag.equals("SignatureAlgorithms")){               XX_configure_reg_sigalgos_start = System.currentTimeMillis();               SignatureAlgorithm.providerInit();               Element[] sigElems = XMLUtils.selectNodes(el.getFirstChild(), CONF_NS,                                    "SignatureAlgorithm");               for (int i = 0; i < sigElems.length; i++) {                  String URI = sigElems[i].getAttributeNS(null,                                  "URI");                  String JAVACLASS =                    sigElems[i].getAttributeNS(null,                        "JAVACLASS");                  /** $todo$ handle registering */                  try {                      Class.forName(JAVACLASS); //                    Method methods[] = c.getMethods();//                     for (int j = 0; j < methods.length; j++) {//                        Method currMeth = methods[j];////                        if (currMeth.getDeclaringClass().getName()//                                .equals(JAVACLASS)) {//                           log.log(java.util.logging.Level.FINE, currMeth.getDeclaringClass().toString());//                        }//                     }                      if (true)                      	if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "SignatureAlgorithm.register(" + URI + ", "                            + JAVACLASS + ")");                     SignatureAlgorithm.register(URI, JAVACLASS);                  } catch (ClassNotFoundException e) {                     Object exArgs[] = { URI, JAVACLASS };                     log.log(java.util.logging.Level.SEVERE, I18n.translate("algorithm.classDoesNotExist",                                              exArgs));                  }               }               XX_configure_reg_sigalgos_end = System.currentTimeMillis();            }                                    if (tag.equals("ResourceResolvers")){               XX_configure_reg_resourceresolver_start = System.currentTimeMillis();               ResourceResolver.init();               Element[]resolverElem = XMLUtils.selectNodes(el.getFirstChild(),CONF_NS,                  "Resolver");               for (int i = 0; i < resolverElem.length; i++) {                  String JAVACLASS =                      resolverElem[i].getAttributeNS(null,                        "JAVACLASS");                  String Description =                     resolverElem[i].getAttributeNS(null,                        "DESCRIPTION");                  if ((Description != null) && (Description.length() > 0)) {                    if (true)                    	if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS + ": "                               + Description);                  } else {                    if (true)                    	if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS                               + ": For unknown purposes");                  }				  try {					  ResourceResolver.register(JAVACLASS);				  } catch (Throwable e) {					  log.log(java.util.logging.Level.WARNING, "Cannot register:"+JAVACLASS+" perhaps some needed jars are not installed",e);				  }                  XX_configure_reg_resourceresolver_end =                    System.currentTimeMillis();               }                           }                                                            if (tag.equals("KeyResolver")){               XX_configure_reg_keyResolver_start =System.currentTimeMillis();               KeyResolver.init();               Element[] resolverElem = XMLUtils.selectNodes(el.getFirstChild(), CONF_NS,"Resolver");               for (int i = 0; i < resolverElem.length; i++) {                  String JAVACLASS =                     resolverElem[i].getAttributeNS(null,                        "JAVACLASS");                  String Description =                     resolverElem[i].getAttributeNS(null,                        "DESCRIPTION");                  if ((Description != null) && (Description.length() > 0)) {                    if (true)                    	if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS + ": "                               + Description);                  } else {                    if (true)                    	if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS                               + ": For unknown purposes");                  }                  KeyResolver.register(JAVACLASS);               }               XX_configure_reg_keyResolver_end = System.currentTimeMillis();            }                                    if (tag.equals("PrefixMappings")){                XX_configure_reg_prefixes_start = System.currentTimeMillis();                if (true)                	if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Now I try to bind prefixes:");               Element[] nl = XMLUtils.selectNodes(el.getFirstChild(), CONF_NS,"PrefixMapping");               for (int i = 0; i < nl.length; i++) {                  String namespace = nl[i].getAttributeNS(null,                                        "namespace");                  String prefix = nl[i].getAttributeNS(null,                                     "prefix");                  if (true)                  	if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Now I try to bind " + prefix + " to " + namespace);                  com.sun.org.apache.xml.internal.security.utils.ElementProxy                     .setDefaultPrefix(namespace, prefix);               }               XX_configure_reg_prefixes_end = System.currentTimeMillis();            }            }                        long XX_init_end = System.currentTimeMillis();            //J-            if (true) {            	if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "XX_init                             " + ((int)(XX_init_end - XX_init_start)) + " ms");                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_prng                           " + ((int)(XX_prng_end - XX_prng_start)) + " ms");                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_parsing                        " + ((int)(XX_parsing_end - XX_parsing_start)) + " ms");                            if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_i18n                 " + ((int)(XX_configure_i18n_end- XX_configure_i18n_start)) + " ms");                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_c14n             " + ((int)(XX_configure_reg_c14n_end- XX_configure_reg_c14n_start)) + " ms");                                       if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_jcemapper        " + ((int)(XX_configure_reg_jcemapper_end- XX_configure_reg_jcemapper_start)) + " ms");                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_keyInfo          " + ((int)(XX_configure_reg_keyInfo_end- XX_configure_reg_keyInfo_start)) + " ms");                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_keyResolver      " + ((int)(XX_configure_reg_keyResolver_end- XX_configure_reg_keyResolver_start)) + " ms");                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_prefixes         " + ((int)(XX_configure_reg_prefixes_end- XX_configure_reg_prefixes_start)) + " ms");                            if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_resourceresolver " + ((int)(XX_configure_reg_resourceresolver_end- XX_configure_reg_resourceresolver_start)) + " ms");                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_sigalgos         " + ((int)(XX_configure_reg_sigalgos_end- XX_configure_reg_sigalgos_start)) + " ms");                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_transforms       " + ((int)(XX_configure_reg_transforms_end- XX_configure_reg_transforms_start)) + " ms");            }         } catch (Exception e) {            log.log(java.util.logging.Level.SEVERE, "Bad: ", e);            e.printStackTrace();         }         }  }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?