gpt4 book ai didi

mx4j.tools.adaptor.http.XSLTProcessor类的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 06:21:05 25 4
gpt4 key购买 nike

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

XSLTProcessor介绍

[英]XSLTPostProcessor pass the document through an XSLT transformation
[中]XSLTPostProcessor通过XSLT转换传递文档

代码示例

代码示例来源:origin: apache/geode

/**
 * Defines and starts the Xslt Processor helper service for the Http Adaptor.
 */
private ObjectName createXsltProcessor() throws javax.management.JMException {
 ObjectName objName = getXsltProcessorName();
 // make sure this mbean is not already registered...
 if (getMBeanServer().isRegistered(objName)) {
  // dunno how we got here...
  logger.info("XsltProcessor already registered as  {}", objName);
  return objName;
 }
 getMBeanServer().registerMBean(new mx4j.tools.adaptor.http.XSLTProcessor(), objName);
 return objName;
}

代码示例来源:origin: org.mule.modules/mule-module-management

protected HttpAdaptor createAdaptor() throws Exception
{
  Log.redirectTo(new CommonsLogger());
  URI uri = new URI(StringUtils.stripToEmpty(jmxAdaptorUrl));
  adaptor = new HttpAdaptor(uri.getPort(), uri.getHost());
  XSLTProcessor processor = new XSLTProcessor();
  if (StringUtils.isNotBlank(xslFilePath))
  {
    processor.setFile(xslFilePath.trim());
  }
  if (StringUtils.isNotBlank(pathInJar))
  {
    processor.setPathInJar(pathInJar.trim());
  }
  processor.setUseCache(cacheXsl);
  adaptor.setProcessor(processor);
  // Set endpoint authentication if required
  if (login != null)
  {
    adaptor.addAuthorization(login, password);
    adaptor.setAuthenticationMethod(authenticationMethod);
  }
  if (socketFactoryProperties != null && !socketFactoryProperties.isEmpty())
  {
    SSLAdaptorServerSocketFactoryMBean factory = new SSLAdaptorServerSocketFactory();
    BeanUtils.populateWithoutFail(factory, socketFactoryProperties, true);
    adaptor.setSocketFactory(factory);
  }
  return adaptor;
}

代码示例来源:origin: org.objectweb.petals/petals-kernel

XSLTProcessor processor = new XSLTProcessor();
processor.setDefaultPage("petals");
processor
    .setPathInJar("org/objectweb/petals/kernel/fractal/mx4j/xsl");
processor.setUseCache(false);
adminAttributes.getRawMBeanServer().registerMBean(processor,
    processorName);

代码示例来源:origin: mx4j/mx4j-tools

public void writeResponse(HttpOutputStream out, HttpInputStream in, Document document) throws IOException
 Logger log = getLogger();
 out.sendHeaders();
 Transformer transformer = null;
 String path = preProcess(in.getPath());
   transformer = createTransformer(in.getVariable("template") + ".xsl");
   transformer = createTransformer(path + ".xsl");

代码示例来源:origin: mx4j/mx4j-tools

protected Transformer createTransformer(String path)
 Logger logger = getLogger();
 try
      InputStream stream = getInputStream(path);
      if (stream != null)

代码示例来源:origin: mx4j/mx4j-tools

protected void processHttpException(HttpInputStream in, HttpOutputStream out, HttpException e) throws IOException
{
 out.setCode(e.getCode());
 out.setHeader("Content-Type", "text/html");
 out.sendHeaders();
 // hardcoded dir :-P
 Transformer transformer = createTransformer("error.xsl");
 transformer.setURIResolver(this);
 Document doc = e.getResponseDoc();
 if (doc != null)
 {
   try
   {
    if (!in.getVariables().containsKey("locale"))
    {
      transformer.setParameter("request.locale", locale.toString());
    }
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    transformer.transform(new DOMSource(doc), new StreamResult(output));
    output.writeTo(out);
   }
   catch (TransformerException ex)
   {
    Logger log = getLogger();
    log.error("Exception during error output", ex);
   }
 }
}

