alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Jetty example source code file (WadiSessionAdaptor.java)

This example Jetty source code file (WadiSessionAdaptor.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Jetty tags/keywords

cannot, exception, illegalstateexception, map, map, object, object, session, string, util, wadisession, wadisession, wadisessionadaptor, wadisessionadaptor

The Jetty WadiSessionAdaptor.java source code

package org.mortbay.jetty.servlet.wadi;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

import org.codehaus.wadi.core.session.Session;

public class WadiSessionAdaptor implements WadiSession
{
    private final Session session;

    public WadiSessionAdaptor(Session session)
    {
        this.session = session;
    }

    public String getSessionId()
    {
        return session.getName();
    }

    public void release()
    {
        try
        {
            session.destroy();
        }
        catch (Exception e)
        {
            throw new IllegalStateException("Cannot release session " + session);
        }
    }

    public Object addState(String key, Object value)
    {
        return session.addState(key, value);
    }

    public Object getState(String key)
    {
        return session.getState(key);
    }

    public Object removeState(String key)
    {
        return session.removeState(key);
    }

    public Map getState()
    {
        return session.getState();
    }

    public void onEndAccess()
    {
        session.onEndProcessing();
    }
}

Other Jetty examples (source code examples)

Here is a short list of links related to this Jetty WadiSessionAdaptor.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.