Example usage for com.vaadin.server VaadinSession setAttribute

List of usage examples for com.vaadin.server VaadinSession setAttribute

Introduction

In this page you can find the example usage for com.vaadin.server VaadinSession setAttribute.

Prototype

public <T> void setAttribute(Class<T> type, T value) 

Source Link

Document

Stores a value in this service session.

Usage

From source file:xyz.iipster.security.VaadinSessionSecurityContextHolderStrategy.java

License:Apache License

@Override
public SecurityContext getContext() {
    VaadinSession session = getSession();
    SecurityContext context = session.getAttribute(SecurityContext.class);
    if (context == null) {
        context = createEmptyContext();//from  w  w w .  jav a 2  s  .c o  m
        session.setAttribute(SecurityContext.class, context);
    }
    return context;
}