- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.mule.runtime.core.api.util.xmlsecurity.XMLSecureFactories.createDefault()
方法的一些代码示例,展示了XMLSecureFactories.createDefault()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLSecureFactories.createDefault()
方法的具体详情如下:
包路径:org.mule.runtime.core.api.util.xmlsecurity.XMLSecureFactories
类名称:XMLSecureFactories
方法名:createDefault
暂无
代码示例来源:origin: mulesoft/mule
@Override
public Supplier<SAXParserFactory> getSaxParserFactory() {
return () -> XMLSecureFactories.createDefault().getSAXParserFactory();
}
代码示例来源:origin: mulesoft/mule
@Override
public Supplier<SAXParserFactory> getSaxParserFactory() {
return () -> XMLSecureFactories.createDefault().getSAXParserFactory();
}
代码示例来源:origin: mulesoft/mule
.loadDocument(() -> XMLSecureFactories.createDefault().getSAXParserFactory(),
new ModuleDelegatingEntityResolver(extensions), resource.getFile(),
new ByteArrayInputStream(resultStream.toByteArray()));
代码示例来源:origin: mulesoft/mule
private String serializeArtifact(ArtifactDeclaration artifact) {
checkArgument(artifact != null, "The artifact to serialize cannot be null");
try {
Document doc = createAppDocument(artifact);
XmlDslElementModelConverter toXmlConverter = XmlDslElementModelConverter.getDefault(doc);
DslElementModelFactory modelResolver = DslElementModelFactory.getDefault(context);
artifact.getGlobalElements()
.forEach(declaration -> appendChildElement(toXmlConverter, doc.getDocumentElement(),
modelResolver, (ElementDeclaration) declaration));
List<String> cDataElements = getCDataElements(doc.getDocumentElement());
// write the content into xml file
TransformerFactory transformerFactory = XMLSecureFactories.createDefault().getTransformerFactory();
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.CDATA_SECTION_ELEMENTS, join(cDataElements, " "));
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
DOMSource source = new DOMSource(doc);
StringWriter writer = new StringWriter();
transformer.transform(source, new StreamResult(writer));
return writer.getBuffer().toString();
} catch (Exception e) {
throw new MuleRuntimeException(createStaticMessage("Failed to serialize the declaration for the artifact ["
+ artifact.getName() + "]: " + e.getMessage()), e);
}
}
代码示例来源:origin: mulesoft/mule
private Document getModuleDocument(ExtensionLoadingContext context, URL resource) {
XmlConfigurationDocumentLoader xmlConfigurationDocumentLoader =
validateXml ? schemaValidatingDocumentLoader() : schemaValidatingDocumentLoader(NoOpXmlErrorHandler::new);
try {
final Set<ExtensionModel> extensions = new HashSet<>(context.getDslResolvingContext().getExtensions());
createTnsExtensionModel(resource, extensions).ifPresent(extensions::add);
return xmlConfigurationDocumentLoader.loadDocument(() -> XMLSecureFactories.createDefault().getSAXParserFactory(),
new ModuleDelegatingEntityResolver(extensions), resource.getFile(),
resource.openStream());
} catch (IOException e) {
throw new MuleRuntimeException(
createStaticMessage(format("There was an issue reading the stream for the resource %s",
resource.getFile())));
}
}
代码示例来源:origin: mulesoft/mule
@Test
public void transformer() {
TransformerFactory factory = XMLSecureFactories.createDefault().getTransformerFactory();
assertThat(factory.getClass().getName(), equalTo("com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"));
}
代码示例来源:origin: mulesoft/mule
@Test
public void documentBuilder() {
DocumentBuilderFactory factory = XMLSecureFactories.createDefault().getDocumentBuilderFactory();
assertThat(factory.getClass().getName(), equalTo("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"));
}
代码示例来源:origin: mulesoft/mule
@Test
public void saxParser() {
SAXParserFactory factory = XMLSecureFactories.createDefault().getSAXParserFactory();
assertThat(factory.getClass().getName(), equalTo("com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"));
}
代码示例来源:origin: mulesoft/mule
@Test
public void xmlInput() {
XMLInputFactory factory = XMLSecureFactories.createDefault().getXMLInputFactory();
assertThat(factory.getClass().getName(), equalTo("com.sun.xml.internal.stream.XMLInputFactoryImpl"));
}
代码示例来源:origin: mulesoft/mule
@Test
public void schema() {
SchemaFactory factory = XMLSecureFactories.createDefault().getSchemaFactory("http://www.w3.org/2001/XMLSchema");
assertThat(factory.getClass().getName(), equalTo("com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory"));
}
}
代码示例来源:origin: mulesoft/mule
private ConfigLine loadArtifactConfig(String name, InputStream resource) {
checkArgument(resource != null, "The given application was not found as resource");
Document document =
noValidationDocumentLoader().loadDocument(() -> XMLSecureFactories.createDefault().getSAXParserFactory(),
new ModuleDelegatingEntityResolver(context.getExtensions()), name, resource);
XmlApplicationServiceRegistry xmlApplicationServiceRegistry =
new XmlApplicationServiceRegistry(new SpiServiceRegistry(), context);
return new XmlApplicationParser(createFromPluginClassloaders(cl -> xmlApplicationServiceRegistry.lookupProviders(
XmlNamespaceInfoProvider.class,
cl)
.stream().collect(Collectors.toList()), resolveContextArtifactPluginClassLoaders())).parse(document.getDocumentElement())
.orElseThrow(
() -> new MuleRuntimeException(createStaticMessage("Could not load load a Configuration from the given resource")));
}
代码示例来源:origin: mulesoft/mule
@Test
public void cachesXmlFactory() {
DocumentBuilderFactory documentBuilderFactoryOne = XMLSecureFactories.createDefault().getDocumentBuilderFactory();
DocumentBuilderFactory documentBuilderFactoryTwo = XMLSecureFactories.createDefault().getDocumentBuilderFactory();
assertThat(documentBuilderFactoryOne, sameInstance(documentBuilderFactoryTwo));
}
代码示例来源:origin: mulesoft/mule
@Test
public void createsTheCorrectInstances() {
XMLSecureFactories xmlSecureFactories = XMLSecureFactories.createDefault();
// As there are casts inside, creation would fail if the appropriate type is not returned
assertThat(xmlSecureFactories.getDocumentBuilderFactory(), notNullValue());
assertThat(xmlSecureFactories.getSAXParserFactory(), notNullValue());
assertThat(xmlSecureFactories.getXMLInputFactory(), notNullValue());
assertThat(xmlSecureFactories.getTransformerFactory(), notNullValue());
}
代码示例来源:origin: org.mule.services/mule-service-soap
public static Element stringToDomElement(String xml) throws XmlTransformationException {
try {
DocumentBuilder db = XMLSecureFactories.createDefault().getDocumentBuilderFactory().newDocumentBuilder();
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(xml));
return db.parse(is).getDocumentElement();
} catch (Exception e) {
throw new XmlTransformationException("Could not transform xml string to Dom Element", e);
}
}
代码示例来源:origin: org.mule.runtime/mule-module-spring-config
protected XMLReader createSaxAnnotator(Document doc) throws ParserConfigurationException, SAXException {
SAXParserFactory saxParserFactory = XMLSecureFactories.createDefault().getSAXParserFactory();
SAXParser saxParser = saxParserFactory.newSAXParser();
XMLReader documentReader = saxParser.getXMLReader();
documentReader.setContentHandler(new XmlMetadataAnnotator(doc, metadataFactory));
return documentReader;
}
代码示例来源:origin: org.mule.services/mule-service-soap
public static Document stringToDocument(String xml) throws XmlTransformationException {
DocumentBuilderFactory factory = XMLSecureFactories.createDefault().getDocumentBuilderFactory();
try {
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
return builder.parse(new ByteArrayInputStream(xml.getBytes()));
} catch (Exception e) {
throw new XmlTransformationException("Could not transform xml to Dom Document", e);
}
}
代码示例来源:origin: org.mule.services/mule-service-soap
public static XMLStreamReader stringToXmlStreamReader(String xml) throws XmlTransformationException {
try {
return XMLSecureFactories.createDefault().getXMLInputFactory()
.createXMLStreamReader(new ByteArrayInputStream(xml.getBytes()));
} catch (Exception e) {
throw new XmlTransformationException("Could not transform xml to XmlStreamReader", e);
}
}
}
代码示例来源:origin: org.mule.runtime/mule-module-spring-config
private String serializeArtifact(ArtifactDeclaration artifact) {
checkArgument(artifact != null, "The artifact to serialize cannot be null");
try {
Document doc = createAppDocument(artifact);
XmlDslElementModelConverter toXmlConverter = XmlDslElementModelConverter.getDefault(doc);
DslElementModelFactory modelResolver = DslElementModelFactory.getDefault(context);
artifact.getGlobalElements()
.forEach(declaration -> appendChildElement(toXmlConverter, doc.getDocumentElement(),
modelResolver, (ElementDeclaration) declaration));
List<String> cDataElements = getCDataElements(doc.getDocumentElement());
// write the content into xml file
TransformerFactory transformerFactory = XMLSecureFactories.createDefault().getTransformerFactory();
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.CDATA_SECTION_ELEMENTS, join(cDataElements, " "));
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
DOMSource source = new DOMSource(doc);
StringWriter writer = new StringWriter();
transformer.transform(source, new StreamResult(writer));
return writer.getBuffer().toString();
} catch (Exception e) {
throw new MuleRuntimeException(createStaticMessage("Failed to serialize the declaration for the artifact ["
+ artifact.getName() + "]: " + e.getMessage()), e);
}
}
代码示例来源:origin: org.mule.runtime/mule-core-tests
@Test
public void cachesXmlFactory() {
DocumentBuilderFactory documentBuilderFactoryOne = XMLSecureFactories.createDefault().getDocumentBuilderFactory();
DocumentBuilderFactory documentBuilderFactoryTwo = XMLSecureFactories.createDefault().getDocumentBuilderFactory();
assertThat(documentBuilderFactoryOne, sameInstance(documentBuilderFactoryTwo));
}
代码示例来源:origin: org.mule.runtime/mule-core-tests
@Test
public void createsTheCorrectInstances() {
XMLSecureFactories xmlSecureFactories = XMLSecureFactories.createDefault();
// As there are casts inside, creation would fail if the appropriate type is not returned
assertThat(xmlSecureFactories.getDocumentBuilderFactory(), notNullValue());
assertThat(xmlSecureFactories.getSAXParserFactory(), notNullValue());
assertThat(xmlSecureFactories.getXMLInputFactory(), notNullValue());
assertThat(xmlSecureFactories.getTransformerFactory(), notNullValue());
}
我想将 smooks 集成到 mule ide 中。我们正在尝试从 webmethods 转移到 mule。我们在 smmoks 中有一个可用的 Edi 转换,我们想使用它。我找到了可以集成到 mul
当使用 Mule Maven 插件在 Mule 独立服务器上部署可部署存档时,我间歇性地收到此错误。 Error : Caused by: org.apache.maven.plugin.MojoEx
mule 线程中的默认线程数是多少。例如,如果我在 mule 中创建了一个 http 连接器并且没有指定接收器线程大小,那么它可以处理的最大并发请求数是多少? 最佳答案 默认值为 16。 这个值和其他
早上好,我正在尝试设置一个属性并访问它。但无法访问属性集。 我试图访问从客户端设置的 SplitterAggregator 中的属性。 以下是骡子配置。 以下是客户
我一直在试图弄清楚,入站终点和出站终点究竟是什么。对我来说,这有点难以理解。 骡子流中的入站和出站端点究竟是什么?如果流想要发送消息,则在接收时应使用哪个端点。或者当应用程序想要调用一个流时,它应该与
我有一个要求,我必须将 JSON 数据从一种格式转换为另一种格式。我必须获取 JSON 数组的相应值,并使它们成为键值对。 以下是所需的详细信息: 输入: "Headers": { "Head
我是 mule soft 的新手。我不知道 mule studio 和 mule esb 有什么区别。这两个软件只是看起来一样。 mule studio 是图形表示,我们也可以通过代码生成。我怎样才能
我正在尝试评估 Mule 提供的一组开箱即用的传输,并将其与来自例如ServiceMix 和 OpenESB。 在 Mule 的主页上,我找到了支持的传输列表: http://www.mulesoft
我创建了一个 mule 应用程序,当我使用 mule 3.5.6 CE 运行它时,它在 anypoint studio 中运行良好,但是当我尝试在 mule-standalone-3.6.1 中部署它
我们需要监控 HornetQ 消息(Jboss 的一部分)——监控是在消息到达队列、消息数量、消息消耗、审核消息有效负载方面。 HornetQ 是否公开 JMX Mbean 来监控这个过程? 作为集成
我有一个执行 XSLT 转换的 Mule 流,我已将我的 XSL 样式表放在 src/main/resources/ 中。当我打包我的应用程序并将其部署到 Mule Standalone 实例时,应用
我有用例,我需要加密 src/main/resources 下的属性文件中显示的值。 Mule 提供了一个名为 Mule Credentials Vault 的概念。在该文档中,我们可以在“Mule
我正在将 Mule 1.3 应用程序升级到 Mule 3.2.1(最新版本)。 Mule 1.3 配置文件有一个“model”元素和许多“mule-descriptor”子元素。
我对 Mule Studio 很陌生。 我正面临一个问题。我需要使用 Mule Studio 将数据从 CSV 文件插入到 PostgreSQL 数据库。 我正在使用 Mule Studio CE(版
一段时间以来,每当我通过图形编辑器保存流程时,mule studio 中总是出现 java.lang.assertionError 错误。如果我直接对 XML 进行更改,我不会收到任何错误。有人遇到过
是否有某种方法可以获取已部署的 mule 应用程序的基本 mule 应用程序名称? 到目前为止我发现的仅有的两个选项是: muleContext.getConfiguration().getId()
我正在尝试将我的输入字段与正则表达式相匹配。但它给出了 mule-expression 错误, regex: ^(?:[1-9][0-9]?(?:\.[0-9]{2})?|100(?:\.0{2})?
我是 Mule 的新手,我想了解独立 mule 与嵌入式 mule 之间的区别。我已经阅读了有关此的主题,但我无法回答一个问题。 Mule standalone 是如何工作的?它如何处理网络服务?它有
我想开始有条件的 mule quartz..例如:在 mule peroperties 文件中,我设置了一个 flag=on。如果该标志打开,那么调度程序将启动。如果该标志关闭,则不会调用 sched
我需要检查 JSON 对象中是否存在特定关键字,并在此基础上创建一个字符串。我的示例 dataweave 2.0 代码如下: %dw 2.0 output application/json var a
我是一名优秀的程序员,十分优秀!