List of usage examples for com.vaadin.server VaadinSession addRequestHandler
public void addRequestHandler(RequestHandler handler)
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; }