Package org.apache.cxf.common.i18n

Examples of org.apache.cxf.common.i18n.Message


            URIResolver resolver = new URIResolver(null, s, getClass());

            if (resolver.isResolved()) {
                return resolver.getURI().toURL();
            } else {
                throw new ServiceConstructionException(new Message("COULD_NOT_RESOLVE_URL", LOG, s));
            }
        } catch (IOException e) {
            throw new ServiceConstructionException(new Message("COULD_NOT_RESOLVE_URL", LOG, s), e);
        }
    }
View Full Code Here


                       
                        anyList.add(node);
                    }
                }
            } catch (XMLStreamException te) {
                throw new EndpointUtilsException(new Message("COULD_NOT_POPULATE_EPR", LOG),
                                                 te);
            }
        }
    }
View Full Code Here

            BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
            MethodDispatcher md = (MethodDispatcher)
                exchange.get(Service.class).get(MethodDispatcher.class.getName());
            Method m = bop == null ? null : md.getMethod(bop);
            if (m == null && bop == null) {
                LOG.severe(new Message("MISSING_BINDING_OPERATION", LOG).toString());
                throw new Fault(new Message("EXCEPTION_INVOKING_OBJECT", LOG,
                                             "No binding operation info", "unknown method", "unknown"));
            }
            List<Object> params = null;
            if (o instanceof List) {
                params = CastUtils.cast((List<?>)o);
View Full Code Here

        if (checked) {
            return new Fault(ex);
        } else {
            String message = (ex == null) ? "" : ex.getMessage();
            String method = (m == null) ? "<null>" : m.toString();
            return new Fault(new Message("EXCEPTION_INVOKING_OBJECT", LOG,
                                         message, method, params),
                                         ex);
        }
    }
View Full Code Here

            return false;
        }
        reader2.setValidationProblemHandler(new ValidationProblemHandler() {

            public void reportProblem(XMLValidationProblem problem) throws XMLValidationException {
                throw new Fault(new Message("READ_VALIDATION_ERROR", LOG, problem.getMessage()),
                                Fault.FAULT_CODE_CLIENT);
            }
        });
        reader2.validateAgainst(vs);
        return true;
View Full Code Here

        initializeCount++;
        correctThreadContextClassLoader =
            Thread.currentThread().getContextClassLoader()
            == org.apache.cxf.jca.cxf.ManagedConnectionFactoryImpl.class.getClassLoader();
        if (throwException) {
            throw new BusException(new Message("tested bus exception!",
                                               (ResourceBundle)null, new Object[]{}));
        }
        return bus;
       
    }
