Example usage for com.vaadin.server VaadinSession addRequestHandler

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

Introduction

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

Prototype

public void addRequestHandler(RequestHandler handler) 

Source Link

Document

Adds a request handler to this session.

Usage

From source file:org.lucidj.vaadinui.GlobalResourceHandlerEx.java

License:Apache License

public boolean hook(VaadinSession session) {
    // We need this ugly hack to be able to override the default global resource handler,
    // so we can put an osgi-aware in place.
    // TODO: FIND OUT WHY GlobalResourceHandler IS SET OUTSIDE VaadinService.createRequestHandlers()
    if (set_field(session, "globalResourceHandler", this)) {
        // Step needed as VaadinSession.getGlobalResourceHandler() shows
        session.addRequestHandler(this);
        return (true);
    }/*ww w.  j  a  va  2s  .c  o m*/
    return (false);
}

From source file:pl.exsio.plupload.PluploadReceiver.java

License:Open Source License

public static PluploadReceiver getInstance() {
    VaadinSession session = VaadinSession.getCurrent();
    for (RequestHandler handler : session.getRequestHandlers()) {
        if (handler instanceof PluploadReceiver) {
            return (PluploadReceiver) handler;
        }//from   ww  w.  j ava2 s . c  o  m
    }

    PluploadReceiver receiver = new PluploadReceiver();
    session.addRequestHandler(receiver);
    return receiver;
}