Package flex.messaging.log

Examples of flex.messaging.log.Logger


            if (data instanceof String)
            {
                String requestString = (String)data;
                if (Log.isInfo())
                {
                    Logger logger = Log.getLogger(HTTPProxyService.LOG_CATEGORY);
                    logger.debug(BEGIN + method + REQUEST);
                    logger.debug(StringUtils.prettifyString(requestString));
                    logger.debug(END + method + REQUEST);
                }

                try
                {
                    StringRequestEntity requestEntity = new StringRequestEntity(requestString, null, "UTF-8");
                    ((EntityEnclosingMethod)httpMethod).setRequestEntity(requestEntity);
                }
                catch (UnsupportedEncodingException ex)
                {
                    ProxyException pe = new ProxyException(CAUGHT_ERROR);
                    pe.setDetails(CAUGHT_ERROR, "1", new Object[] { ex });
                    throw pe;
                }
            }
            else if (dataClass.isArray() && Byte.TYPE.equals(dataClass.getComponentType()))
            {
                byte[] dataBytes = (byte[])data;
                ByteArrayRequestEntity requestEntity = new ByteArrayRequestEntity(dataBytes, context.getContentType());
                ((EntityEnclosingMethod)httpMethod).setRequestEntity(requestEntity);
            }
            else if (data instanceof InputStream)
            {
                InputStreamRequestEntity requestEntity = new InputStreamRequestEntity((InputStream)data, context.getContentType());
                ((EntityEnclosingMethod)httpMethod).setRequestEntity(requestEntity);
            }
            //TODO: Support multipart post
            //else
            //{
                //FIXME: Throw exception if unhandled data type
            //}
        }
        else if (httpMethod instanceof GetMethod)
        {
            Object req = processBody(context);

            if (req instanceof String)
            {
                String requestString = (String)req;
                if (Log.isInfo())
                {
                    Logger logger = Log.getLogger(HTTPProxyService.LOG_CATEGORY);
                    logger.debug(BEGIN + method + REQUEST);
                    logger.debug(StringUtils.prettifyString(requestString));
                    logger.debug(END + method + REQUEST);
                }

                if (!"".equals(requestString))
                {
                    String query = context.getHttpMethod().getQueryString();
View Full Code Here


                SerializationContext context = getSerializationContext();

                // Log failed property set errors
                if (Log.isWarn() && logPropertyErrors(context))
                {
                    Logger log = Log.getLogger(LOG_CATEGORY);
                    log.warn("Failed to get property {0} on type {1}.",
                             new Object[] {propertyName, getAlias(instance)}, e);
                }

                if (!ignorePropertyErrors(context))
                {
View Full Code Here

                    SerializationContext context = getSerializationContext();

                    // Log ignore failed property set errors
                    if (Log.isWarn() && logPropertyErrors(context))
                    {
                        Logger log = Log.getLogger(LOG_CATEGORY);
                        log.warn("Failed to set property {0} on type {1}.",
                                new Object[] {propertyName, getAlias(instance)}, e);
                    }

                    if (!ignorePropertyErrors(context))
                    {
                        // Failed to get property '{propertyName}' on type '{className}'.
                        MessageException ex = new MessageException();
                        ex.setMessage(FAILED_PROPERTY_WRITE_ERROR, new Object[] {propertyName, getAlias(instance)});
                        ex.setRootCause(e);
                        throw ex;
                    }
                }
            }
            else
            {
                SerializationContext context = getSerializationContext();

                if (Log.isWarn() && logPropertyErrors(context))
                {
                    Logger log = Log.getLogger(LOG_CATEGORY);
                    log.warn("Property {0} not writable on class {1}",
                            new Object[] {propertyName, getAlias(instance)});
                }

                if (!ignorePropertyErrors(context))
                {
                    //Property '{propertyName}' not writable on class '{alias}'.
                    MessageException ex = new MessageException();
                    ex.setMessage(NON_WRITABLE_PROPERTY_ERROR, new Object[] {propertyName, getAlias(instance)});
                    throw ex;
                }
            }
        }
        else
        {
            SerializationContext context = getSerializationContext();

            if (Log.isWarn() && logPropertyErrors(context))
            {
                Logger log = Log.getLogger(LOG_CATEGORY);
                log.warn("Ignoring set property {0} for type {1} as a setter could not be found.",
                            new Object[] {propertyName, getAlias(instance)});
            }

            if (!ignorePropertyErrors(context))
            {
View Full Code Here

        catch (IntrospectionException ex)
        {
            // Log failed property set errors
            if (Log.isError())
            {
                Logger log = Log.getLogger(LOG_CATEGORY);
                log.error("Failed to introspect object of type: " + c + " error: " + ExceptionUtil.toString(ex));
            }

            // Return an empty descriptor rather than crashing
            pce = new PropertyDescriptorCacheEntry();
            pce.propertyDescriptors = new PropertyDescriptor[0];
View Full Code Here

            setupInternalPathResolver();

            // Set initial servlet context on broker
            broker.setInitServletContext(servletConfig.getServletContext());

            Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
            if (Log.isInfo())
            {
                logger.info(VersionInfo.buildMessage());
            }

            // Create endpoints, services, security, and logger on the broker based on configuration
            config.configureBroker(broker);
View Full Code Here

        }
        catch (CloneNotSupportedException e)
        {
            if (Log.isError())
            {
                Logger log = Log.getLogger(LOG_CATEGORY);
                log.error("Failed to clone a property proxy: " + toString());
            }
            MessageException ex = new MessageException();
            ex.setMessage(CONVERSION_ERROR);
            throw ex;           
        }
View Full Code Here

                    else
                    {
                        // Log null key errors
                        if (Log.isWarn() && context.logPropertyErrors)
                        {
                            Logger log = Log.getLogger(LOG_CATEGORY);
                            log.warn("Cannot send a null Map key for type {0}.",
                                    new Object[] {map.getClass().getName()});
                        }

                        if (!context.ignorePropertyErrors)
                        {
View Full Code Here

                        {
                            resolvedWatches.add(new WatchedObject(resolvedPath));
                        }
                        catch (FileNotFoundException fnfe)
                        {
                            Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                            if (logger != null)
                            {
                                logger.warn("The watch-file, " + path + ", could not be found and will be ignored.");
                            }
                        }
                    }
                    else
                    {
                        Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                        logger.warn("The watch-file, " + path + ", could not be resolved to a path and will be ignored.");
                    }
                }
                else
                {
                    try
                    {
                        resolvedWatches.add(new WatchedObject(path));
                    }
                    catch (FileNotFoundException fnfe)
                    {
                        Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                        if (logger != null)
                        {
                            logger.warn("The watch-file, " + path + ", could not be found and will be ignored.");
                        }
                    }
                }
            }
            watches = resolvedWatches;

            List resolvedTouches = new ArrayList();
            for (int i = 0; i < touches.size(); i++)
            {
                String path = (String)touches.get(i);
                String resolvedPath = null;
                if (path.startsWith("{context.root}") || path.startsWith("{context-root}"))
                {
                    path = path.substring(14);
                    resolvedPath = context.getRealPath(path);

                    if (resolvedPath != null)
                    {
                        File file = new File(resolvedPath);
                        if (!file.exists() || (!file.isFile() && !file.isDirectory()) || (!file.isAbsolute()))
                        {
                            Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                            logger.warn("The touch-file, " + path + ", could not be found and will be ignored.");
                        }
                        else
                        {
                            resolvedTouches.add(resolvedPath);
                        }
                    }
                    else
                    {
                        Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                        logger.warn("The touch-file, " + path + ", could not be resolved to a path and will be ignored.");
                    }
                }
                else
                {
                    try
                    {
                        resolvedTouches.add(new WatchedObject(path));
                    }
                    catch (FileNotFoundException fnfe)
                    {
                        Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                        if (logger != null)
                        {
                            logger.warn("The touch-file, " + path + ", could not be found and will be ignored.");
                        }
                    }
                }
            }
            touches = resolvedTouches;
View Full Code Here

            if (data instanceof String)
            {
                String requestString = (String)data;
                if (Log.isInfo())
                {
                    Logger logger = Log.getLogger(HTTPProxyService.LOG_CATEGORY);
                    logger.debug("-- Begin " + method + " request --");
                    logger.debug(StringUtils.prettifyString(requestString));
                    logger.debug("-- End " + method + " request --");
                }

                try
                {
                    StringRequestEntity requestEntity = new StringRequestEntity(requestString, null, "UTF-8");
                    ((EntityEnclosingMethod)httpMethod).setRequestEntity(requestEntity);
                }
                catch (UnsupportedEncodingException ex)
                {
                    ProxyException pe = new ProxyException(CAUGHT_ERROR);
                    pe.setDetails(CAUGHT_ERROR, "1", new Object[] { ex });
                    throw pe;
                }
            }
            else if (dataClass.isArray() && Byte.TYPE.equals(dataClass.getComponentType()))
            {
                byte[] dataBytes = (byte[])data;
                ByteArrayRequestEntity requestEntity = new ByteArrayRequestEntity(dataBytes, context.getContentType());
                ((EntityEnclosingMethod)httpMethod).setRequestEntity(requestEntity);
            }
            else if (data instanceof InputStream)
            {
                InputStreamRequestEntity requestEntity = new InputStreamRequestEntity((InputStream)data, context.getContentType());
                ((EntityEnclosingMethod)httpMethod).setRequestEntity(requestEntity);
            }
            else
            {
                //TODO: Support multipart post

                //FIXME: Throw exception if unhandled data type
            }
        }
        else if (httpMethod instanceof GetMethod)
        {
            Object req = processBody(context);

            if (req instanceof String)
            {
                String requestString = (String)req;
                if (Log.isInfo())
                {
                    Logger logger = Log.getLogger(HTTPProxyService.LOG_CATEGORY);
                    logger.debug("-- Begin " + method + " request --");
                    logger.debug(StringUtils.prettifyString(requestString));
                    logger.debug("-- End " + method + " request --");
                }

                if (!"".equals(requestString))
                {
                    String query = context.getHttpMethod().getQueryString();
View Full Code Here

            broker.setFlexWritePath(getFlexWritePath(servletConfig));
           
            // Set initial servlet context on broker
            broker.setInitServletContext(servletConfig.getServletContext());

            Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);           
            if (Log.isInfo())
            {
                logger.info(VersionInfo.buildMessage());
            }
           
           
            // Create endpoints, services, security, and logger on the broker based on configuration
            config.configureBroker(broker);
View Full Code Here

TOP

Related Classes of flex.messaging.log.Logger

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.