代码示例来源:origin: mx4j/mx4j-tools

public void writeError(HttpOutputStream out, HttpInputStream in, Exception e) throws IOException
{
 Logger log = getLogger();
 Exception t = e;
 if (e instanceof RuntimeMBeanException)
 {
   t = ((RuntimeMBeanException)e).getTargetException();
 }
 if (log.isEnabledFor(Logger.DEBUG)) log.debug("Processing error " + t.getMessage());
 if (t instanceof HttpException)
 {
   processHttpException(in, out, (HttpException)t);
 }
 else if ((t instanceof MBeanException) && (((MBeanException)t).getTargetException() instanceof HttpException))
 {
   processHttpException(in, out, (HttpException)((MBeanException)t).getTargetException());
 }
 else if ((t instanceof ReflectionException) && (((ReflectionException)t).getTargetException() instanceof HttpException))
 {
   processHttpException(in, out, (HttpException)((ReflectionException)t).getTargetException());
 }
 else
 {
   out.setCode(HttpConstants.STATUS_INTERNAL_ERROR);
   out.setHeader("Content-Type", "text/html");
   out.sendHeaders();
 }
}

代码示例来源:origin: mx4j/mx4j-tools

public void addMimeType(String extension, String type)
{
 if (extension != null && type != null)
 {
   Logger log = getLogger();
   if (log.isEnabledFor(Logger.DEBUG)) log.debug("Added MIME type " + type + " for extension " + extension);
   mimeTypes.put(extension, type);
 }
}

代码示例来源:origin: mx4j/mx4j-tools

public Source resolve(String href, String base)
{
 StreamSource source = new StreamSource(getInputStream(href));
 // this works with saxon7/saxon6.5.2/xalan
 source.setSystemId(href);
 return source;
}

代码示例来源:origin: mx4j/mx4j-tools

public String notFoundElement(String path, HttpOutputStream out, HttpInputStream in) throws IOException, HttpException
 Logger log = getLogger();
   BufferedInputStream fileIn = new BufferedInputStream(getInputStream(path));
   ByteArrayOutputStream outArray = new ByteArrayOutputStream();
   BufferedOutputStream outBuffer = new BufferedOutputStream(outArray);

代码示例来源:origin: mx4j/mx4j-tools

Logger log = getLogger();
log.error("File not found", e);

代码示例来源:origin: org.apache.geode/gemfire-core

/**
 * Defines and starts the Xslt Processor helper service for the Http Adaptor.
 */
private ObjectName createXsltProcessor()
throws javax.management.JMException {
 ObjectName objName = getXsltProcessorName();
 // make sure this mbean is not already registered...
 if (getMBeanServer().isRegistered(objName)) {
  // dunno how we got here...
  logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_XSLTPROCESSOR_ALREADY_REGISTERED_AS__0, objName));
  return objName;
 }
 getMBeanServer().registerMBean(
  new mx4j.tools.adaptor.http.XSLTProcessor(), objName);
 return objName;
}

代码示例来源:origin: mx4j/mx4j-tools

Logger log = getLogger();

代码示例来源:origin: com.github.kaitoy.sneo/sneo-core

server.registerMBean(adaptor, ADAPTOR_NAME);
XSLTProcessor xsltProcessor = new XSLTProcessor();
server.registerMBean(xsltProcessor, PROCESSOR_NAME);

代码示例来源:origin: io.snappydata/gemfire-core

/**
 * Defines and starts the Xslt Processor helper service for the Http Adaptor.
 */
private ObjectName createXsltProcessor()
throws javax.management.JMException {
 ObjectName objName = getXsltProcessorName();
 // make sure this mbean is not already registered...
 if (getMBeanServer().isRegistered(objName)) {
  // dunno how we got here...
  getLogWriterI18n().info(LocalizedStrings.AgentImpl_XSLTPROCESSOR_ALREADY_REGISTERED_AS__0, objName);
  return objName;
 }
 getMBeanServer().registerMBean(
  new mx4j.tools.adaptor.http.XSLTProcessor(), objName);
 return objName;
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com