Package org.apache.jetspeed.logger

Examples of org.apache.jetspeed.logger.JetspeedLogger


            if ( paDir == null )
            {
                throw new ServletException(JCS + " Initialization of PortletApplication at "+contextName+" without access to its real path not supported");
            }
           
            JetspeedLogger jsLogger = JetspeedLoggerUtil.getSharedLogger(getClass());
            jsLogger.info(INIT_START_MSG + contextName);
            context.log(INIT_START_MSG + contextName);           
            System.out.println(INIT_START_MSG + contextName);           

            try
            {               
                startPortletApplication(context, paDir, Thread.currentThread().getContextClassLoader());
            }
            catch (Exception e)
            {
                String message = INIT_FAILED_MSG + contextName;
                jsLogger.error(message, e);
                context.log(message, e);
                System.err.println(message);
                throw new ServletException(message, e);
            }
           
            jsLogger.info(INIT_DONE_MSG + contextName);
            context.log(INIT_DONE_MSG + contextName);
            System.out.println(INIT_DONE_MSG + contextName);
        }
    }
View Full Code Here


          started = true;
            return;
        }
*/
        final String START_DELAYED_MSG = JCS + "Could not yet start portlet application at: "+contextName+". Starting back ground thread to start when the portal comes online.";
        JetspeedLogger jsLogger = JetspeedLoggerUtil.getSharedLogger(getClass());
        jsLogger.info(START_DELAYED_MSG);
        context.log(START_DELAYED_MSG);
        startTimer = new Timer(true);
        startTimer.schedule(new TimerTask()
        {
            public void run()
            {
                synchronized (contextName)
                {
                    if (startTimer != null)
                    {
                        if (attemptStart(context, contextName, contextPath, paDir, paClassLoader))
                        {
                            startTimer.cancel();
                            startTimer = null;
                        }
                        else
                        {
                            JetspeedLogger jsLogger = JetspeedLoggerUtil.getSharedLogger(getClass());
                            jsLogger.info(START_DELAYED_MSG);
                            context.log(START_DELAYED_MSG);
                        }
                    }
                }
            }
View Full Code Here

        }, 1, 10000);
    }

    boolean attemptStart(ServletContext context, String contextName, String contextPath, String paDir, ClassLoader paClassLoader)
    {
        JetspeedLogger jsLogger = JetspeedLoggerUtil.getSharedLogger(getClass());
       
        try
        {
            jsLogger.info(TRY_START_MSG + contextPath);
            context.log(TRY_START_MSG + contextPath);
            PortletServices services = JetspeedPortletServices.getSingleton();
            if (services != null)
            {
                PortletApplicationManagement pam =
                    (PortletApplicationManagement)services.getService("PAM");

                if (pam != null && pam.isStarted())
                {
                    DirectoryHelper paDirHelper = new DirectoryHelper(new File(paDir));
                    pam.startPortletApplication(contextName, contextPath, paDirHelper, paClassLoader);
                    started = true;
                    psm = (PortalSessionsManager)services.getService(PortalSessionsManager.SERVICE_NAME);

                    jsLogger.info(STARTED_MSG + contextPath);
                    context.log(STARTED_MSG + contextPath);
                    return true;
                }
            }
        }
        catch (Exception e)
        {
            jsLogger.error(INIT_FAILED_MSG + contextPath, e);
            context.log(INIT_FAILED_MSG + contextPath, e);
            return true; // don't try again
        }
        return false;
    }   
View Full Code Here

                    if (services != null)
                    {
                        PortletApplicationManagement pam = (PortletApplicationManagement) services.getService("PAM");
                        if ((pam != null) && pam.isStarted())
                        {
                            JetspeedLogger jsLogger = JetspeedLoggerUtil.getSharedLogger(getClass());
                            jsLogger.info(STOP_MSG + contextName);
                            getServletContext().log(STOP_MSG + contextName);
                            try
                            {
                                pam.stopPortletApplication(contextName);
                            }
                            catch (Exception e)
                            {
                                jsLogger.error(STOP_FAILED_MSG + contextName, e);
                                getServletContext().log(STOP_FAILED_MSG + contextName, e);
                            }
                        }
                    }
                    contextName = null;
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.logger.JetspeedLogger

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.