org.apache.cxf.common.i18n.Message.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(121)

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

Message.<init>介绍

[英]Constructor.
[中]建造师。

代码示例

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

private static JAXBContext getJAXBContext() {
    if (jaxbContext == null) {
      try {
        jaxbContext = JAXBContext.newInstance(W3CEndpointReference.class);
      } catch (JAXBException e) {
        throw new WebServiceException(new Message("JAXBCONTEXT_CREATION_FAILED", LOG).toString(), e);
      }
    }
    return jaxbContext;
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

private HttpServletResponse getHttpResponseFromMessage(Message message) throws IOException {
  Object responseObj = message.get(HTTP_RESPONSE);
  if (responseObj instanceof HttpServletResponse) {
    return (HttpServletResponse)responseObj;
  } else if (null != responseObj) {
    String m = (new org.apache.cxf.common.i18n.Message("UNEXPECTED_RESPONSE_TYPE_MSG",
        LOG, responseObj.getClass())).toString();
    LOG.log(Level.WARNING, m);
    throw new IOException(m);
  } else {
    String m = (new org.apache.cxf.common.i18n.Message("NULL_RESPONSE_MSG", LOG)).toString();
    LOG.log(Level.WARNING, m);
    throw new IOException(m);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

message.setContent(Source.class, new StreamSource(cos.getInputStream()));
  } catch (Exception e) {
    throw new Fault(e);
    in.close();
  } catch (Exception e) {
    throw new Fault(e);
  source = obj;
} else if (message.getContent(DataSource.class) != null) {
  throw new Fault(new org.apache.cxf.common.i18n.Message(
            "GETPAYLOAD_OF_DATASOURCE_NOT_VALID_XMLHTTPBINDING",
            LOG));

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

public void init() throws ToolException {
  // initialize
  if (toolspec == null) {
    Message message = new Message("TOOLSPEC_NOT_INITIALIZED", LOG);
    LOG.log(Level.SEVERE, message.toString());
    throw new ToolException(message);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

throw new Fault(new org.apache.cxf.common.i18n.Message("INVOCATION_TARGET_EXC", BUNDLE), e);
} catch (IllegalAccessException | IllegalArgumentException e) {
  throw new Fault(new org.apache.cxf.common.i18n.Message("COULD_NOT_INVOKE", BUNDLE), e);
    LOG.log(Level.WARNING, "EXCEPTION_WHILE_WRITING_FAULT", nex);

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

protected void initializeWSDLOperationsForProvider() {
  Class<?> c = getProviderParameterType(getServiceClass());
  if (c == null) {
    throw new ServiceConstructionException(new Message("INVALID_PROVIDER_EXC", LOG));
    LOG.log(Level.WARNING, "COULD_NOT_FIND_ENDPOINT",
        new Object[] {getEndpointName(), enames});

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

public FrontEnd getFrontEnd(String name) {
  FrontEnd frontend = frontends.get(name);
  if (frontend == null) {
    Message msg = new Message("FRONTEND_MISSING", LOG, name);
    throw new ToolException(msg);
  }
  return frontend;
}

代码示例来源:origin: org.apache.cxf/cxf-tools-common

public void init() throws ToolException {
  // initialize
  if (toolspec == null) {
    Message message = new Message("TOOLSPEC_NOT_INITIALIZED", LOG);
    LOG.log(Level.SEVERE, message.toString());
    throw new ToolException(message);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

public void setRegistry(DestinationRegistry newRegistry) {
  w.lock();
  try {
    if (registry.getDestinations().isEmpty()) {
      this.registry = newRegistry;
    } else {
      String m = new org.apache.cxf.common.i18n.Message("CANNOT_CHANGE_REGISTRY_ALREADY_IN_USE",
                               LOG).toString();
      LOG.log(Level.SEVERE, m);
      throw new RuntimeException(m);
    }
  } finally {
    w.unlock();
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

throw new Fault(new org.apache.cxf.common.i18n.Message("ATTACHMENT_NOT_SUPPORTED",
                            LOG, o.getClass()));

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

public <T extends EndpointReference> T getEndpointReference(Class<T> clazz,
                              Element... referenceParameters) {
  if (W3CEndpointReference.class.isAssignableFrom(clazz)) {
    return clazz.cast(getEndpointReference(referenceParameters));
  }
  throw new WebServiceException(new org.apache.cxf.common.i18n.Message(
    "ENDPOINTREFERENCE_TYPE_NOT_SUPPORTED", LOG, clazz
    .getName()).toString());
}

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

public WSDLExtensibilityPlugin getWSDLPlugin(final String key, final Class<?> clz) {
  StringBuilder sb = new StringBuilder();
  sb.append(key);
  sb.append("-");
  sb.append(clz.getName());
  WSDLExtensibilityPlugin plugin = wsdlPlugins.get(sb.toString());
  if (plugin == null) {
    throw new ToolException(new Message("FOUND_NO_WSDL_PLUGIN", LOG, sb.toString(), clz));
  }
  return plugin;
}

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

private AbstractWSDLBuilder loadBuilder(String fullClzName) {
  AbstractWSDLBuilder builder = null;
  try {
    builder = (AbstractWSDLBuilder) ClassLoaderUtils
      .loadClass(fullClzName, getClass()).newInstance();
  } catch (Exception e) {
    Message msg = new Message("LOAD_PROCESSOR_FAILED", LOG, fullClzName);
    LOG.log(Level.SEVERE, msg.toString());
    throw new ToolException(msg, e);
  }
  return builder;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

private String setEncoding(final Message inMessage,
              final HttpServletRequest req,
              final String contentType) throws IOException {
  String enc = HttpHeaderHelper.findCharset(contentType);
  if (enc == null) {
    enc = req.getCharacterEncoding();
  }
  // work around a bug with Jetty which results in the character
  // encoding not being trimmed correctly.
  if (enc != null && enc.endsWith("\"")) {
    enc = enc.substring(0, enc.length() - 1);
  }
  if (enc != null || "POST".equals(req.getMethod()) || "PUT".equals(req.getMethod())) {
    //allow gets/deletes/options to not specify an encoding
    String normalizedEncoding = HttpHeaderHelper.mapCharset(enc);
    if (normalizedEncoding == null) {
      String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG",
                               LOG, enc).toString();
      LOG.log(Level.WARNING, m);
      throw new IOException(m);
    }
    inMessage.put(Message.ENCODING, normalizedEncoding);
  }
  return contentType;
}
protected Message retrieveFromContinuation(HttpServletRequest req) {

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

@Override
public Boolean isWrapped(Method m) {
  // see if someone overrode the default value
  if (getServiceFactory().getWrapped() != null) {
    return getServiceFactory().getWrapped();
  }
  m = getDeclaredMethod(m);
  SOAPBinding ann = m.getAnnotation(SOAPBinding.class);
  if (ann != null) {
    if (ann.style().equals(Style.RPC)) {
      Message message = new Message("SOAPBinding_MESSAGE_RPC", LOG, m.getName());
      throw new Fault(new JaxWsConfigurationException(message));
    }
    return !(ann.parameterStyle().equals(ParameterStyle.BARE));
  }
  return isWrapped();
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

public JaxWsWebServicePublisherBeanPostProcessor() throws SecurityException,
    NoSuchMethodException, ClassNotFoundException {
  try {
    servletClass = ClassLoaderUtils.loadClass(CXF_SERVLET_CLASS_NAME, getClass());
  } catch (ClassNotFoundException e) {
    Message message = new Message("SERVLET_CLASS_MISSING", LOG, CXF_SERVLET_CLASS_NAME);
    LOG.severe(message.toString());
    throw e;
  }
  servletGetBusMethod = servletClass.getMethod("getBus");
}

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

public FileWriterUtil(String targetDir, OutputStreamCreator osc) throws ToolException {
  target = new File(targetDir);
  this.osc = osc == null ? new OutputStreamCreator() : osc;
  if (!(target.exists()) || !(target.isDirectory())) {
    Message msg = new Message("DIRECTORY_NOT_EXIST", LOG, target);
    throw new ToolException(msg);
  }
}

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

private DataBindingProfile loadDataBindingProfile(String fullClzName) {
  DataBindingProfile profile = null;
  try {
    profile = (DataBindingProfile)ClassLoaderUtils.loadClass(fullClzName,
                                 getClass()).newInstance();
  } catch (Exception e) {
    Message msg = new Message("DATABINDING_PROFILE_LOAD_FAIL", LOG, fullClzName);
    LOG.log(Level.SEVERE, msg.toString());
    throw new ToolException(msg);
  }
  return profile;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

@Override
public String getId(Map<String, Object> context) {
  String id = null;
  if (isMultiplexWithAddress()) {
    String address = (String)context.get(Message.PATH_INFO);
    if (null != address) {
      int afterLastSlashIndex = address.lastIndexOf("/") + 1;
      if (afterLastSlashIndex > 0
          && afterLastSlashIndex < address.length()) {
        id = address.substring(afterLastSlashIndex);
      }
    } else {
      getLogger().log(Level.WARNING,
        new org.apache.cxf.common.i18n.Message(
            "MISSING_PATH_INFO", LOG).toString());
    }
  } else {
    return super.getId(context);
  }
  return id;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

throw new Fault(new org.apache.cxf.common.i18n.Message("CANNOT_SET_HOLDER_OBJECTS", LOG));

相关文章