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

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

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

Message.toString介绍

暂无

代码示例

代码示例来源: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-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: 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-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

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: 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 Message("ENDPOINTREFERENCE_TYPE_NOT_SUPPORTED",
                       LOG, clazz.getName()).toString());
}

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

private void checkRespectBindingFeature(List<ExtensibilityElement> bindingExtensors) {
  if (bindingExtensors != null) {
    Iterator<ExtensibilityElement> extensionElements = bindingExtensors.iterator();
    while (extensionElements.hasNext()) {
      ExtensibilityElement ext = extensionElements.next();
      if (ext instanceof UnknownExtensibilityElement && Boolean.TRUE.equals(ext.getRequired())
        && this.wsFeatures != null) {
        for (WebServiceFeature feature : this.wsFeatures) {
          if (feature instanceof RespectBindingFeature && feature.isEnabled()) {
            org.apache.cxf.common.i18n.Message message =
              new org.apache.cxf.common.i18n.Message("UNKONWN_REQUIRED_WSDL_BINDING", LOG);
            LOG.severe(message.toString());
            throw new WebServiceException(message.toString());
          }
        }
      }
    }
  }
}

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

protected void finalizeServletInit(ServletConfig servletConfig) throws ServletException {
  InputStream is = getResourceAsStream("/WEB-INF" + STATIC_RESOURCES_MAP_RESOURCE);
  if (is == null) {
    is = getResourceAsStream(STATIC_RESOURCES_MAP_RESOURCE);
  }
  if (is != null) {
    try {
      Properties props = new Properties();
      props.load(is);
      for (String name : props.stringPropertyNames()) {
        staticContentTypes.put(name, props.getProperty(name));
      }
      is.close();
    } catch (IOException ex) {
      String message = new org.apache.cxf.common.i18n.Message("STATIC_RESOURCES_MAP_LOAD_FAILURE",
                                  BUNDLE).toString();
      LOG.warning(message);
    }
  }
}

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

public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
  Class<?> clazz = ClassHelper.getRealClass(getServletBus(), bean);
  if (clazz.isAnnotationPresent(WebService.class)) {
    WebService ws = clazz.getAnnotation(WebService.class);
    String url = urlPrefix + ws.serviceName();
    Message message = new Message("SELECTED_SERVICE", LOG, beanName,
                   clazz.getName(),
                   url);
    LOG.info(message.toString());
    createAndPublishEndpoint(url, bean);
    registerHandler(url, new ServletAdapter(shadowCxfServlet));
  } else {
    Message message = new Message("REJECTED_NO_ANNOTATION", LOG, beanName,
                     clazz.getName());
    LOG.fine(message.toString());
  }
  return bean;
}

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

public EndpointReference readEndpointReference(Source eprInfoset) {
  try {
    final XMLStreamReader reader = StaxUtils.createXMLStreamReader(eprInfoset);
    return AccessController.doPrivileged(new PrivilegedExceptionAction<EndpointReference>() {
      public EndpointReference run() throws Exception {
        Unmarshaller unmarshaller = null;
        try {
          unmarshaller = getJAXBContext().createUnmarshaller();
          return (EndpointReference)unmarshaller.unmarshal(reader);
        } finally {
          try {
            StaxUtils.close(reader);
          } catch (XMLStreamException e) {
            // Ignore
          }
          JAXBUtils.closeUnmarshaller(unmarshaller);
        }
      }
    });
  } catch (PrivilegedActionException pae) {
    Exception e = pae.getException();
    if (e instanceof JAXBException) {
      throw new WebServiceException(new Message("ERROR_UNMARSHAL_ENDPOINTREFERENCE", LOG)
                       .toString(),
                     e);
    }
    throw new SecurityException(e);
  }
}

代码示例来源: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-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

public Endpoint createEndpoint(String bindingId,
                Object implementor,
                WebServiceFeature ... features) {
  EndpointImpl ep = null;
  if (EndpointUtils.isValidImplementor(implementor)) {
    Bus bus = BusFactory.getThreadDefaultBus();
    ep = createEndpointImpl(bus, bindingId, implementor, features);
    return ep;
  }
  throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
}

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

