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

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

本文整理了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

  1. private static JAXBContext getJAXBContext() {
  2. if (jaxbContext == null) {
  3. try {
  4. jaxbContext = JAXBContext.newInstance(W3CEndpointReference.class);
  5. } catch (JAXBException e) {
  6. throw new WebServiceException(new Message("JAXBCONTEXT_CREATION_FAILED", LOG).toString(), e);
  7. }
  8. }
  9. return jaxbContext;
  10. }
  11. }

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

  1. public JaxWsWebServicePublisherBeanPostProcessor() throws SecurityException,
  2. NoSuchMethodException, ClassNotFoundException {
  3. try {
  4. servletClass = ClassLoaderUtils.loadClass(CXF_SERVLET_CLASS_NAME, getClass());
  5. } catch (ClassNotFoundException e) {
  6. Message message = new Message("SERVLET_CLASS_MISSING", LOG, CXF_SERVLET_CLASS_NAME);
  7. LOG.severe(message.toString());
  8. throw e;
  9. }
  10. servletGetBusMethod = servletClass.getMethod("getBus");
  11. }

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

  1. private HttpServletResponse getHttpResponseFromMessage(Message message) throws IOException {
  2. Object responseObj = message.get(HTTP_RESPONSE);
  3. if (responseObj instanceof HttpServletResponse) {
  4. return (HttpServletResponse)responseObj;
  5. } else if (null != responseObj) {
  6. String m = (new org.apache.cxf.common.i18n.Message("UNEXPECTED_RESPONSE_TYPE_MSG",
  7. LOG, responseObj.getClass())).toString();
  8. LOG.log(Level.WARNING, m);
  9. throw new IOException(m);
  10. } else {
  11. String m = (new org.apache.cxf.common.i18n.Message("NULL_RESPONSE_MSG", LOG)).toString();
  12. LOG.log(Level.WARNING, m);
  13. throw new IOException(m);
  14. }
  15. }

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

  1. public void setRegistry(DestinationRegistry newRegistry) {
  2. w.lock();
  3. try {
  4. if (registry.getDestinations().isEmpty()) {
  5. this.registry = newRegistry;
  6. } else {
  7. String m = new org.apache.cxf.common.i18n.Message("CANNOT_CHANGE_REGISTRY_ALREADY_IN_USE",
  8. LOG).toString();
  9. LOG.log(Level.SEVERE, m);
  10. throw new RuntimeException(m);
  11. }
  12. } finally {
  13. w.unlock();
  14. }
  15. }

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

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

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

  1. public <T extends EndpointReference> T getEndpointReference(Class<T> clazz,
  2. Element... referenceParameters) {
  3. if (W3CEndpointReference.class.isAssignableFrom(clazz)) {
  4. return clazz.cast(getEndpointReference(referenceParameters));
  5. }
  6. throw new WebServiceException(new Message("ENDPOINTREFERENCE_TYPE_NOT_SUPPORTED",
  7. LOG, clazz.getName()).toString());
  8. }

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

  1. private void checkRespectBindingFeature(List<ExtensibilityElement> bindingExtensors) {
  2. if (bindingExtensors != null) {
  3. Iterator<ExtensibilityElement> extensionElements = bindingExtensors.iterator();
  4. while (extensionElements.hasNext()) {
  5. ExtensibilityElement ext = extensionElements.next();
  6. if (ext instanceof UnknownExtensibilityElement && Boolean.TRUE.equals(ext.getRequired())
  7. && this.wsFeatures != null) {
  8. for (WebServiceFeature feature : this.wsFeatures) {
  9. if (feature instanceof RespectBindingFeature && feature.isEnabled()) {
  10. org.apache.cxf.common.i18n.Message message =
  11. new org.apache.cxf.common.i18n.Message("UNKONWN_REQUIRED_WSDL_BINDING", LOG);
  12. LOG.severe(message.toString());
  13. throw new WebServiceException(message.toString());
  14. }
  15. }
  16. }
  17. }
  18. }
  19. }

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

  1. protected void finalizeServletInit(ServletConfig servletConfig) throws ServletException {
  2. InputStream is = getResourceAsStream("/WEB-INF" + STATIC_RESOURCES_MAP_RESOURCE);
  3. if (is == null) {
  4. is = getResourceAsStream(STATIC_RESOURCES_MAP_RESOURCE);
  5. }
  6. if (is != null) {
  7. try {
  8. Properties props = new Properties();
  9. props.load(is);
  10. for (String name : props.stringPropertyNames()) {
  11. staticContentTypes.put(name, props.getProperty(name));
  12. }
  13. is.close();
  14. } catch (IOException ex) {
  15. String message = new org.apache.cxf.common.i18n.Message("STATIC_RESOURCES_MAP_LOAD_FAILURE",
  16. BUNDLE).toString();
  17. LOG.warning(message);
  18. }
  19. }
  20. }

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

  1. public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
  2. Class<?> clazz = ClassHelper.getRealClass(getServletBus(), bean);
  3. if (clazz.isAnnotationPresent(WebService.class)) {
  4. WebService ws = clazz.getAnnotation(WebService.class);
  5. String url = urlPrefix + ws.serviceName();
  6. Message message = new Message("SELECTED_SERVICE", LOG, beanName,
  7. clazz.getName(),
  8. url);
  9. LOG.info(message.toString());
  10. createAndPublishEndpoint(url, bean);
  11. registerHandler(url, new ServletAdapter(shadowCxfServlet));
  12. } else {
  13. Message message = new Message("REJECTED_NO_ANNOTATION", LOG, beanName,
  14. clazz.getName());
  15. LOG.fine(message.toString());
  16. }
  17. return bean;
  18. }

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

  1. public EndpointReference readEndpointReference(Source eprInfoset) {
  2. try {
  3. final XMLStreamReader reader = StaxUtils.createXMLStreamReader(eprInfoset);
  4. return AccessController.doPrivileged(new PrivilegedExceptionAction<EndpointReference>() {
  5. public EndpointReference run() throws Exception {
  6. Unmarshaller unmarshaller = null;
  7. try {
  8. unmarshaller = getJAXBContext().createUnmarshaller();
  9. return (EndpointReference)unmarshaller.unmarshal(reader);
  10. } finally {
  11. try {
  12. StaxUtils.close(reader);
  13. } catch (XMLStreamException e) {
  14. // Ignore
  15. }
  16. JAXBUtils.closeUnmarshaller(unmarshaller);
  17. }
  18. }
  19. });
  20. } catch (PrivilegedActionException pae) {
  21. Exception e = pae.getException();
  22. if (e instanceof JAXBException) {
  23. throw new WebServiceException(new Message("ERROR_UNMARSHAL_ENDPOINTREFERENCE", LOG)
  24. .toString(),
  25. e);
  26. }
  27. throw new SecurityException(e);
  28. }
  29. }

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

  1. private String setEncoding(final Message inMessage,
  2. final HttpServletRequest req,
  3. final String contentType) throws IOException {
  4. String enc = HttpHeaderHelper.findCharset(contentType);
  5. if (enc == null) {
  6. enc = req.getCharacterEncoding();
  7. }
  8. // work around a bug with Jetty which results in the character
  9. // encoding not being trimmed correctly.
  10. if (enc != null && enc.endsWith("\"")) {
  11. enc = enc.substring(0, enc.length() - 1);
  12. }
  13. if (enc != null || "POST".equals(req.getMethod()) || "PUT".equals(req.getMethod())) {
  14. //allow gets/deletes/options to not specify an encoding
  15. String normalizedEncoding = HttpHeaderHelper.mapCharset(enc);
  16. if (normalizedEncoding == null) {
  17. String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG",
  18. LOG, enc).toString();
  19. LOG.log(Level.WARNING, m);
  20. throw new IOException(m);
  21. }
  22. inMessage.put(Message.ENCODING, normalizedEncoding);
  23. }
  24. return contentType;
  25. }
  26. protected Message retrieveFromContinuation(HttpServletRequest req) {

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

  1. @Override
  2. public String getId(Map<String, Object> context) {
  3. String id = null;
  4. if (isMultiplexWithAddress()) {
  5. String address = (String)context.get(Message.PATH_INFO);
  6. if (null != address) {
  7. int afterLastSlashIndex = address.lastIndexOf("/") + 1;
  8. if (afterLastSlashIndex > 0
  9. && afterLastSlashIndex < address.length()) {
  10. id = address.substring(afterLastSlashIndex);
  11. }
  12. } else {
  13. getLogger().log(Level.WARNING,
  14. new org.apache.cxf.common.i18n.Message(
  15. "MISSING_PATH_INFO", LOG).toString());
  16. }
  17. } else {
  18. return super.getId(context);
  19. }
  20. return id;
  21. }

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

  1. public Endpoint createEndpoint(String bindingId,
  2. Object implementor,
  3. WebServiceFeature ... features) {
  4. EndpointImpl ep = null;
  5. if (EndpointUtils.isValidImplementor(implementor)) {
  6. Bus bus = BusFactory.getThreadDefaultBus();
  7. ep = createEndpointImpl(bus, bindingId, implementor, features);
  8. return ep;
  9. }
  10. throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
  11. }

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

  1. @Override
  2. public Endpoint createEndpoint(String bindingId, Object implementor) {
  3. Endpoint ep = null;
  4. if (EndpointUtils.isValidImplementor(implementor)) {
  5. Bus bus = BusFactory.getThreadDefaultBus();
  6. ep = createEndpointImpl(bus, bindingId, implementor);
  7. return ep;
  8. }
  9. throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
  10. }
  11. //new in 2.2

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

  1. private QName getPortTypeName(Class<?> serviceEndpointInterface) {
  2. Class<?> seiClass = serviceEndpointInterface;
  3. if (!serviceEndpointInterface.isAnnotationPresent(WebService.class)) {
  4. Message msg = new Message("SEI_NO_WEBSERVICE_ANNOTATION", BUNDLE, serviceEndpointInterface
  5. .getCanonicalName());
  6. throw new WebServiceException(msg.toString());
  7. seiClass = Thread.currentThread().getContextClassLoader().loadClass(epi);
  8. } catch (ClassNotFoundException e) {
  9. Message msg = new Message("COULD_NOT_LOAD_CLASS", BUNDLE, epi);
  10. throw new WebServiceException(msg.toString());
  11. Message msg = new Message("SEI_NO_WEBSERVICE_ANNOTATION", BUNDLE,
  12. seiClass.getCanonicalName());
  13. throw new WebServiceException(msg.toString());

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

  1. public EndpointReference getEndpointReference(Element... referenceParameters) {
  2. if (!isPublished()) {
  3. throw new WebServiceException(new org.apache.cxf.common.i18n.Message("ENDPOINT_NOT_PUBLISHED",
  4. LOG).toString());
  5. }
  6. if (getBinding() instanceof HTTPBinding) {
  7. throw new UnsupportedOperationException(new org.apache.cxf.common.i18n.Message(
  8. "GET_ENDPOINTREFERENCE_UNSUPPORTED_BINDING",
  9. LOG).toString());
  10. }
  11. W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
  12. builder.address(address);
  13. builder.serviceName(serviceName);
  14. builder.endpointName(endpointName);
  15. if (referenceParameters != null) {
  16. for (Element referenceParameter : referenceParameters) {
  17. builder.referenceParameter(referenceParameter);
  18. }
  19. }
  20. builder.wsdlDocumentLocation(wsdlLocation);
  21. ClassLoader cl = Thread.currentThread().getContextClassLoader();
  22. try {
  23. Thread.currentThread().setContextClassLoader(EndpointReferenceBuilder.class.getClassLoader());
  24. return builder.build();
  25. } finally {
  26. Thread.currentThread().setContextClassLoader(cl);
  27. }
  28. }

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

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

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

  1. public Endpoint createEndpoint(String bindingId, Class<?> implementorClass,
  2. Invoker invoker, WebServiceFeature ... features) {
  3. if (EndpointUtils.isValidImplementor(implementorClass)) {
  4. Bus bus = BusFactory.getThreadDefaultBus();
  5. JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
  6. if (features != null) {
  7. factory.getJaxWsServiceFactory().setWsFeatures(Arrays.asList(features));
  8. }
  9. if (invoker != null) {
  10. factory.setInvoker(new JAXWSMethodInvoker(invoker));
  11. try {
  12. invoker.inject(new WebServiceContextImpl());
  13. } catch (Exception e) {
  14. throw new WebServiceException(new Message("ENDPOINT_CREATION_FAILED_MSG",
  15. LOG).toString(), e);
  16. }
  17. }
  18. EndpointImpl ep = new EndpointImpl(bus, null, factory);
  19. ep.setImplementorClass(implementorClass);
  20. return ep;
  21. }
  22. throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
  23. }

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

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

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

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

相关文章