org.apache.tomcat.util.modeler.Registry.loadMetadata()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中org.apache.tomcat.util.modeler.Registry.loadMetadata方法的一些代码示例,展示了Registry.loadMetadata的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Registry.loadMetadata方法的具体详情如下:
包路径:org.apache.tomcat.util.modeler.Registry
类名称:Registry
方法名:loadMetadata

Registry.loadMetadata介绍

[英]Load descriptors. The source can be a File or URL or InputStream for the descriptors file. In the case of File and URL, if the extension is ".ser" a serialized version will be loaded. This method should be used to explicitly load metadata - but this is not required in most cases. The registerComponent() method will find metadata in the same package.
[中]加载描述符。源可以是描述符文件的文件、URL或输入流。对于文件和URL,如果扩展名为“.ser”,将加载序列化版本。应该使用此方法显式加载元数据,但在大多数情况下并不需要这样做。registerComponent()方法将在同一个包中查找元数据。

代码示例

代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource

/**
 * Load the registry from the XML input found in the specified input
 * stream.
 *
 * @param stream InputStream containing the registry configuration
 *  information
 *
 * @exception Exception if any parsing or processing error occurs
 * @deprecated use normal class method instead
 * @since 1.0
 */
public static void loadRegistry(InputStream stream) throws Exception {
  Registry registry = getRegistry();
  registry.loadMetadata(stream);
}

代码示例来源:origin: jboss.web/jbossweb

/**
 * Load the registry from the XML input found in the specified input
 * stream.
 *
 * @param stream InputStream containing the registry configuration
 *  information
 *
 * @exception Exception if any parsing or processing error occurs
 * @deprecated use normal class method instead
 * @since 1.0
 */
public static void loadRegistry(InputStream stream) throws Exception {
  Registry registry = getRegistry();
  registry.loadMetadata(stream);
}

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Load the registry from the XML input found in the specified input
 * stream.
 *
 * @param stream InputStream containing the registry configuration
 *  information
 *
 * @exception Exception if any parsing or processing error occurs
 * @deprecated use normal class method instead
 * @since 1.0
 */
public static void loadRegistry(InputStream stream) throws Exception {
  Registry registry = getRegistry();
  registry.loadMetadata(stream);
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina-ha

protected static boolean initMetaData(Class<?> clazz) {
  try {
    if (clazz==null) return false;
    getRegistry().loadMetadata(clazz.getResourceAsStream("mbeans-descriptors.xml"));
  }catch (Exception x) {
    log.warn("Unable to load meta data for class:"+clazz.getName());
    return false;
  }
  return true;
}

相关文章