Package org.apache.cxf.logging

Examples of org.apache.cxf.logging.FaultListener


                                }
                                description.append("\' ");
                            }
                        }

                        FaultListener flogger = (FaultListener)
                                message.getContextualProperty(FaultListener.class.getName());
                        boolean useDefaultLogging = true;
                        if (flogger != null) {
                            useDefaultLogging = flogger.faultOccurred(ex, description.toString(), message);
                        }
                        if (useDefaultLogging) {
                            doDefaultLogging(message, ex, description);
                        }
View Full Code Here


    private void setUpCustomLogger(boolean useCustomLogger,
                                   boolean expectFault,
                                   boolean returnFromCustomLogger) {
        if (useCustomLogger) {
            FaultListener customLogger = control.createMock(FaultListener.class);
            message.getContextualProperty(FaultListener.class.getName());
            EasyMock.expectLastCall().andReturn(customLogger);
            if (expectFault) {
                customLogger.faultOccurred(EasyMock.isA(Exception.class),
                                 EasyMock.isA(String.class),
                                 EasyMock.isA(Message.class));
                EasyMock.expectLastCall().andReturn(returnFromCustomLogger);
                if (returnFromCustomLogger) {
                    //default logging should also be invoked
View Full Code Here

                        Exception ex2 = message.getContent(Exception.class);
                        if (ex2 == null) {
                            ex2 = ex;
                        }
                       
                        FaultListener flogger = (FaultListener)
                                message.getContextualProperty(FaultListener.class.getName());
                        boolean useDefaultLogging = true;
                        if (flogger != null) {
                            useDefaultLogging = flogger.faultOccurred(ex2, description.toString(), message);
                        }
                        if (useDefaultLogging) {
                            doDefaultLogging(message, ex2, description);
                        }
                       
View Full Code Here

                        Exception ex2 = message.getContent(Exception.class);
                        if (ex2 == null) {
                            ex2 = ex;
                        }

                        FaultListener flogger = (FaultListener)
                                message.getContextualProperty(FaultListener.class.getName());
                        boolean useDefaultLogging = true;
                        if (flogger != null) {
                            useDefaultLogging = flogger.faultOccurred(ex2, description.toString(), message);
                        }
                        if (useDefaultLogging) {
                            doDefaultLogging(message, ex2, description);
                        }
View Full Code Here

                        Exception ex2 = message.getContent(Exception.class);
                        if (ex2 == null) {
                            ex2 = ex;
                        }
                       
                        FaultListener flogger = (FaultListener)
                                message.getContextualProperty(FaultListener.class.getName());
                        boolean useDefaultLogging = true;
                        if (flogger != null) {
                            useDefaultLogging = flogger.faultOccurred(ex2, description.toString(), message);
                        }
                        if (useDefaultLogging) {
                            doDefaultLogging(message, ex2, description);
                        }
                       
View Full Code Here

                                }
                                description.append("\' ");
                            }
                        }

                        FaultListener flogger = (FaultListener)
                                message.getContextualProperty(FaultListener.class.getName());
                        boolean useDefaultLogging = true;
                        if (flogger != null) {
                            useDefaultLogging = flogger.faultOccurred(ex, description.toString(), message);
                        }
                        if (useDefaultLogging) {
                            doDefaultLogging(message, ex, description);
                        }
View Full Code Here

            r = Response.status(500).type(MediaType.TEXT_PLAIN).entity(errorMsg.toString()).build();
        }
       
       
        Message msg = PhaseInterceptorChain.getCurrentMessage();
        FaultListener flogger = null;
        if (msg != null) {
            flogger = (FaultListener)PhaseInterceptorChain.getCurrentMessage()
                .getContextualProperty(FaultListener.class.getName());
        }
        boolean doDefault = true;
        if (flogger != null) {
            doDefault = flogger.faultOccurred(ex, message, msg);
        }
        if (LOG.isLoggable(Level.FINE) && doDefault) {
            LOG.log(Level.FINE, message, ex);
        }
       
View Full Code Here

                                }
                                description.append("\' ");
                            }
                        }

                        FaultListener flogger = (FaultListener)
                                message.getContextualProperty(FaultListener.class.getName());
                        boolean useDefaultLogging = true;
                        if (flogger != null) {
                            useDefaultLogging = flogger.faultOccurred(ex, description.toString(), message);
                        }
                        if (useDefaultLogging) {
                            doDefaultLogging(message, ex, description);
                        }
View Full Code Here

    private void setUpCustomLogger(boolean useCustomLogger,
                                   boolean expectFault,
                                   boolean returnFromCustomLogger) {
        if (useCustomLogger) {
            FaultListener customLogger = control.createMock(FaultListener.class);
            message.getContextualProperty(FaultListener.class.getName());
            EasyMock.expectLastCall().andReturn(customLogger);
            if (expectFault) {
                customLogger.faultOccurred(EasyMock.isA(Exception.class),
                                 EasyMock.isA(String.class),
                                 EasyMock.isA(Message.class));
                EasyMock.expectLastCall().andReturn(returnFromCustomLogger);
                if (returnFromCustomLogger) {
                    //default logging should also be invoked
View Full Code Here

        }
        boolean doAddMessage = r.getEntity() != null ? false : addMessageToResponse;
       
       
        Message msg = PhaseInterceptorChain.getCurrentMessage();
        FaultListener flogger = null;
        if (msg != null) {
            flogger = (FaultListener)PhaseInterceptorChain.getCurrentMessage()
                .getContextualProperty(FaultListener.class.getName());
        }
        String errorMessage = doAddMessage || flogger != null
            ? buildErrorMessage(r, ex) : null;
        if (flogger == null
            || !flogger.faultOccurred(ex, errorMessage, msg)) {
            Level level = printStackTrace ? Level.WARNING : Level.FINE;
            LOG.log(level, getStackTrace(ex));
        }
       
        if (doAddMessage) {
View Full Code Here

TOP

Related Classes of org.apache.cxf.logging.FaultListener

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.