Package org.directwebremoting.extend

Examples of org.directwebremoting.extend.ScriptSessionManager


     * @param servletConfig Information about the environment
     * @throws ContainerConfigurationException If we can't use a bean
     */
    public static void resolveListenerImplementations(DefaultContainer container, ServletConfig servletConfig) throws ContainerConfigurationException
    {
        ScriptSessionManager manager = container.getBean(ScriptSessionManager.class);

        String implNames = container.getParameter(LocalUtil.originalDwrClassName(ScriptSessionListener.class.getName()));
        if (implNames == null)
        {
            Loggers.STARTUP.debug("- No implementations of " + ScriptSessionListener.class.getSimpleName() + " to register");
            return;
        }

        Loggers.STARTUP.debug("- Creating list of " + ScriptSessionListener.class.getSimpleName() + " from " + implNames);

        implNames = implNames.replace(',', ' ');
        for (String implName : implNames.split(" "))
        {
            if (implName.equals(""))
            {
                continue;
            }

            try
            {
                Class<?> impl = LocalUtil.classForName(implName);
                if (!ScriptSessionListener.class.isAssignableFrom(impl))
                {
                    Loggers.STARTUP.error("  - Can't cast: " + impl.getName() + " to " + ScriptSessionListener.class.getName());
                }
                else
                {
                    @SuppressWarnings("unchecked")
                    Class<? extends ScriptSessionListener> i = (Class<? extends ScriptSessionListener>) impl;
                    ScriptSessionListener instance = i.newInstance();

                    manager.addScriptSessionListener(instance);
                }
            }
            catch (Exception ex)
            {
                Loggers.STARTUP.error("  - Can't use : " + implName + " to implement " + ScriptSessionListener.class.getName() + ". Reason: " + ex);
View Full Code Here


    /* (non-Javadoc)
     * @see org.directwebremoting.extend.RealWebContext#checkPageInformation(java.lang.String, java.lang.String, java.lang.String)
     */
    public void checkPageInformation(final String sentPage, String sentScriptId, String windowName)
    {
        ScriptSessionManager scriptSessionManager = getScriptSessionManager();

        // Get the httpSessionId if it exists, but don't create one if it doesn't
        String httpSessionId = null;
        HttpSession httpSession = request.getSession(false);
        if (httpSession != null)
        {
            httpSessionId = httpSession.getId();
        }

        // Check validity to the script session id. It could be invalid due to
        // to a server re-start, a timeout, a back-button, just because the user
        // is new to this page, or because someone is hacking
        this.scriptSession = scriptSessionManager.getOrCreateScriptSession(sentScriptId, sentPage, httpSessionId);

        // The passed script session id passed the test, use it
        this.page = sentPage;

        if (avoidConnectionLimitWithWindowName)
View Full Code Here

TOP

Related Classes of org.directwebremoting.extend.ScriptSessionManager

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.