diff options
author | Artur Signell <artur@vaadin.com> | 2012-11-16 18:29:44 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-11-16 18:29:44 +0200 |
commit | 9a3a22cc9f8f95054e3528b0ffcc0b9e92cffbea (patch) | |
tree | 9f2c7302f294ffe8c02915b1d7f286733f815817 | |
parent | 15f833480da7a5eff0d29c527cd956b9e9658401 (diff) | |
download | vaadin-framework-9a3a22cc9f8f95054e3528b0ffcc0b9e92cffbea.tar.gz vaadin-framework-9a3a22cc9f8f95054e3528b0ffcc0b9e92cffbea.zip |
Renamed VaadinServiceSession to VaadinSession (#10223)
Change-Id: Id7f367300c000aa47edc12084f4e9500502466c3
66 files changed, 251 insertions, 263 deletions
diff --git a/server/src/com/vaadin/data/util/converter/ConverterUtil.java b/server/src/com/vaadin/data/util/converter/ConverterUtil.java index 6f2fecb9a2..5944b505ab 100644 --- a/server/src/com/vaadin/data/util/converter/ConverterUtil.java +++ b/server/src/com/vaadin/data/util/converter/ConverterUtil.java @@ -18,7 +18,7 @@ package com.vaadin.data.util.converter; import java.io.Serializable; import java.util.Locale; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; public class ConverterUtil implements Serializable { @@ -26,7 +26,7 @@ public class ConverterUtil implements Serializable { * Finds a converter that can convert from the given presentation type to * the given model type and back. Uses the given application to find a * {@link ConverterFactory} or, if application is null, uses the - * {@link VaadinServiceSession#getCurrent()}. + * {@link VaadinSession#getCurrent()}. * * @param <PRESENTATIONTYPE> * The presentation type @@ -44,10 +44,10 @@ public class ConverterUtil implements Serializable { */ public static <PRESENTATIONTYPE, MODELTYPE> Converter<PRESENTATIONTYPE, MODELTYPE> getConverter( Class<PRESENTATIONTYPE> presentationType, - Class<MODELTYPE> modelType, VaadinServiceSession session) { + Class<MODELTYPE> modelType, VaadinSession session) { Converter<PRESENTATIONTYPE, MODELTYPE> converter = null; if (session == null) { - session = VaadinServiceSession.getCurrent(); + session = VaadinSession.getCurrent(); } if (session != null) { diff --git a/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java b/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java index 55d78c21b1..17b89ccb20 100644 --- a/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java +++ b/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java @@ -19,14 +19,14 @@ package com.vaadin.data.util.converter; import java.util.Date; import java.util.logging.Logger; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; /** * Default implementation of {@link ConverterFactory}. Provides converters for * standard types like {@link String}, {@link Double} and {@link Date}. </p> * <p> * Custom converters can be provided by extending this class and using - * {@link VaadinServiceSession#setConverterFactory(ConverterFactory)}. + * {@link VaadinSession#setConverterFactory(ConverterFactory)}. * </p> * * @author Vaadin Ltd diff --git a/server/src/com/vaadin/server/AbstractClientConnector.java b/server/src/com/vaadin/server/AbstractClientConnector.java index b7ba48d8d5..a9007916f0 100644 --- a/server/src/com/vaadin/server/AbstractClientConnector.java +++ b/server/src/com/vaadin/server/AbstractClientConnector.java @@ -375,12 +375,12 @@ public abstract class AbstractClientConnector implements ClientConnector, } /** - * Finds the {@link VaadinServiceSession} to which this connector belongs. - * If the connector has not been attached, <code>null</code> is returned. + * Finds the {@link VaadinSession} to which this connector belongs. If the + * connector has not been attached, <code>null</code> is returned. * * @return The connector's session, or <code>null</code> if not attached */ - protected VaadinServiceSession getSession() { + protected VaadinSession getSession() { UI uI = getUI(); if (uI == null) { return null; diff --git a/server/src/com/vaadin/server/AbstractCommunicationManager.java b/server/src/com/vaadin/server/AbstractCommunicationManager.java index 202c7cf780..1481085247 100644 --- a/server/src/com/vaadin/server/AbstractCommunicationManager.java +++ b/server/src/com/vaadin/server/AbstractCommunicationManager.java @@ -147,7 +147,7 @@ public abstract class AbstractCommunicationManager implements Serializable { /** * The session this communication manager is used for */ - private final VaadinServiceSession session; + private final VaadinSession session; private List<String> locales; @@ -174,7 +174,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * * @param session */ - public AbstractCommunicationManager(VaadinServiceSession session) { + public AbstractCommunicationManager(VaadinSession session) { this.session = session; session.addRequestHandler(getBootstrapHandler()); session.addRequestHandler(UNSUPPORTED_BROWSER_HANDLER); @@ -182,7 +182,7 @@ public abstract class AbstractCommunicationManager implements Serializable { requireLocale(session.getLocale().toString()); } - protected VaadinServiceSession getSession() { + protected VaadinSession getSession() { return session; } @@ -374,7 +374,7 @@ public abstract class AbstractCommunicationManager implements Serializable { "StreamVariable for the post not found"); } - final VaadinServiceSession session = getSession(); + final VaadinSession session = getSession(); OutputStream out = null; int totalBytes = 0; @@ -512,7 +512,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * Internally process a UIDL request from the client. * * This method calls - * {@link #handleVariables(VaadinRequest, VaadinResponse, Callback, VaadinServiceSession, UI)} + * {@link #handleVariables(VaadinRequest, VaadinResponse, Callback, VaadinSession, UI)} * to process any changes to variables by the client and then repaints * affected components using {@link #paintAfterVariableChanges()}. * @@ -705,7 +705,7 @@ public abstract class AbstractCommunicationManager implements Serializable { } sb.append("\nConnector hierarchy:\n"); - VaadinServiceSession session2 = connector.getUI().getSession(); + VaadinSession session2 = connector.getUI().getSession(); sb.append(session2.getClass().getName()); sb.append("("); sb.append(session2.getClass().getSimpleName()); @@ -808,7 +808,7 @@ public abstract class AbstractCommunicationManager implements Serializable { final PrintWriter outWriter, UI ui, boolean analyzeLayouts) throws PaintException, JSONException { ArrayList<ClientConnector> dirtyVisibleConnectors = new ArrayList<ClientConnector>(); - VaadinServiceSession session = ui.getSession(); + VaadinSession session = ui.getSession(); // Paints components ConnectorTracker uiConnectorTracker = ui.getConnectorTracker(); getLogger().log(Level.FINE, "* Creating response to client"); @@ -1538,7 +1538,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * @param session * @return false if the XSRF is turned off, true otherwise */ - public boolean isXSRFEnabled(VaadinServiceSession session) { + public boolean isXSRFEnabled(VaadinSession session) { return session.getConfiguration().isXsrfProtectionEnabled(); } @@ -1552,9 +1552,9 @@ public abstract class AbstractCommunicationManager implements Serializable { * @return true if successful, false if there was an inconsistency */ private boolean handleVariables(VaadinRequest request, - VaadinResponse response, Callback callback, - VaadinServiceSession session, UI uI) throws IOException, - InvalidUIDLSecurityKeyException, JSONException { + VaadinResponse response, Callback callback, VaadinSession session, + UI uI) throws IOException, InvalidUIDLSecurityKeyException, + JSONException { boolean success = true; String changes = getRequestPayload(request); @@ -1960,7 +1960,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * @param m * map from variable names to values */ - private void handleChangeVariablesError(VaadinServiceSession session, + private void handleChangeVariablesError(VaadinSession session, Component owner, Throwable t, Map<String, Object> m) { boolean handled = false; ChangeVariablesErrorEvent errorEvent = new ChangeVariablesErrorEvent( @@ -2395,7 +2395,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * @throws IOException * if a handler throws an exception * - * @see VaadinServiceSession#addRequestHandler(RequestHandler) + * @see VaadinSession#addRequestHandler(RequestHandler) * @see RequestHandler * * @since 7.0 @@ -2414,8 +2414,7 @@ public abstract class AbstractCommunicationManager implements Serializable { } public void handleBrowserDetailsRequest(VaadinRequest request, - VaadinResponse response, VaadinServiceSession session) - throws IOException { + VaadinResponse response, VaadinSession session) throws IOException { session.getLock().lock(); @@ -2450,8 +2449,7 @@ public abstract class AbstractCommunicationManager implements Serializable { } } - private UI getBrowserDetailsUI(VaadinRequest request, - VaadinServiceSession session) { + private UI getBrowserDetailsUI(VaadinRequest request, VaadinSession session) { VaadinService vaadinService = request.getService(); List<UIProvider> uiProviders = session.getUIProviders(); @@ -2706,8 +2704,8 @@ public abstract class AbstractCommunicationManager implements Serializable { * @throws IOException * @throws InvalidUIDLSecurityKeyException */ - public void handleFileUpload(VaadinServiceSession session, - VaadinRequest request, VaadinResponse response) throws IOException, + public void handleFileUpload(VaadinSession session, VaadinRequest request, + VaadinResponse response) throws IOException, InvalidUIDLSecurityKeyException { /* @@ -2768,8 +2766,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * @throws IOException */ public void handleHeartbeatRequest(VaadinRequest request, - VaadinResponse response, VaadinServiceSession session) - throws IOException { + VaadinResponse response, VaadinSession session) throws IOException { UI ui = null; try { int uiId = Integer.parseInt(request diff --git a/server/src/com/vaadin/server/AddonContext.java b/server/src/com/vaadin/server/AddonContext.java index 3465e16960..088366c541 100644 --- a/server/src/com/vaadin/server/AddonContext.java +++ b/server/src/com/vaadin/server/AddonContext.java @@ -111,7 +111,7 @@ public class AddonContext implements Serializable { * Shorthand for adding a bootstrap listener that will be added to every new * service session. * - * @see VaadinServiceSession#addBootstrapListener(BootstrapListener) + * @see VaadinSession#addBootstrapListener(BootstrapListener) * * @param listener * the bootstrap listener that should be added to all new diff --git a/server/src/com/vaadin/server/BootstrapFragmentResponse.java b/server/src/com/vaadin/server/BootstrapFragmentResponse.java index 0df99e04e2..09d443ce30 100644 --- a/server/src/com/vaadin/server/BootstrapFragmentResponse.java +++ b/server/src/com/vaadin/server/BootstrapFragmentResponse.java @@ -37,7 +37,7 @@ public class BootstrapFragmentResponse extends BootstrapResponse { * Crate a new bootstrap fragment response. * * @see BootstrapResponse#BootstrapResponse(BootstrapHandler, VaadinRequest, - * VaadinServiceSession, Class) + * VaadinSession, Class) * * @param handler * the bootstrap handler that is firing the event @@ -56,7 +56,7 @@ public class BootstrapFragmentResponse extends BootstrapResponse { * the UI provider for the bootstrap */ public BootstrapFragmentResponse(BootstrapHandler handler, - VaadinRequest request, VaadinServiceSession session, + VaadinRequest request, VaadinSession session, Class<? extends UI> uiClass, List<Node> fragmentNodes, UIProvider uiProvider) { super(handler, request, session, uiClass, uiProvider); diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java index df0ace78db..d0e87d5e08 100644 --- a/server/src/com/vaadin/server/BootstrapHandler.java +++ b/server/src/com/vaadin/server/BootstrapHandler.java @@ -76,7 +76,7 @@ public abstract class BootstrapHandler implements RequestHandler { return bootstrapResponse.getRequest(); } - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return bootstrapResponse.getSession(); } @@ -113,8 +113,8 @@ public abstract class BootstrapHandler implements RequestHandler { } @Override - public boolean handleRequest(VaadinServiceSession session, - VaadinRequest request, VaadinResponse response) throws IOException { + public boolean handleRequest(VaadinSession session, VaadinRequest request, + VaadinResponse response) throws IOException { try { List<UIProvider> uiProviders = session.getUIProviders(); @@ -393,7 +393,7 @@ public abstract class BootstrapHandler implements RequestHandler { protected JSONObject getApplicationParameters(BootstrapContext context) throws JSONException, PaintException { VaadinRequest request = context.getRequest(); - VaadinServiceSession session = context.getSession(); + VaadinSession session = context.getSession(); VaadinService vaadinService = request.getService(); JSONObject appConfig = new JSONObject(); diff --git a/server/src/com/vaadin/server/BootstrapPageResponse.java b/server/src/com/vaadin/server/BootstrapPageResponse.java index 3c368764cc..19afca0e83 100644 --- a/server/src/com/vaadin/server/BootstrapPageResponse.java +++ b/server/src/com/vaadin/server/BootstrapPageResponse.java @@ -39,7 +39,7 @@ public class BootstrapPageResponse extends BootstrapResponse { * Crate a new bootstrap page response. * * @see BootstrapResponse#BootstrapResponse(BootstrapHandler, VaadinRequest, - * VaadinServiceSession, Class) + * VaadinSession, Class) * * @param handler * the bootstrap handler that is firing the event @@ -59,7 +59,7 @@ public class BootstrapPageResponse extends BootstrapResponse { * the UI provider for the bootstrap */ public BootstrapPageResponse(BootstrapHandler handler, - VaadinRequest request, VaadinServiceSession session, + VaadinRequest request, VaadinSession session, Class<? extends UI> uiClass, Document document, Map<String, Object> headers, UIProvider uiProvider) { super(handler, request, session, uiClass, uiProvider); diff --git a/server/src/com/vaadin/server/BootstrapResponse.java b/server/src/com/vaadin/server/BootstrapResponse.java index e8ddd19569..15c7c9e048 100644 --- a/server/src/com/vaadin/server/BootstrapResponse.java +++ b/server/src/com/vaadin/server/BootstrapResponse.java @@ -29,7 +29,7 @@ import com.vaadin.ui.UI; */ public abstract class BootstrapResponse extends EventObject { private final VaadinRequest request; - private final VaadinServiceSession session; + private final VaadinSession session; private final Class<? extends UI> uiClass; private final UIProvider uiProvider; @@ -49,7 +49,7 @@ public abstract class BootstrapResponse extends EventObject { * the UI provider for the bootstrap */ public BootstrapResponse(BootstrapHandler handler, VaadinRequest request, - VaadinServiceSession session, Class<? extends UI> uiClass, + VaadinSession session, Class<? extends UI> uiClass, UIProvider uiProvider) { super(handler); this.request = request; @@ -86,7 +86,7 @@ public abstract class BootstrapResponse extends EventObject { * * @return the Vaadin service session */ - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return session; } diff --git a/server/src/com/vaadin/server/CommunicationManager.java b/server/src/com/vaadin/server/CommunicationManager.java index 6cfaf37092..19a431c882 100644 --- a/server/src/com/vaadin/server/CommunicationManager.java +++ b/server/src/com/vaadin/server/CommunicationManager.java @@ -44,7 +44,7 @@ public class CommunicationManager extends AbstractCommunicationManager { * * @param session */ - public CommunicationManager(VaadinServiceSession session) { + public CommunicationManager(VaadinSession session) { super(session); } diff --git a/server/src/com/vaadin/server/ConnectorResourceHandler.java b/server/src/com/vaadin/server/ConnectorResourceHandler.java index dc112a2d5b..dd785e97b8 100644 --- a/server/src/com/vaadin/server/ConnectorResourceHandler.java +++ b/server/src/com/vaadin/server/ConnectorResourceHandler.java @@ -24,8 +24,8 @@ public class ConnectorResourceHandler implements RequestHandler { } @Override - public boolean handleRequest(VaadinServiceSession session, - VaadinRequest request, VaadinResponse response) throws IOException { + public boolean handleRequest(VaadinSession session, VaadinRequest request, + VaadinResponse response) throws IOException { String requestPath = request.getRequestPathInfo(); if (requestPath == null) { return false; @@ -43,7 +43,7 @@ public class ConnectorResourceHandler implements RequestHandler { } UI.setCurrent(ui); - VaadinServiceSession.setCurrent(ui.getSession()); + VaadinSession.setCurrent(ui.getSession()); ClientConnector connector = ui.getConnectorTracker().getConnector( cid); diff --git a/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java b/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java index 985ae16f28..23392e59a8 100644 --- a/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java +++ b/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java @@ -19,7 +19,6 @@ package com.vaadin.server; import java.util.Properties; import java.util.logging.Logger; - /** * The default implementation of {@link DeploymentConfiguration} based on a base * class for resolving system properties and a set of init parameters. diff --git a/server/src/com/vaadin/server/DefaultUIProvider.java b/server/src/com/vaadin/server/DefaultUIProvider.java index e02e5dc860..919f781d3d 100644 --- a/server/src/com/vaadin/server/DefaultUIProvider.java +++ b/server/src/com/vaadin/server/DefaultUIProvider.java @@ -27,8 +27,8 @@ public class DefaultUIProvider extends UIProvider { Object uiClassNameObj = request .getService() .getDeploymentConfiguration() - .getApplicationOrSystemProperty( - VaadinServiceSession.UI_PARAMETER, null); + .getApplicationOrSystemProperty(VaadinSession.UI_PARAMETER, + null); if (uiClassNameObj instanceof String) { String uiClassName = uiClassNameObj.toString(); diff --git a/server/src/com/vaadin/server/FileResource.java b/server/src/com/vaadin/server/FileResource.java index ec3f775d00..737299da8e 100644 --- a/server/src/com/vaadin/server/FileResource.java +++ b/server/src/com/vaadin/server/FileResource.java @@ -73,7 +73,7 @@ public class FileResource implements ConnectorResource { return ds; } catch (final FileNotFoundException e) { // Log the exception using the application error handler - VaadinServiceSession.getCurrent().getErrorHandler() + VaadinSession.getCurrent().getErrorHandler() .terminalError(new ErrorEvent() { @Override diff --git a/server/src/com/vaadin/server/GAEVaadinServlet.java b/server/src/com/vaadin/server/GAEVaadinServlet.java index d2c53c6fcb..e493c9546d 100644 --- a/server/src/com/vaadin/server/GAEVaadinServlet.java +++ b/server/src/com/vaadin/server/GAEVaadinServlet.java @@ -240,7 +240,7 @@ public class GAEVaadinServlet extends VaadinServlet { } // de-serialize or create application context, store in session - VaadinServiceSession ctx = getApplicationContext(request, memcache); + VaadinSession ctx = getApplicationContext(request, memcache); super.service(request, response); @@ -290,9 +290,8 @@ public class GAEVaadinServlet extends VaadinServlet { } } - protected VaadinServiceSession getApplicationContext( - HttpServletRequest request, MemcacheService memcache) - throws ServletException { + protected VaadinSession getApplicationContext(HttpServletRequest request, + MemcacheService memcache) throws ServletException { HttpSession session = request.getSession(); String id = AC_BASE + session.getId(); byte[] serializedAC = (byte[]) memcache.get(id); @@ -320,7 +319,7 @@ public class GAEVaadinServlet extends VaadinServlet { ObjectInputStream ois; try { ois = new ObjectInputStream(bais); - VaadinServiceSession applicationContext = (VaadinServiceSession) ois + VaadinSession applicationContext = (VaadinSession) ois .readObject(); applicationContext.storeInSession(getService(), new WrappedHttpSession(session)); @@ -367,8 +366,8 @@ public class GAEVaadinServlet extends VaadinServlet { if (wrappedSession == null) { return; } - VaadinServiceSession serviceSession = VaadinServiceSession - .getForSession(getService(), wrappedSession); + VaadinSession serviceSession = VaadinSession.getForSession( + getService(), wrappedSession); if (serviceSession == null) { return; } diff --git a/server/src/com/vaadin/server/GlobalResourceHandler.java b/server/src/com/vaadin/server/GlobalResourceHandler.java index 4ba3e25e28..23c294650e 100644 --- a/server/src/com/vaadin/server/GlobalResourceHandler.java +++ b/server/src/com/vaadin/server/GlobalResourceHandler.java @@ -66,8 +66,8 @@ public class GlobalResourceHandler implements RequestHandler { ""); @Override - public boolean handleRequest(VaadinServiceSession session, - VaadinRequest request, VaadinResponse response) throws IOException { + public boolean handleRequest(VaadinSession session, VaadinRequest request, + VaadinResponse response) throws IOException { String pathInfo = request.getRequestPathInfo(); if (pathInfo == null) { return false; diff --git a/server/src/com/vaadin/server/LegacyApplication.java b/server/src/com/vaadin/server/LegacyApplication.java index 6ac7ad2e0c..10e8791be6 100644 --- a/server/src/com/vaadin/server/LegacyApplication.java +++ b/server/src/com/vaadin/server/LegacyApplication.java @@ -81,7 +81,7 @@ public abstract class LegacyApplication implements ErrorListener { public void doInit(URL url) { this.url = url; - VaadinServiceSession.getCurrent().setErrorHandler(this); + VaadinSession.getCurrent().setErrorHandler(this); init(); } @@ -108,7 +108,7 @@ public abstract class LegacyApplication implements ErrorListener { * Sets the application's theme. * <p> * Note that this theme can be overridden for a specific UI with - * {@link VaadinServiceSession#getThemeForUI(UI)}. Setting theme to be + * {@link VaadinSession#getThemeForUI(UI)}. Setting theme to be * <code>null</code> selects the default theme. For the available theme * names, see the contents of the VAADIN/themes directory. * </p> @@ -172,7 +172,7 @@ public abstract class LegacyApplication implements ErrorListener { uI.setApplication(this); legacyUINames.put(uI.getName(), uI); - uI.setSession(VaadinServiceSession.getCurrent()); + uI.setSession(VaadinSession.getCurrent()); } /** @@ -214,8 +214,8 @@ public abstract class LegacyApplication implements ErrorListener { DefaultErrorListener.doDefault(event); } - public VaadinServiceSession getContext() { - return VaadinServiceSession.getCurrent(); + public VaadinSession getContext() { + return VaadinSession.getCurrent(); } public void close() { diff --git a/server/src/com/vaadin/server/LegacyApplicationUIProvider.java b/server/src/com/vaadin/server/LegacyApplicationUIProvider.java index 467e1c4a5e..b3e8af8184 100644 --- a/server/src/com/vaadin/server/LegacyApplicationUIProvider.java +++ b/server/src/com/vaadin/server/LegacyApplicationUIProvider.java @@ -117,15 +117,15 @@ public abstract class LegacyApplicationUIProvider extends UIProvider { } private LegacyApplication getApplication() { - LegacyApplication application = VaadinServiceSession.getCurrent() + LegacyApplication application = VaadinSession.getCurrent() .getAttribute(LegacyApplication.class); if (application == null) { application = createApplication(); if (application == null) { return null; } - VaadinServiceSession.getCurrent().setAttribute( - LegacyApplication.class, application); + VaadinSession.getCurrent().setAttribute(LegacyApplication.class, + application); URL applicationUrl; try { @@ -138,8 +138,8 @@ public abstract class LegacyApplicationUIProvider extends UIProvider { } if (application != null && !application.isRunning()) { - VaadinServiceSession.getCurrent().setAttribute( - LegacyApplication.class, null); + VaadinSession.getCurrent().setAttribute(LegacyApplication.class, + null); // Run again without a current application return getApplication(); } diff --git a/server/src/com/vaadin/server/LegacyVaadinPortlet.java b/server/src/com/vaadin/server/LegacyVaadinPortlet.java index 92079653c7..23bf9c9263 100644 --- a/server/src/com/vaadin/server/LegacyVaadinPortlet.java +++ b/server/src/com/vaadin/server/LegacyVaadinPortlet.java @@ -20,7 +20,6 @@ import javax.portlet.PortletConfig; import javax.portlet.PortletException; import javax.portlet.PortletRequest; - public class LegacyVaadinPortlet extends VaadinPortlet { private static final LegacyApplicationUIProvider provider = new LegacyApplicationUIProvider() { diff --git a/server/src/com/vaadin/server/LegacyVaadinServlet.java b/server/src/com/vaadin/server/LegacyVaadinServlet.java index 8ee10f5176..8951ee1f79 100644 --- a/server/src/com/vaadin/server/LegacyVaadinServlet.java +++ b/server/src/com/vaadin/server/LegacyVaadinServlet.java @@ -20,7 +20,6 @@ import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; - public class LegacyVaadinServlet extends VaadinServlet { private static final UIProvider provider = new LegacyApplicationUIProvider() { @@ -87,7 +86,7 @@ public class LegacyVaadinServlet extends VaadinServlet { } private void onVaadinSessionStarted(VaadinRequest request, - VaadinServiceSession session) throws ServletException { + VaadinSession session) throws ServletException { session.addUIProvider(provider); } diff --git a/server/src/com/vaadin/server/PortletCommunicationManager.java b/server/src/com/vaadin/server/PortletCommunicationManager.java index 8b1b14e568..84d48fdf83 100644 --- a/server/src/com/vaadin/server/PortletCommunicationManager.java +++ b/server/src/com/vaadin/server/PortletCommunicationManager.java @@ -44,7 +44,7 @@ import com.vaadin.ui.UI; @SuppressWarnings("serial") public class PortletCommunicationManager extends AbstractCommunicationManager { - public PortletCommunicationManager(VaadinServiceSession session) { + public PortletCommunicationManager(VaadinSession session) { super(session); } @@ -52,7 +52,7 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { protected BootstrapHandler createBootstrapHandler() { return new BootstrapHandler() { @Override - public boolean handleRequest(VaadinServiceSession session, + public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { PortletRequest portletRequest = ((VaadinPortletRequest) request) diff --git a/server/src/com/vaadin/server/RequestHandler.java b/server/src/com/vaadin/server/RequestHandler.java index ea5c25c9ea..861f587239 100644 --- a/server/src/com/vaadin/server/RequestHandler.java +++ b/server/src/com/vaadin/server/RequestHandler.java @@ -22,7 +22,7 @@ import java.io.Serializable; /** * Handler for producing a response to non-UIDL requests. Handlers can be added * to service sessions using - * {@link VaadinServiceSession#addRequestHandler(RequestHandler)} + * {@link VaadinSession#addRequestHandler(RequestHandler)} */ public interface RequestHandler extends Serializable { @@ -41,7 +41,7 @@ public interface RequestHandler extends Serializable { * handlers should be called, otherwise false * @throws IOException */ - boolean handleRequest(VaadinServiceSession session, VaadinRequest request, + boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException; } diff --git a/server/src/com/vaadin/server/RequestTimer.java b/server/src/com/vaadin/server/RequestTimer.java index 4ab855a0cb..26a5689665 100644 --- a/server/src/com/vaadin/server/RequestTimer.java +++ b/server/src/com/vaadin/server/RequestTimer.java @@ -43,7 +43,7 @@ public class RequestTimer implements Serializable { * * @param context */ - public void stop(VaadinServiceSession context) { + public void stop(VaadinSession context) { // Measure and store the total handling time. This data can be // used in TestBench 3 tests. long time = (System.nanoTime() - requestStartTime) / 1000000; diff --git a/server/src/com/vaadin/server/ServletPortletHelper.java b/server/src/com/vaadin/server/ServletPortletHelper.java index 1bcfdf8692..6fb03ab265 100644 --- a/server/src/com/vaadin/server/ServletPortletHelper.java +++ b/server/src/com/vaadin/server/ServletPortletHelper.java @@ -55,7 +55,7 @@ class ServletPortletHelper implements Serializable { private static void verifyUIClass(String className, ClassLoader classLoader) throws ServiceException { if (className == null) { - throw new ServiceException(VaadinServiceSession.UI_PARAMETER + throw new ServiceException(VaadinSession.UI_PARAMETER + " init parameter not defined"); } @@ -119,11 +119,11 @@ class ServletPortletHelper implements Serializable { ApplicationConstants.HEARTBEAT_REQUEST_PATH); } - public static void initDefaultUIProvider(VaadinServiceSession session, + public static void initDefaultUIProvider(VaadinSession session, VaadinService vaadinService) throws ServiceException { String uiProperty = vaadinService.getDeploymentConfiguration() - .getApplicationOrSystemProperty( - VaadinServiceSession.UI_PARAMETER, null); + .getApplicationOrSystemProperty(VaadinSession.UI_PARAMETER, + null); // Add provider for UI parameter first to give it lower priority // (providers are FILO) @@ -165,13 +165,12 @@ class ServletPortletHelper implements Serializable { } } - public static void checkUiProviders(VaadinServiceSession session, + public static void checkUiProviders(VaadinSession session, VaadinService vaadinService) throws ServiceException { if (session.getUIProviders().isEmpty()) { throw new ServiceException( "No UIProvider has been added and there is no \"" - + VaadinServiceSession.UI_PARAMETER - + "\" init parameter."); + + VaadinSession.UI_PARAMETER + "\" init parameter."); } } @@ -182,13 +181,13 @@ class ServletPortletHelper implements Serializable { * <li>The passed component (or UI) if not null</li> * <li>{@link UI#getCurrent()} if defined</li> * <li>The passed session if not null</li> - * <li>{@link VaadinServiceSession#getCurrent()} if defined</li> + * <li>{@link VaadinSession#getCurrent()} if defined</li> * <li>The passed request if not null</li> * <li>{@link VaadinService#getCurrentRequest()} if defined</li> * <li>{@link Locale#getDefault()}</li> * </ol> */ - static Locale findLocale(Component component, VaadinServiceSession session, + static Locale findLocale(Component component, VaadinSession session, VaadinRequest request) { if (component == null) { component = UI.getCurrent(); @@ -201,7 +200,7 @@ class ServletPortletHelper implements Serializable { } if (session == null) { - session = VaadinServiceSession.getCurrent(); + session = VaadinSession.getCurrent(); } if (session != null) { Locale locale = session.getLocale(); diff --git a/server/src/com/vaadin/server/SessionDestroyEvent.java b/server/src/com/vaadin/server/SessionDestroyEvent.java index c502ade7cb..25147a29a1 100644 --- a/server/src/com/vaadin/server/SessionDestroyEvent.java +++ b/server/src/com/vaadin/server/SessionDestroyEvent.java @@ -28,7 +28,7 @@ import java.util.EventObject; */ public class SessionDestroyEvent extends EventObject { - private final VaadinServiceSession session; + private final VaadinSession session; /** * Creates a new event. @@ -38,8 +38,7 @@ public class SessionDestroyEvent extends EventObject { * @param session * the Vaadin service session that is no longer used */ - public SessionDestroyEvent(VaadinService service, - VaadinServiceSession session) { + public SessionDestroyEvent(VaadinService service, VaadinSession session) { super(service); this.session = session; } @@ -63,7 +62,7 @@ public class SessionDestroyEvent extends EventObject { * * @return the Vaadin service session */ - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return session; } diff --git a/server/src/com/vaadin/server/SessionInitEvent.java b/server/src/com/vaadin/server/SessionInitEvent.java index a33e5fa8dd..7994ae23de 100644 --- a/server/src/com/vaadin/server/SessionInitEvent.java +++ b/server/src/com/vaadin/server/SessionInitEvent.java @@ -34,7 +34,7 @@ import java.util.EventObject; */ public class SessionInitEvent extends EventObject { - private final VaadinServiceSession session; + private final VaadinSession session; private final VaadinRequest request; /** @@ -47,8 +47,8 @@ public class SessionInitEvent extends EventObject { * @param request * the request that triggered the initialization */ - public SessionInitEvent(VaadinService service, - VaadinServiceSession session, VaadinRequest request) { + public SessionInitEvent(VaadinService service, VaadinSession session, + VaadinRequest request) { super(service); this.session = session; this.request = request; @@ -73,7 +73,7 @@ public class SessionInitEvent extends EventObject { * * @return the Vaadin service session */ - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return session; } diff --git a/server/src/com/vaadin/server/StreamVariable.java b/server/src/com/vaadin/server/StreamVariable.java index 3c20315b04..a75cc2f0d7 100644 --- a/server/src/com/vaadin/server/StreamVariable.java +++ b/server/src/com/vaadin/server/StreamVariable.java @@ -151,7 +151,7 @@ public interface StreamVariable extends Serializable { * the streaming ended before the end of the input. The streaming may fail * due an interruption by {@link } or due an other unknown exception in * communication. In the latter case the exception is also passed to - * {@link VaadinServiceSession#terminalError(com.vaadin.server.Terminal.ErrorEvent)} + * {@link VaadinSession#terminalError(com.vaadin.server.Terminal.ErrorEvent)} * . */ public interface StreamingErrorEvent extends StreamingEvent { diff --git a/server/src/com/vaadin/server/SystemMessages.java b/server/src/com/vaadin/server/SystemMessages.java index 59cee3831e..647266d8e3 100644 --- a/server/src/com/vaadin/server/SystemMessages.java +++ b/server/src/com/vaadin/server/SystemMessages.java @@ -22,9 +22,8 @@ import java.io.Serializable; * Contains the system messages used to notify the user about various critical * situations that can occur. * <p> - * Customize by overriding the static - * {@link VaadinServiceSession#getSystemMessages()} and returning - * {@link CustomizedSystemMessages}. + * Customize by overriding the static {@link VaadinSession#getSystemMessages()} + * and returning {@link CustomizedSystemMessages}. * </p> * <p> * The defaults defined in this class are: diff --git a/server/src/com/vaadin/server/SystemMessagesProvider.java b/server/src/com/vaadin/server/SystemMessagesProvider.java index 82d1014b9f..21263a2950 100644 --- a/server/src/com/vaadin/server/SystemMessagesProvider.java +++ b/server/src/com/vaadin/server/SystemMessagesProvider.java @@ -34,8 +34,8 @@ public interface SystemMessagesProvider extends Serializable { * piece of information guaranteed to be available, but in most cases some * or all of {@link VaadinService#getCurrent()}, * {@link VaadinService#getCurrentRequest()}, - * {@link VaadinServiceSession#getCurrent()} and {@link UI#getCurrent()} can - * also be used to find more information to help the decision. + * {@link VaadinSession#getCurrent()} and {@link UI#getCurrent()} can also + * be used to find more information to help the decision. * * @param locale * the desired locale of the system messages diff --git a/server/src/com/vaadin/server/UnsupportedBrowserHandler.java b/server/src/com/vaadin/server/UnsupportedBrowserHandler.java index cd3498fd57..36796b84b2 100644 --- a/server/src/com/vaadin/server/UnsupportedBrowserHandler.java +++ b/server/src/com/vaadin/server/UnsupportedBrowserHandler.java @@ -34,8 +34,8 @@ public class UnsupportedBrowserHandler implements RequestHandler { public static final String FORCE_LOAD_COOKIE = "vaadinforceload=1"; @Override - public boolean handleRequest(VaadinServiceSession session, - VaadinRequest request, VaadinResponse response) throws IOException { + public boolean handleRequest(VaadinSession session, VaadinRequest request, + VaadinResponse response) throws IOException { // Check if the browser is supported // If Chrome Frame is available we'll assume it's ok @@ -62,7 +62,7 @@ public class UnsupportedBrowserHandler implements RequestHandler { protected void writeBrowserTooOldPage(VaadinRequest request, VaadinResponse response) throws IOException { Writer page = response.getWriter(); - WebBrowser b = VaadinServiceSession.getCurrent().getBrowser(); + WebBrowser b = VaadinSession.getCurrent().getBrowser(); page.write("<html><body><h1>I'm sorry, but your browser is not supported</h1>" + "<p>The version (" diff --git a/server/src/com/vaadin/server/VaadinPortlet.java b/server/src/com/vaadin/server/VaadinPortlet.java index 818cde2879..51a71f1cd6 100644 --- a/server/src/com/vaadin/server/VaadinPortlet.java +++ b/server/src/com/vaadin/server/VaadinPortlet.java @@ -534,7 +534,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants { */ private void handleOtherRequest(VaadinPortletRequest request, VaadinResponse response, RequestType requestType, - VaadinServiceSession vaadinSession, + VaadinSession vaadinSession, PortletCommunicationManager communicationManager) throws PortletException, IOException, MalformedURLException { if (requestType == RequestType.APP || requestType == RequestType.RENDER) { @@ -619,7 +619,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants { } private void handleServiceException(VaadinPortletRequest request, - VaadinPortletResponse response, VaadinServiceSession vaadinSession, + VaadinPortletResponse response, VaadinSession vaadinSession, Throwable e) throws IOException, PortletException { // TODO Check that this error handler is working when running inside a // portlet diff --git a/server/src/com/vaadin/server/VaadinPortletService.java b/server/src/com/vaadin/server/VaadinPortletService.java index bc51fdd2a5..5651d033be 100644 --- a/server/src/com/vaadin/server/VaadinPortletService.java +++ b/server/src/com/vaadin/server/VaadinPortletService.java @@ -182,7 +182,7 @@ public class VaadinPortletService extends VaadinService { @Override protected AbstractCommunicationManager createCommunicationManager( - VaadinServiceSession session) { + VaadinSession session) { return new PortletCommunicationManager(session); } @@ -200,7 +200,7 @@ public class VaadinPortletService extends VaadinService { } @Override - protected VaadinServiceSession createVaadinSession(VaadinRequest request) + protected VaadinSession createVaadinSession(VaadinRequest request) throws ServiceException { return new VaadinPortletSession(this); } @@ -219,8 +219,8 @@ public class VaadinPortletService extends VaadinService { } @Override - public String getMainDivId(VaadinServiceSession session, - VaadinRequest request, Class<? extends UI> uiClass) { + public String getMainDivId(VaadinSession session, VaadinRequest request, + Class<? extends UI> uiClass) { PortletRequest portletRequest = ((VaadinPortletRequest) request) .getPortletRequest(); /* diff --git a/server/src/com/vaadin/server/VaadinPortletSession.java b/server/src/com/vaadin/server/VaadinPortletSession.java index 6b89342b2b..af7b0f32bf 100644 --- a/server/src/com/vaadin/server/VaadinPortletSession.java +++ b/server/src/com/vaadin/server/VaadinPortletSession.java @@ -56,7 +56,7 @@ import com.vaadin.util.CurrentInstance; */ @Deprecated @SuppressWarnings("serial") -public class VaadinPortletSession extends VaadinServiceSession { +public class VaadinPortletSession extends VaadinSession { private final Set<PortletListener> portletListeners = new LinkedHashSet<PortletListener>(); diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java index d79210206b..2a3c04c49e 100644 --- a/server/src/com/vaadin/server/VaadinService.java +++ b/server/src/com/vaadin/server/VaadinService.java @@ -318,7 +318,7 @@ public abstract class VaadinService implements Serializable { SESSION_DESTROY_METHOD); } - public void fireSessionDestroy(VaadinServiceSession vaadinSession) { + public void fireSessionDestroy(VaadinSession vaadinSession) { // Ignore if the session is being moved to a different backing session if (vaadinSession.getAttribute(REINITIALIZING_SESSION_MARKER) == Boolean.TRUE) { return; @@ -350,32 +350,31 @@ public abstract class VaadinService implements Serializable { * @param request * the request to get a vaadin service session for. * - * @see VaadinServiceSession + * @see VaadinSession * * @return the vaadin service session for the request, or <code>null</code> * if no session is found and this is a request for which a new * session shouldn't be created. */ - public VaadinServiceSession findVaadinSession(VaadinRequest request) + public VaadinSession findVaadinSession(VaadinRequest request) throws ServiceException, SessionExpiredException { - VaadinServiceSession vaadinSession = findOrCreateVaadinSession(request); + VaadinSession vaadinSession = findOrCreateVaadinSession(request); if (vaadinSession == null) { return null; } - VaadinServiceSession.setCurrent(vaadinSession); - request.setAttribute(VaadinServiceSession.class.getName(), - vaadinSession); + VaadinSession.setCurrent(vaadinSession); + request.setAttribute(VaadinSession.class.getName(), vaadinSession); return vaadinSession; } - private VaadinServiceSession findOrCreateVaadinSession(VaadinRequest request) + private VaadinSession findOrCreateVaadinSession(VaadinRequest request) throws SessionExpiredException, ServiceException { boolean requestCanCreateSession = requestCanCreateSession(request); /* Find an existing session for this request. */ - VaadinServiceSession session = getExistingSession(request, + VaadinSession session = getExistingSession(request, requestCanCreateSession); if (session != null) { @@ -418,11 +417,11 @@ public abstract class VaadinService implements Serializable { } - private VaadinServiceSession createAndRegisterSession(VaadinRequest request) + private VaadinSession createAndRegisterSession(VaadinRequest request) throws ServiceException { - VaadinServiceSession session = createVaadinSession(request); + VaadinSession session = createVaadinSession(request); - VaadinServiceSession.setCurrent(session); + VaadinSession.setCurrent(session); session.storeInSession(this, request.getWrappedSession()); @@ -465,7 +464,7 @@ public abstract class VaadinService implements Serializable { * @return a new communication manager */ protected abstract AbstractCommunicationManager createCommunicationManager( - VaadinServiceSession session); + VaadinSession session); /** * Creates a new Vaadin service session. @@ -475,19 +474,19 @@ public abstract class VaadinService implements Serializable { * @throws ServletException * @throws MalformedURLException */ - protected VaadinServiceSession createVaadinSession(VaadinRequest request) + protected VaadinSession createVaadinSession(VaadinRequest request) throws ServiceException { - return new VaadinServiceSession(this); + return new VaadinSession(this); } private void onVaadinSessionStarted(VaadinRequest request, - VaadinServiceSession session) throws ServiceException { + VaadinSession session) throws ServiceException { eventRouter.fireEvent(new SessionInitEvent(this, session, request)); ServletPortletHelper.checkUiProviders(session, this); } - private void closeSession(VaadinServiceSession vaadinSession, + private void closeSession(VaadinSession vaadinSession, WrappedSession session) { if (vaadinSession == null) { return; @@ -498,7 +497,7 @@ public abstract class VaadinService implements Serializable { } } - protected VaadinServiceSession getExistingSession(VaadinRequest request, + protected VaadinSession getExistingSession(VaadinRequest request, boolean allowSessionCreation) throws SessionExpiredException { // Ensures that the session is still valid @@ -508,7 +507,7 @@ public abstract class VaadinService implements Serializable { throw new SessionExpiredException(); } - VaadinServiceSession vaadinSession = VaadinServiceSession + VaadinSession vaadinSession = VaadinSession .getForSession(this, session); if (vaadinSession == null) { @@ -629,7 +628,7 @@ public abstract class VaadinService implements Serializable { * */ public UI findUI(VaadinRequest request) { - VaadinServiceSession session = VaadinServiceSession.getForSession(this, + VaadinSession session = VaadinSession.getForSession(this, request.getWrappedSession()); // Get UI id from the request @@ -690,9 +689,9 @@ public abstract class VaadinService implements Serializable { HashMap<String, Object> attrs = new HashMap<String, Object>(); for (String name : oldSession.getAttributeNames()) { Object value = oldSession.getAttribute(name); - if (value instanceof VaadinServiceSession) { + if (value instanceof VaadinSession) { // set flag to avoid cleanup - VaadinServiceSession serviceSession = (VaadinServiceSession) value; + VaadinSession serviceSession = (VaadinSession) value; serviceSession.setAttribute(REINITIALIZING_SESSION_MARKER, Boolean.TRUE); } @@ -712,8 +711,8 @@ public abstract class VaadinService implements Serializable { newSession.setAttribute(name, value); // Ensure VaadinServiceSession knows where it's stored - if (value instanceof VaadinServiceSession) { - VaadinServiceSession serviceSession = (VaadinServiceSession) value; + if (value instanceof VaadinSession) { + VaadinSession serviceSession = (VaadinSession) value; serviceSession.storeInSession(serviceSession.getService(), newSession); serviceSession @@ -736,7 +735,7 @@ public abstract class VaadinService implements Serializable { * * @return the id to use in the DOM */ - public abstract String getMainDivId(VaadinServiceSession session, + public abstract String getMainDivId(VaadinSession session, VaadinRequest request, Class<? extends UI> uiClass); /** @@ -753,7 +752,7 @@ public abstract class VaadinService implements Serializable { * @param session * the session to close */ - public void closeSession(VaadinServiceSession session) { + public void closeSession(VaadinSession session) { session.removeFromSession(this); } } diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index eb84e54d85..48e5304cc7 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -271,7 +271,7 @@ public class VaadinServlet extends HttpServlet implements Constants { return; } - VaadinServiceSession vaadinSession = null; + VaadinSession vaadinSession = null; try { // If a duplicate "close application" URL is received for an @@ -570,7 +570,7 @@ public class VaadinServlet extends HttpServlet implements Constants { } private void handleServiceException(VaadinServletRequest request, - VaadinServletResponse response, VaadinServiceSession vaadinSession, + VaadinServletResponse response, VaadinSession vaadinSession, Throwable e) throws IOException, ServletException { // if this was an UIDL request, response UIDL back to client if (getRequestType(request) == RequestType.UIDL) { diff --git a/server/src/com/vaadin/server/VaadinServletService.java b/server/src/com/vaadin/server/VaadinServletService.java index faec287166..e1b51fa8ed 100644 --- a/server/src/com/vaadin/server/VaadinServletService.java +++ b/server/src/com/vaadin/server/VaadinServletService.java @@ -160,7 +160,7 @@ public class VaadinServletService extends VaadinService { @Override protected AbstractCommunicationManager createCommunicationManager( - VaadinServiceSession session) { + VaadinSession session) { return new CommunicationManager(session); } @@ -183,8 +183,8 @@ public class VaadinServletService extends VaadinService { } @Override - public String getMainDivId(VaadinServiceSession session, - VaadinRequest request, Class<? extends UI> uiClass) { + public String getMainDivId(VaadinSession session, VaadinRequest request, + Class<? extends UI> uiClass) { String appId = null; try { URL appUrl = getServlet().getApplicationUrl( diff --git a/server/src/com/vaadin/server/VaadinServiceSession.java b/server/src/com/vaadin/server/VaadinSession.java index 109a2f391b..d2eb1a436a 100644 --- a/server/src/com/vaadin/server/VaadinServiceSession.java +++ b/server/src/com/vaadin/server/VaadinSession.java @@ -51,16 +51,15 @@ import com.vaadin.util.ReflectTools; * typically stored in a {@link HttpSession} or {@link PortletSession}, but * others storage mechanisms might also be used. * <p> - * Everything inside a {@link VaadinServiceSession} should be serializable to - * ensure compatibility with schemes using serialization for persisting the - * session data. + * Everything inside a {@link VaadinSession} should be serializable to ensure + * compatibility with schemes using serialization for persisting the session + * data. * * @author Vaadin Ltd * @since 7.0.0 */ @SuppressWarnings("serial") -public class VaadinServiceSession implements HttpSessionBindingListener, - Serializable { +public class VaadinSession implements HttpSessionBindingListener, Serializable { /** * The name of the parameter that is by default used in e.g. web.xml to @@ -132,7 +131,7 @@ public class VaadinServiceSession implements HttpSessionBindingListener, * @param service * the Vaadin service for the new session */ - public VaadinServiceSession(VaadinService service) { + public VaadinSession(VaadinService service) { this.service = service; } @@ -222,13 +221,12 @@ public class VaadinServiceSession implements HttpSessionBindingListener, * @deprecated might be refactored or removed before 7.0.0 */ @Deprecated - public static VaadinServiceSession getForSession(VaadinService service, + public static VaadinSession getForSession(VaadinService service, WrappedSession underlyingSession) { - Object attribute = underlyingSession - .getAttribute(VaadinServiceSession.class.getName() + "." - + service.getServiceName()); - if (attribute instanceof VaadinServiceSession) { - VaadinServiceSession vaadinSession = (VaadinServiceSession) attribute; + Object attribute = underlyingSession.getAttribute(VaadinSession.class + .getName() + "." + service.getServiceName()); + if (attribute instanceof VaadinSession) { + VaadinSession vaadinSession = (VaadinSession) attribute; vaadinSession.session = underlyingSession; return vaadinSession; } @@ -246,8 +244,9 @@ public class VaadinServiceSession implements HttpSessionBindingListener, public void removeFromSession(VaadinService service) { assert (getForSession(service, session) == this); - session.setAttribute(VaadinServiceSession.class.getName() + "." - + service.getServiceName(), null); + session.setAttribute( + VaadinSession.class.getName() + "." + service.getServiceName(), + null); } /** @@ -257,8 +256,9 @@ public class VaadinServiceSession implements HttpSessionBindingListener, */ @Deprecated public void storeInSession(VaadinService service, WrappedSession session) { - session.setAttribute(VaadinServiceSession.class.getName() + "." - + service.getServiceName(), this); + session.setAttribute( + VaadinSession.class.getName() + "." + service.getServiceName(), + this); this.session = session; } @@ -453,12 +453,12 @@ public class VaadinServiceSession implements HttpSessionBindingListener, * @return the current session instance if available, otherwise * <code>null</code> * - * @see #setCurrent(VaadinServiceSession) + * @see #setCurrent(VaadinSession) * * @since 7.0 */ - public static VaadinServiceSession getCurrent() { - return CurrentInstance.get(VaadinServiceSession.class); + public static VaadinSession getCurrent() { + return CurrentInstance.get(VaadinSession.class); } /** @@ -478,8 +478,8 @@ public class VaadinServiceSession implements HttpSessionBindingListener, * * @since 7.0 */ - public static void setCurrent(VaadinServiceSession session) { - CurrentInstance.setInheritable(VaadinServiceSession.class, session); + public static void setCurrent(VaadinSession session) { + CurrentInstance.setInheritable(VaadinSession.class, session); } /** @@ -513,7 +513,7 @@ public class VaadinServiceSession implements HttpSessionBindingListener, } private static final Logger getLogger() { - return Logger.getLogger(VaadinServiceSession.class.getName()); + return Logger.getLogger(VaadinSession.class.getName()); } /** @@ -926,9 +926,9 @@ public class VaadinServiceSession implements HttpSessionBindingListener, * browser unload the invalidated UI. * <p> * This method is just a shorthand to - * {@link VaadinService#closeSession(VaadinServiceSession)} + * {@link VaadinService#closeSession(VaadinSession)} * - * @see VaadinService#closeSession(VaadinServiceSession) + * @see VaadinService#closeSession(VaadinSession) * */ public void close() { diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 5589223ac5..57032f58a8 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -33,7 +33,7 @@ import com.vaadin.server.ComponentSizeValidator; import com.vaadin.server.ErrorMessage; import com.vaadin.server.Resource; import com.vaadin.server.Terminal; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.shared.ComponentConstants; import com.vaadin.shared.ComponentState; import com.vaadin.shared.ui.ComponentStateUtil; @@ -262,7 +262,7 @@ public abstract class AbstractComponent extends AbstractClientConnector if (parent != null) { return parent.getLocale(); } - final VaadinServiceSession session = getSession(); + final VaadinSession session = getSession(); if (session != null) { return session.getLocale(); } @@ -569,7 +569,7 @@ public abstract class AbstractComponent extends AbstractClientConnector */ protected void focus() { if (this instanceof Focusable) { - final VaadinServiceSession session = getSession(); + final VaadinSession session = getSession(); if (session != null) { getUI().setFocusedComponent((Focusable) this); delayedFocus = false; diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index e4cee9386a..342983e8b8 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -37,7 +37,7 @@ import com.vaadin.server.PaintTarget; import com.vaadin.server.UIProvider; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinService; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.server.VaadinServlet; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; @@ -60,10 +60,9 @@ import com.vaadin.util.ReflectTools; * <p> * When a new UI instance is needed, typically because the user opens a URL in a * browser window which points to e.g. {@link VaadinServlet}, all - * {@link UIProvider}s registered to the current {@link VaadinServiceSession} - * are queried for the UI class that should be used. The selection is by defaylt - * based on the {@value VaadinServiceSession#UI_PARAMETER} parameter from - * web.xml. + * {@link UIProvider}s registered to the current {@link VaadinSession} are + * queried for the UI class that should be used. The selection is by defaylt + * based on the {@value VaadinSession#UI_PARAMETER} parameter from web.xml. * </p> * <p> * After a UI has been created by the application, it is initialized using @@ -121,7 +120,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements /** * The application to which this UI belongs */ - private VaadinServiceSession session; + private VaadinSession session; /** * List of windows in this UI. @@ -139,7 +138,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * which a request originates. A negative value indicates that the UI id has * not yet been assigned by the Application. * - * @see VaadinServiceSession#getNextUIid() + * @see VaadinSession#getNextUIid() */ private int uiId = -1; @@ -235,8 +234,8 @@ public abstract class UI extends AbstractSingleComponentContainer implements * <p> * Getting a null value is often a problem in constructors of regular * components and in the initializers of custom composite components. A - * standard workaround is to use {@link VaadinServiceSession#getCurrent()} - * to retrieve the application instance that the current request relates to. + * standard workaround is to use {@link VaadinSession#getCurrent()} to + * retrieve the application instance that the current request relates to. * Another way is to move the problematic initialization to * {@link #attach()}, as described in the documentation of the method. * </p> @@ -245,7 +244,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * @see #attach() */ @Override - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return session; } @@ -365,7 +364,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * * @see #getSession() */ - public void setSession(VaadinServiceSession session) { + public void setSession(VaadinSession session) { if ((session == null) == (this.session == null)) { throw new IllegalStateException( "VaadinServiceSession has already been set. Old session: " @@ -384,7 +383,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements } } - private static String getSessionDetails(VaadinServiceSession session) { + private static String getSessionDetails(VaadinSession session) { if (session == null) { return null; } else { @@ -947,7 +946,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * heartbeat for this UI. * * @see #heartbeat() - * @see VaadinServiceSession#cleanupInactiveUIs() + * @see VaadinSession#cleanupInactiveUIs() * * @return The time the last heartbeat request occurred. */ diff --git a/server/tests/src/com/vaadin/tests/VaadinClasses.java b/server/tests/src/com/vaadin/tests/VaadinClasses.java index b0d06ea897..e88786432c 100644 --- a/server/tests/src/com/vaadin/tests/VaadinClasses.java +++ b/server/tests/src/com/vaadin/tests/VaadinClasses.java @@ -17,7 +17,7 @@ import java.util.jar.JarEntry; import org.junit.Test; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.CustomComponent; @@ -144,7 +144,7 @@ public class VaadinClasses { String basePackage, String[] ignoredPackages) throws IOException { List<Class<? extends T>> classes = new ArrayList<Class<? extends T>>(); String basePackageDirName = "/" + basePackage.replace('.', '/'); - URL location = VaadinServiceSession.class + URL location = VaadinSession.class .getResource(basePackageDirName); if (location.getProtocol().equals("file")) { try { diff --git a/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java b/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java index 0ba7779e79..e074b60f73 100644 --- a/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java +++ b/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java @@ -21,7 +21,7 @@ import junit.framework.TestCase; import com.vaadin.data.util.converter.Converter; import com.vaadin.data.util.converter.DefaultConverterFactory; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.TextField; public class ConverterFactory extends TestCase { @@ -65,15 +65,15 @@ public class ConverterFactory extends TestCase { } public void testApplicationConverterFactoryInBackgroundThread() { - VaadinServiceSession.setCurrent(null); - final VaadinServiceSession appWithCustomIntegerConverter = new VaadinServiceSession( + VaadinSession.setCurrent(null); + final VaadinSession appWithCustomIntegerConverter = new VaadinSession( null); appWithCustomIntegerConverter .setConverterFactory(new ConverterFactory42()); TextField tf = new TextField("", "123") { @Override - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return appWithCustomIntegerConverter; }; }; @@ -84,11 +84,11 @@ public class ConverterFactory extends TestCase { } public void testApplicationConverterFactoryForDetachedComponent() { - final VaadinServiceSession appWithCustomIntegerConverter = new VaadinServiceSession( + final VaadinSession appWithCustomIntegerConverter = new VaadinSession( null); appWithCustomIntegerConverter .setConverterFactory(new ConverterFactory42()); - VaadinServiceSession.setCurrent(appWithCustomIntegerConverter); + VaadinSession.setCurrent(appWithCustomIntegerConverter); TextField tf = new TextField("", "123"); tf.setConverter(Integer.class); @@ -98,15 +98,15 @@ public class ConverterFactory extends TestCase { } public void testApplicationConverterFactoryForDifferentThanCurrentApplication() { - final VaadinServiceSession fieldAppWithCustomIntegerConverter = new VaadinServiceSession( + final VaadinSession fieldAppWithCustomIntegerConverter = new VaadinSession( null); fieldAppWithCustomIntegerConverter .setConverterFactory(new ConverterFactory42()); - VaadinServiceSession.setCurrent(new VaadinServiceSession(null)); + VaadinSession.setCurrent(new VaadinSession(null)); TextField tf = new TextField("", "123") { @Override - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return fieldAppWithCustomIntegerConverter; } }; diff --git a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java index 5c74077ca9..f8dceca363 100644 --- a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java +++ b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java @@ -7,7 +7,7 @@ import org.easymock.EasyMock; import com.vaadin.server.CommunicationManager; import com.vaadin.server.StreamVariable; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.UI; import com.vaadin.ui.Upload; @@ -21,7 +21,7 @@ public class TestStreamVariableMapping extends TestCase { @Override protected void setUp() throws Exception { - final VaadinServiceSession application = new VaadinServiceSession(null); + final VaadinSession application = new VaadinSession(null); final UI uI = new UI() { @Override protected void init(VaadinRequest request) { @@ -30,7 +30,7 @@ public class TestStreamVariableMapping extends TestCase { } @Override - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return application; } }; @@ -66,7 +66,7 @@ public class TestStreamVariableMapping extends TestCase { } private CommunicationManager createCommunicationManager() { - return new CommunicationManager(new VaadinServiceSession(null)); + return new CommunicationManager(new VaadinSession(null)); } } diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java index 83224861b6..16c7c4060d 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java @@ -12,7 +12,7 @@ import com.vaadin.data.util.ObjectProperty; import com.vaadin.data.util.converter.Converter; import com.vaadin.data.util.converter.Converter.ConversionException; import com.vaadin.data.util.converter.StringToIntegerConverter; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.data.bean.Address; import com.vaadin.tests.data.bean.Country; import com.vaadin.tests.data.bean.Person; @@ -157,11 +157,11 @@ public class AbstractFieldValueConversions extends TestCase { } public void testNumberDoubleConverterChange() { - final VaadinServiceSession a = new VaadinServiceSession(null); - VaadinServiceSession.setCurrent(a); + final VaadinSession a = new VaadinSession(null); + VaadinSession.setCurrent(a); TextField tf = new TextField() { @Override - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return a; } }; diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java index 43a7d90922..9338d74f05 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java @@ -6,7 +6,7 @@ import java.util.Locale; import junit.framework.TestCase; import com.vaadin.data.util.MethodProperty; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.data.bean.Address; import com.vaadin.tests.data.bean.Country; import com.vaadin.tests.data.bean.Person; @@ -26,8 +26,8 @@ public class DefaultConverterFactory extends TestCase { } public void testDefaultNumberConversion() { - VaadinServiceSession app = new VaadinServiceSession(null); - VaadinServiceSession.setCurrent(app); + VaadinSession app = new VaadinSession(null); + VaadinSession.setCurrent(app); TextField tf = new TextField(); tf.setLocale(new Locale("en", "US")); tf.setPropertyDataSource(new MethodProperty<Integer>(paulaBean, diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java index e81f4ac6f7..577275b4d9 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java @@ -8,7 +8,7 @@ import com.vaadin.data.Property; import com.vaadin.data.util.AbstractProperty; import com.vaadin.data.util.converter.Converter.ConversionException; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.AbstractField; import com.vaadin.ui.UI; @@ -18,7 +18,7 @@ public class RemoveListenersOnDetach { int numReadOnlyChanges = 0; AbstractField field = new AbstractField() { - final private VaadinServiceSession application = new VaadinServiceSession( + final private VaadinSession application = new VaadinSession( null); private UI uI = new UI() { @@ -28,7 +28,7 @@ public class RemoveListenersOnDetach { } @Override - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return application; } @@ -58,7 +58,7 @@ public class RemoveListenersOnDetach { }; @Override - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return application; }; }; diff --git a/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java b/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java index 68e983f8a5..5a27a192c2 100644 --- a/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java +++ b/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java @@ -19,7 +19,7 @@ import junit.framework.TestCase; import com.vaadin.data.Property; import com.vaadin.data.util.MethodProperty; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.data.bean.Person; import com.vaadin.ui.Label; @@ -37,7 +37,7 @@ public class LabelConverters extends TestCase { } public void testIntegerDataSource() { - VaadinServiceSession.setCurrent(new VaadinServiceSession(null)); + VaadinSession.setCurrent(new VaadinSession(null)); Label l = new Label("Foo"); Property ds = new MethodProperty<Integer>(Person.createTestPerson1(), "age"); diff --git a/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoader.java b/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoader.java index 71749ed964..e02fafeaff 100644 --- a/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoader.java +++ b/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoader.java @@ -14,7 +14,7 @@ import com.vaadin.server.DeploymentConfiguration; import com.vaadin.server.UIClassSelectionEvent; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinService; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.UI; public class CustomUIClassLoader extends TestCase { @@ -53,7 +53,7 @@ public class CustomUIClassLoader extends TestCase { * if thrown */ public void testWithNullClassLoader() throws Exception { - VaadinServiceSession application = createStubApplication(); + VaadinSession application = createStubApplication(); application.setConfiguration(createConfigurationMock()); DefaultUIProvider uiProvider = new DefaultUIProvider(); @@ -65,7 +65,7 @@ public class CustomUIClassLoader extends TestCase { private static DeploymentConfiguration createConfigurationMock() { Properties properties = new Properties(); - properties.put(VaadinServiceSession.UI_PARAMETER, MyUI.class.getName()); + properties.put(VaadinSession.UI_PARAMETER, MyUI.class.getName()); return new DefaultDeploymentConfiguration(CustomUIClassLoader.class, properties); } @@ -111,8 +111,8 @@ public class CustomUIClassLoader extends TestCase { } - private VaadinServiceSession createStubApplication() { - return new VaadinServiceSession(null) { + private VaadinSession createStubApplication() { + return new VaadinSession(null) { @Override public DeploymentConfiguration getConfiguration() { return createConfigurationMock(); diff --git a/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java b/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java index 031b332ee7..bf6d127a83 100644 --- a/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java +++ b/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java @@ -7,7 +7,7 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; import com.vaadin.server.LegacyApplication; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.UI; import com.vaadin.ui.Window; @@ -25,7 +25,7 @@ public class AddRemoveSubWindow { @Test public void addSubWindow() { - VaadinServiceSession.setCurrent(new VaadinServiceSession(null)); + VaadinSession.setCurrent(new VaadinSession(null)); TestApp app = new TestApp(); app.init(); Window subWindow = new Window("Sub window"); diff --git a/server/tests/src/com/vaadin/tests/server/component/window/AttachDetachWindow.java b/server/tests/src/com/vaadin/tests/server/component/window/AttachDetachWindow.java index a00e5e0996..63a58bcab3 100644 --- a/server/tests/src/com/vaadin/tests/server/component/window/AttachDetachWindow.java +++ b/server/tests/src/com/vaadin/tests/server/component/window/AttachDetachWindow.java @@ -7,7 +7,7 @@ import org.junit.Test; import com.vaadin.server.ClientConnector; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.Label; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; @@ -15,7 +15,7 @@ import com.vaadin.ui.Window; public class AttachDetachWindow { - private VaadinServiceSession testApp = new VaadinServiceSession(null); + private VaadinSession testApp = new VaadinSession(null); private interface TestContainer { public boolean attachCalled(); @@ -24,7 +24,7 @@ public class AttachDetachWindow { public TestContent getTestContent(); - public VaadinServiceSession getSession(); + public VaadinSession getSession(); } private class TestWindow extends Window implements TestContainer { @@ -64,7 +64,7 @@ public class AttachDetachWindow { } @Override - public VaadinServiceSession getSession() { + public VaadinSession getSession() { return super.getSession(); } } @@ -243,7 +243,7 @@ public class AttachDetachWindow { getSession(win.getTestContent().child), null); } - private VaadinServiceSession getSession(ClientConnector testContainer) { + private VaadinSession getSession(ClientConnector testContainer) { UI ui = testContainer.getUI(); if (ui != null) { return ui.getSession(); diff --git a/server/tests/src/com/vaadin/ui/LabelDataSource.java b/server/tests/src/com/vaadin/ui/LabelDataSource.java index 7ef8d67c2a..4240735f63 100644 --- a/server/tests/src/com/vaadin/ui/LabelDataSource.java +++ b/server/tests/src/com/vaadin/ui/LabelDataSource.java @@ -23,7 +23,7 @@ import org.junit.Test; import com.vaadin.data.util.ObjectProperty; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; public class LabelDataSource { @@ -35,12 +35,12 @@ public class LabelDataSource { private static final Object INTEGER_STRING_VALUE_DE = "1.587"; ObjectProperty<String> stringDataSource; private ObjectProperty<Integer> integerDataSource; - VaadinServiceSession vaadinSession; + VaadinSession vaadinSession; @Before public void setup() { - vaadinSession = new VaadinServiceSession(null); - VaadinServiceSession.setCurrent(vaadinSession); + vaadinSession = new VaadinSession(null); + VaadinSession.setCurrent(vaadinSession); label = new Label(); stringDataSource = new ObjectProperty<String>(STRING_DS_VALUE); diff --git a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java index 0634943d09..c356465fcc 100644 --- a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -37,7 +37,7 @@ import com.vaadin.server.SessionInitListener; import com.vaadin.server.UIClassSelectionEvent; import com.vaadin.server.UIProvider; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.server.VaadinServletRequest; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.UI; @@ -135,7 +135,7 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { } protected void onVaadinSessionStarted(VaadinRequest request, - VaadinServiceSession session) throws ServiceException { + VaadinSession session) throws ServiceException { try { final Class<?> classToRun = getClassToRun(); if (UI.class.isAssignableFrom(classToRun)) { diff --git a/uitest/src/com/vaadin/tests/ModalWindow.java b/uitest/src/com/vaadin/tests/ModalWindow.java index 4793797941..156f42adf3 100644 --- a/uitest/src/com/vaadin/tests/ModalWindow.java +++ b/uitest/src/com/vaadin/tests/ModalWindow.java @@ -31,7 +31,7 @@ import com.vaadin.ui.Window; * * @author Vaadin Ltd. * @since 4.0.1 - * @see com.vaadin.server.VaadinServiceSession + * @see com.vaadin.server.VaadinSession * @see com.vaadin.ui.Window * @see com.vaadin.ui.Label */ diff --git a/uitest/src/com/vaadin/tests/Parameters.java b/uitest/src/com/vaadin/tests/Parameters.java index 1ea02699ce..feb9a8cf6b 100644 --- a/uitest/src/com/vaadin/tests/Parameters.java +++ b/uitest/src/com/vaadin/tests/Parameters.java @@ -25,7 +25,7 @@ import com.vaadin.server.ExternalResource; import com.vaadin.server.RequestHandler; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinResponse; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.Label; import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.Link; @@ -55,7 +55,7 @@ public class Parameters extends com.vaadin.server.LegacyApplication implements setMainWindow(main); // This class acts both as URI handler and parameter handler - VaadinServiceSession.getCurrent().addRequestHandler(this); + VaadinSession.getCurrent().addRequestHandler(this); final VerticalLayout layout = new VerticalLayout(); final Label info = new Label("To test URI and Parameter Handlers, " @@ -107,7 +107,7 @@ public class Parameters extends com.vaadin.server.LegacyApplication implements } @Override - public boolean handleRequest(VaadinServiceSession session, + public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { context.setValue("Context not available"); relative.setValue(request.getRequestPathInfo()); diff --git a/uitest/src/com/vaadin/tests/TestBench.java b/uitest/src/com/vaadin/tests/TestBench.java index d18ce04f64..6d5e162301 100644 --- a/uitest/src/com/vaadin/tests/TestBench.java +++ b/uitest/src/com/vaadin/tests/TestBench.java @@ -311,7 +311,7 @@ public class TestBench extends com.vaadin.server.LegacyApplication implements final Class<?> c = Class.forName(p); if (c.getSuperclass() != null) { if ((c.getSuperclass() - .equals(com.vaadin.server.VaadinServiceSession.class))) { + .equals(com.vaadin.server.VaadinSession.class))) { classes.add(c); } else if ((c.getSuperclass() .equals(com.vaadin.ui.CustomComponent.class))) { diff --git a/uitest/src/com/vaadin/tests/TreeFilesystem.java b/uitest/src/com/vaadin/tests/TreeFilesystem.java index d127095c6f..67da6c273a 100644 --- a/uitest/src/com/vaadin/tests/TreeFilesystem.java +++ b/uitest/src/com/vaadin/tests/TreeFilesystem.java @@ -19,7 +19,7 @@ package com.vaadin.tests; import java.io.File; import com.vaadin.data.Item; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.util.SampleDirectory; import com.vaadin.ui.Label; @@ -67,7 +67,7 @@ public class TreeFilesystem extends com.vaadin.server.LegacyApplication // Get sample directory final File sampleDir = SampleDirectory.getDirectory( - VaadinServiceSession.getCurrent(), main); + VaadinSession.getCurrent(), main); // populate tree's root node with example directory if (sampleDir != null) { populateNode(sampleDir.getAbsolutePath(), null); diff --git a/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java b/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java index 00f3b15fd0..92c53524e2 100644 --- a/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java +++ b/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java @@ -20,7 +20,7 @@ import java.io.File; import com.vaadin.data.util.FilesystemContainer; import com.vaadin.data.util.FilesystemContainer.FileItem; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.util.SampleDirectory; import com.vaadin.ui.Component.Event; import com.vaadin.ui.Component.Listener; @@ -85,7 +85,7 @@ public class TreeFilesystemContainer extends // Get sample directory final File sampleDir = SampleDirectory.getDirectory( - VaadinServiceSession.getCurrent(), w); + VaadinSession.getCurrent(), w); // Populate tree with FilesystemContainer final FilesystemContainer fsc = new FilesystemContainer(sampleDir, true); filesystem.setContainerDataSource(fsc); diff --git a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java index ac4e421fdc..57c4e3c7b9 100644 --- a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java +++ b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java @@ -3,7 +3,7 @@ package com.vaadin.tests.application; import com.vaadin.server.DownloadStream; import com.vaadin.server.PaintException; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.tests.integration.FlagSeResource; import com.vaadin.tests.util.Log; @@ -14,7 +14,7 @@ import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.UI; public class ThreadLocalInstances extends AbstractTestCase { - private static final VaadinServiceSession staticInitApplication = VaadinServiceSession + private static final VaadinSession staticInitApplication = VaadinSession .getCurrent(); private static final UI staticInitRoot = UI.getCurrent(); @@ -90,10 +90,10 @@ public class ThreadLocalInstances extends AbstractTestCase { } private void reportCurrentStatus(String phase) { - reportStatus(phase, VaadinServiceSession.getCurrent(), UI.getCurrent()); + reportStatus(phase, VaadinSession.getCurrent(), UI.getCurrent()); } - private void reportStatus(String phase, VaadinServiceSession application, + private void reportStatus(String phase, VaadinSession application, UI uI) { log.log(getState(application, this) + " app in " + phase); log.log(getState(uI, mainWindow) + " root in " + phase); diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestCase.java b/uitest/src/com/vaadin/tests/components/AbstractTestCase.java index e7423173c7..1f117a8ea8 100644 --- a/uitest/src/com/vaadin/tests/components/AbstractTestCase.java +++ b/uitest/src/com/vaadin/tests/components/AbstractTestCase.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components; import com.vaadin.server.LegacyApplication; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WebBrowser; public abstract class AbstractTestCase extends LegacyApplication { @@ -11,7 +11,7 @@ public abstract class AbstractTestCase extends LegacyApplication { protected abstract Integer getTicketNumber(); protected WebBrowser getBrowser() { - WebBrowser webBrowser = VaadinServiceSession.getCurrent().getBrowser(); + WebBrowser webBrowser = VaadinSession.getCurrent().getBrowser(); return webBrowser; } diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestUIProvider.java b/uitest/src/com/vaadin/tests/components/AbstractTestUIProvider.java index 2bb460e8b5..9ad6bbf56f 100644 --- a/uitest/src/com/vaadin/tests/components/AbstractTestUIProvider.java +++ b/uitest/src/com/vaadin/tests/components/AbstractTestUIProvider.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components; import com.vaadin.server.UIProvider; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WebBrowser; public abstract class AbstractTestUIProvider extends UIProvider { @@ -10,7 +10,7 @@ public abstract class AbstractTestUIProvider extends UIProvider { protected abstract Integer getTicketNumber(); protected WebBrowser getBrowser() { - WebBrowser webBrowser = VaadinServiceSession.getCurrent().getBrowser(); + WebBrowser webBrowser = VaadinSession.getCurrent().getBrowser(); return webBrowser; } } diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java b/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java index 971bd1cbe3..2eef498aff 100644 --- a/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java +++ b/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java @@ -8,7 +8,7 @@ import com.vaadin.data.Container; import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; import com.vaadin.ui.AbstractField; @@ -55,7 +55,7 @@ public abstract class AbstractComponentDataBindingTest extends TestBase } protected void updateLocale(Locale locale) { - VaadinServiceSession.getCurrent().setLocale(locale); + VaadinSession.getCurrent().setLocale(locale); for (Component c : fields) { removeComponent(c); } diff --git a/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java b/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java index 53df69f028..49b8472a7a 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java @@ -5,7 +5,7 @@ import java.util.concurrent.atomic.AtomicInteger; import com.vaadin.server.UIClassSelectionEvent; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.components.AbstractTestUIProvider; import com.vaadin.ui.Label; import com.vaadin.ui.UI; @@ -13,12 +13,12 @@ import com.vaadin.ui.VerticalLayout; public class UIsInMultipleTabs extends AbstractTestUIProvider { // No cleanup -> will leak, but shouldn't matter for tests - private static ConcurrentHashMap<VaadinServiceSession, AtomicInteger> numberOfUIsOpened = new ConcurrentHashMap<VaadinServiceSession, AtomicInteger>(); + private static ConcurrentHashMap<VaadinSession, AtomicInteger> numberOfUIsOpened = new ConcurrentHashMap<VaadinSession, AtomicInteger>(); public static class TabUI extends UI { @Override protected void init(VaadinRequest request) { - VaadinServiceSession application = VaadinServiceSession + VaadinSession application = VaadinSession .getCurrent(); AtomicInteger count = numberOfUIsOpened.get(application); if (count == null) { diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java index ba7ef78ec1..858f202e6d 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java @@ -17,7 +17,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; @@ -41,7 +41,7 @@ public class FindCurrentUI extends UI { @Override public void buttonClick(ClickEvent event) { String msg = "Running in "; - msg += VaadinServiceSession.getCurrent().getConfiguration() + msg += VaadinSession.getCurrent().getConfiguration() .isProductionMode() ? "production" : "debug"; Notification.show(msg); } diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java index 67b5e3e347..9b5be40aa3 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java @@ -16,7 +16,7 @@ import com.vaadin.server.LegacyApplication; import com.vaadin.server.RequestHandler; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinResponse; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.Link; @@ -29,7 +29,7 @@ public class Ticket1589 extends LegacyApplication { MyDynamicResource res = new MyDynamicResource(); - VaadinServiceSession.getCurrent().addRequestHandler(res); + VaadinSession.getCurrent().addRequestHandler(res); w.addComponent(new Link( "Test (without Content-Disposition, should suggest generatedFile.png when saving, browser default for actual disposition)", @@ -52,7 +52,7 @@ class MyDynamicResource implements RequestHandler { * stream that contains the response from the server. */ @Override - public boolean handleRequest(VaadinServiceSession session, + public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { String relativeUri = request.getRequestPathInfo(); // Catch the given URI that identifies the resource, otherwise let other diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1921.java b/uitest/src/com/vaadin/tests/tickets/Ticket1921.java index cde90ff3d6..79dcd3bd71 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1921.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1921.java @@ -7,7 +7,7 @@ import com.vaadin.server.LegacyApplication; import com.vaadin.server.RequestHandler; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinResponse; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; @@ -42,7 +42,7 @@ public class Ticket1921 extends LegacyApplication implements RequestHandler { newState(); - VaadinServiceSession.getCurrent().addRequestHandler(this); + VaadinSession.getCurrent().addRequestHandler(this); } public void newState() { @@ -94,7 +94,7 @@ public class Ticket1921 extends LegacyApplication implements RequestHandler { } @Override - public boolean handleRequest(VaadinServiceSession session, + public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { Map<String, String[]> parameters = request.getParameterMap(); String[] s = parameters.get("state"); diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2292.java b/uitest/src/com/vaadin/tests/tickets/Ticket2292.java index f6ec542ad2..2fd843ede6 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2292.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2292.java @@ -14,7 +14,7 @@ import com.vaadin.server.ExternalResource; import com.vaadin.server.RequestHandler; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinResponse; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Label; @@ -44,11 +44,11 @@ public class Ticket2292 extends com.vaadin.server.LegacyApplication implements Link l = new Link("l", icon); main.addComponent(l); - VaadinServiceSession.getCurrent().addRequestHandler(this); + VaadinSession.getCurrent().addRequestHandler(this); } @Override - public boolean handleRequest(VaadinServiceSession session, + public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { String relativeUri = request.getRequestPathInfo(); diff --git a/uitest/src/com/vaadin/tests/util/SampleDirectory.java b/uitest/src/com/vaadin/tests/util/SampleDirectory.java index 74b5dfe5e8..0eeae4ca9e 100644 --- a/uitest/src/com/vaadin/tests/util/SampleDirectory.java +++ b/uitest/src/com/vaadin/tests/util/SampleDirectory.java @@ -20,7 +20,7 @@ import java.io.File; import com.vaadin.server.SystemError; import com.vaadin.server.VaadinService; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Label; import com.vaadin.ui.LegacyWindow; @@ -43,7 +43,7 @@ public class SampleDirectory { * @param application * @return file pointing to sample directory */ - public static File getDirectory(VaadinServiceSession application, + public static File getDirectory(VaadinSession application, LegacyWindow uI) { String errorMessage = "Access to application " + "context base directory failed, " |