当前位置: 首页>>代码示例>>Java>>正文


Java MetroConfig类代码示例

本文整理汇总了Java中com.sun.xml.internal.ws.runtime.config.MetroConfig的典型用法代码示例。如果您正苦于以下问题:Java MetroConfig类的具体用法?Java MetroConfig怎么用?Java MetroConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MetroConfig类属于com.sun.xml.internal.ws.runtime.config包,在下文中一共展示了MetroConfig类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createJAXBContext

import com.sun.xml.internal.ws.runtime.config.MetroConfig; //导入依赖的package包/类
private static JAXBContext createJAXBContext() throws Exception {
    if (isJDKInternal()) {
        // since jdk classes are repackaged, extra privilege is necessary to create JAXBContext
        return AccessController.doPrivileged(
                new PrivilegedExceptionAction<JAXBContext>() {
                    @Override
                    public JAXBContext run() throws Exception {
                        return JAXBContext.newInstance(MetroConfig.class.getPackage().getName());
                    }
                }, createSecurityContext()
        );
    } else {
        // usage from JAX-WS/Metro/Glassfish
        return JAXBContext.newInstance(MetroConfig.class.getPackage().getName());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:MetroConfigLoader.java

示例2: getTubeline

import com.sun.xml.internal.ws.runtime.config.MetroConfig; //导入依赖的package包/类
TubelineDefinition getTubeline(MetroConfig config, URI tubelineDefinitionUri) {
    if (config != null && config.getTubelines() != null) {
        for (TubelineDefinition td : config.getTubelines().getTubelineDefinitions()) {
            if (td.getName().equals(tubelineDefinitionUri.getFragment())) {
                return td;
            }
        }
    }

    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:MetroConfigLoader.java

示例3: loadMetroConfig

import com.sun.xml.internal.ws.runtime.config.MetroConfig; //导入依赖的package包/类
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
    MetroConfig result = null;
    try {
        JAXBContext jaxbContext = createJAXBContext();
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
        final JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(resourceUrl.openStream()), MetroConfig.class);
        result = configElement.getValue();
    } catch (Exception e) {
        LOGGER.warning(TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(resourceUrl.toString()), e);
    }
    return result;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:MetroConfigLoader.java

示例4: loadMetroConfig

import com.sun.xml.internal.ws.runtime.config.MetroConfig; //导入依赖的package包/类
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
    try (InputStream is = getConfigInputStream(resourceUrl)) {
        JAXBContext jaxbContext = createJAXBContext();
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
        JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(is), MetroConfig.class);
        return configElement.getValue();
    } catch (Exception e) {
        String message = TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(
                resourceUrl != null ? resourceUrl.toString() : null);
        InternalError error = new InternalError(message);
        LOGGER.logException(error, e, Level.SEVERE);
        throw error;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:MetroConfigLoader.java

示例5: createJAXBContext

import com.sun.xml.internal.ws.runtime.config.MetroConfig; //导入依赖的package包/类
private static JAXBContext createJAXBContext() throws Exception {
    if (isJDKInternal()) {
        // since jdk classes are repackaged, extra privilege is necessary to create JAXBContext
        return AccessController.doPrivileged(
                new PrivilegedExceptionAction<JAXBContext>() {
                    @Override
                    public JAXBContext run() throws Exception {
                        return JAXBContext.newInstance(MetroConfig.class.getPackage().getName());
                    }
                });
    } else {
        // usage from JAX-WS/Metro/Glassfish
        return JAXBContext.newInstance(MetroConfig.class.getPackage().getName());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:MetroConfigLoader.java


注:本文中的com.sun.xml.internal.ws.runtime.config.MetroConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。