@Override
public Endpoint createEndpoint(String bindingId, Object implementor) {
  Endpoint ep = null;
  if (EndpointUtils.isValidImplementor(implementor)) {
    Bus bus = BusFactory.getThreadDefaultBus();
    ep = createEndpointImpl(bus, bindingId, implementor);
    return ep;
  }
  throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
}
//new in 2.2

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

private QName getPortTypeName(Class<?> serviceEndpointInterface) {
  Class<?> seiClass = serviceEndpointInterface;
  if (!serviceEndpointInterface.isAnnotationPresent(WebService.class)) {
    Message msg = new Message("SEI_NO_WEBSERVICE_ANNOTATION", BUNDLE, serviceEndpointInterface
      .getCanonicalName());
    throw new WebServiceException(msg.toString());
        seiClass = Thread.currentThread().getContextClassLoader().loadClass(epi);
      } catch (ClassNotFoundException e) {
        Message msg = new Message("COULD_NOT_LOAD_CLASS", BUNDLE, epi);
        throw new WebServiceException(msg.toString());
        Message msg = new Message("SEI_NO_WEBSERVICE_ANNOTATION", BUNDLE,
                     seiClass.getCanonicalName());
        throw new WebServiceException(msg.toString());

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

public EndpointReference getEndpointReference(Element... referenceParameters) {
  if (!isPublished()) {
    throw new WebServiceException(new org.apache.cxf.common.i18n.Message("ENDPOINT_NOT_PUBLISHED",
                                       LOG).toString());
  }
  if (getBinding() instanceof HTTPBinding) {
    throw new UnsupportedOperationException(new org.apache.cxf.common.i18n.Message(
                          "GET_ENDPOINTREFERENCE_UNSUPPORTED_BINDING",
                          LOG).toString());
  }
  W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
  builder.address(address);
  builder.serviceName(serviceName);
  builder.endpointName(endpointName);
  if (referenceParameters != null) {
    for (Element referenceParameter : referenceParameters) {
      builder.referenceParameter(referenceParameter);
    }
  }
  builder.wsdlDocumentLocation(wsdlLocation);
  ClassLoader cl = Thread.currentThread().getContextClassLoader();
  try {
    Thread.currentThread().setContextClassLoader(EndpointReferenceBuilder.class.getClassLoader());
    return builder.build();
  } finally {
    Thread.currentThread().setContextClassLoader(cl);
  }
}

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

if (jettyFactory == null && addr != null && addr.startsWith("http")) {
  String m =
    new org.apache.cxf.common.i18n.Message("NO_HTTP_DESTINATION_FACTORY_FOUND",
                        LOG).toString();
  LOG.log(Level.SEVERE, m);
  throw new IOException(m);

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

public Endpoint createEndpoint(String bindingId, Class<?> implementorClass,
                Invoker invoker, WebServiceFeature ... features) {
  if (EndpointUtils.isValidImplementor(implementorClass)) {
    Bus bus = BusFactory.getThreadDefaultBus();
    JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
    if (features != null) {
      factory.getJaxWsServiceFactory().setWsFeatures(Arrays.asList(features));
    }
    if (invoker != null) {
      factory.setInvoker(new JAXWSMethodInvoker(invoker));
      try {
        invoker.inject(new WebServiceContextImpl());
      } catch (Exception e) {
        throw new WebServiceException(new Message("ENDPOINT_CREATION_FAILED_MSG",
                             LOG).toString(), e);
      }
    }
    EndpointImpl ep = new EndpointImpl(bus, null, factory);
    ep.setImplementorClass(implementorClass);
    return ep;
  }
  throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
}

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

throw new WebServiceException(new Message("HANDLER_CFG_FILE_NOT_FOUND_EXC", BUNDLE, hcAnn
  .getFileName()).toString());

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

Message msg = new Message("NO_BINDING_OPERATION_INFO", LOG, method.getName());
throw new WebServiceException(msg.toString());

相关文章