View Full Code Here

     * @throws ForkedCommandException if process execution fails for some reason
     *             or if the timeout has expired and the process was killed
     */
    public int execute(int timeout) {
        if (null == arguments || arguments.length == 0) {
            throw new ForkedCommandException(new Message("NO_ARGUMENTS_EXC", LOG));
        }
        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Executing command: " + this);
        }
        try {
            Runtime rt = Runtime.getRuntime();
            if (environment == null) {
                proc = rt.exec(arguments);
            } else {
                if (LOG.isLoggable(Level.FINE)) {
                    StringBuilder msg = new StringBuilder();
                    msg.append("Process environment: ");

                    for (int i = 0; i < environment.length; i++) {
                        msg.append(environment[i]);
                        msg.append(" ");
                    }
                    LOG.fine(msg.toString());
                }

                proc = rt.exec(arguments, environment);
            }
        } catch (IOException ex) {
            throw new ForkedCommandException(new Message("EXECUTE_EXC", LOG, this), ex);
        }

        // catch process stderr/stdout
        ForkedCommandStreamHandler cmdOut = new ForkedCommandStreamHandler(proc.getInputStream(),
                                                                           outputStream == null
                                                                               ? System.out : outputStream);
        ForkedCommandStreamHandler cmdErr = new ForkedCommandStreamHandler(proc.getErrorStream(),
                                                                           errorStream == null
                                                                               ? System.err : errorStream);
        cmdErr.start();
        cmdOut.start();

        // now wait for the process on our own thread
        start();

        // kill process after timeout
        try {
            if (timeout > 0) {
                if (LOG.isLoggable(Level.FINE)) {
                    LOG.fine("Waiting " + timeout + " seconds for process to complete");
                }
                join((long)timeout * 1000L);
            } else {
                if (LOG.isLoggable(Level.FINE)) {
                    LOG.fine("Waiting for process to complete");
                }
                join();
            }
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        } finally {
            if (completed) {
                if (LOG.isLoggable(Level.FINE)) {
                    LOG.fine("Process completed in time");
                }
            } else {
                proc.destroy();
                killed = true;
                LOG.fine("Process timed out and was killed");
            }

            // wait for the streams threads to finish if necessary
            if (joinErrOut) {
                if (LOG.isLoggable(Level.FINE)) {
                    LOG.info("Waiting a further 10 seconds for process "
                                 + " stdout/stderr streams to be flushed");
                }
                try {
                    cmdErr.join(10 * 1000);
                    cmdOut.join(10 * 1000);
                } catch (InterruptedException ex) {
                    // silently ignore
                }
            }
        }

        if (killed) {
            throw new ForkedCommandException(new Message("TIMEOUT_EXC", LOG, timeout));
        }
        int exitVal = proc.exitValue();
        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Process exited with value: " + exitVal);
        }
View Full Code Here

    private void processInput(JavaMethod method, MessageInfo inputMessage) throws ToolException {
        if (requireOutOfBandHeader()) {
            try {
                Class.forName("org.apache.cxf.binding.soap.SoapBindingFactory");
            } catch (Exception e) {
                LOG.log(Level.WARNING, new Message("SOAP_MISSING", LOG).toString());
            }
        }

        for (MessagePartInfo part : inputMessage.getMessageParts()) {
            if (isOutOfBandHeader(part) && !requireOutOfBandHeader()) {
View Full Code Here

                serviceFactory.updateBindingOperation(boi);
            }
            return inf;
        } catch (BusException ex) {
            throw new ServiceConstructionException(
                   new Message("COULD.NOT.RESOLVE.BINDING", LOG, bindingId), ex);
        }
    }
View Full Code Here

                    String mimeJavaType = getJavaTypeForMimeType(mPart);
                    if (JavaType.Style.IN.equals(style)) {
                        String paramName = ProcessorUtil.mangleNameToVariableName(mimeContent.getPart());
                        JavaParameter jp = jm.getParameter(paramName);
                        if (jp == null) {
                            Message message = new Message("MIMEPART_CANNOT_MAP", LOG, mimeContent.getPart());
                            throw new ToolException(message);
                        }
                        if (!jp.getClassName().equals(mimeJavaType)) {
                            // jp.setType(mimeJavaType);
                            jp.setClassName(mimeJavaType);
                        }
                    } else if (JavaType.Style.OUT.equals(style)) {
                        JavaType jp = null;
                        if (!"void".equals(jm.getReturn().getType())
                            && mimeContent.getPart().equals(jm.getReturn().getName())) {
                            jp = jm.getReturn();
                            jp.setClassName(mimeJavaType);
                        }



                        if (jp == null) {
                            for (JavaParameter para : jm.getParameters()) {
                                if (mimeContent.getPart().equals(para.getPartName())) {
                                    jp = para;
                                }
                            }
                            if (jp != null) {
                                ((JavaParameter)jp).setClassName(mimeJavaType);
                            }

                        }


                        if (jp == null) {
                            Message message = new Message("MIMEPART_CANNOT_MAP", LOG, mimeContent
                                .getPart());
                            throw new ToolException(message);
                        }
                    }
                } else if (extElement instanceof SOAPHeader) {
View Full Code Here

TOP

Related Classes of org.apache.cxf.common.i18n.Message

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.