Example usage for com.vaadin.server SessionInitEvent getRequest

List of usage examples for com.vaadin.server SessionInitEvent getRequest

Introduction

In this page you can find the example usage for com.vaadin.server SessionInitEvent getRequest.

Prototype

public VaadinRequest getRequest() 

Source Link

Document

Gets the request that triggered the initialization.

Usage

From source file:edu.nps.moves.mmowgli.Mmowgli2VaadinServlet.java

License:Open Source License

@Override
public void sessionInit(SessionInitEvent event) throws ServiceException {
    MmowgliSessionGlobals globs = new MmowgliSessionGlobals(event, this); // Initialize global object across all users windows, gets stored in VaadinSession object referenced in event
    event.getSession().addUIProvider(new Mmowgli2UIProvider());

    // Support CAC card
    VaadinRequest req = event.getRequest();
    CACData cData = CACManager.findCAC(req);
    req.setAttribute(CACData.class.getName(), cData);
    globs.setCACInfo(cData);//  www .  j  a va  2  s .  c  o  m

    MSysOut.println(SYSTEM_LOGS, "JMETERdebug: Session created, id = " + event.getSession().hashCode());
    if (appMaster != null) {// might be with error on startup
        appMaster.doSessionCountUpdate(incrementSessionCount()); // remove after the following works
        appMaster.logSessionInit(event);
    }
}

From source file:edu.nps.moves.mmowgli.MmowgliSessionGlobals.java

License:Open Source License

public MmowgliSessionGlobals(SessionInitEvent event, Mmowgli2VaadinServlet servlet) {
    event.getSession().setAttribute(MmowgliSessionGlobals.class, this); // store this for use across the app

    //appMaster = (AppMaster)servlet.getServletContext().getAttribute(MmowgliConstants.APPLICATION_MASTER_ATTR_NAME);

    scoreManager = new ScoreManager2();
    loginTimeStamp = new SimpleDateFormat("EEE d MMM yyyy HH:mm:ss").format(new Date()).toString();

    sessionCookie = getCookie(event.getRequest().getCookies());
}