From 0cc297225631667f76ca16fbfee49f68fca5fbb1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Thu, 22 Dec 2011 09:42:16 +0200 Subject: [PATCH] RootRequiresMoreInformation -> RootRequiresMoreInformationException --- src/com/vaadin/Application.java | 24 +++++++++---------- ...RootRequiresMoreInformationException.java} | 2 +- src/com/vaadin/terminal/WrappedRequest.java | 4 ++-- .../server/AbstractApplicationPortlet.java | 4 ++-- .../server/AbstractCommunicationManager.java | 4 ++-- .../terminal/gwt/server/BootstrapHandler.java | 4 ++-- .../application/ThreadLocalInstances.java | 4 ++-- .../tests/components/root/LazyInitRoots.java | 6 ++--- 8 files changed, 26 insertions(+), 26 deletions(-) rename src/com/vaadin/{RootRequiresMoreInformation.java => RootRequiresMoreInformationException.java} (89%) diff --git a/src/com/vaadin/Application.java b/src/com/vaadin/Application.java index 3875dfa860..15945d6971 100644 --- a/src/com/vaadin/Application.java +++ b/src/com/vaadin/Application.java @@ -134,12 +134,12 @@ public class Application implements Terminal.ErrorListener, Serializable { * the request to get the root for * @return integer id of the root, or null if no root is * found - * @throws RootRequiresMoreInformation + * @throws RootRequiresMoreInformationException * if full details from the browser are required to resolve * the root */ public Integer getPreservedRootForRequest(WrappedRequest request) - throws RootRequiresMoreInformation; + throws RootRequiresMoreInformationException; /** * Used to tell whether the browser details are required when @@ -171,13 +171,13 @@ public class Application implements Terminal.ErrorListener, Serializable { private final Map retainOnRefreshRoots = new HashMap(); public Integer getPreservedRootForRequest(WrappedRequest request) - throws RootRequiresMoreInformation { + throws RootRequiresMoreInformationException { if (retainOnRefreshRoots.isEmpty()) { return null; } BrowserDetails browserDetails = request.getBrowserDetails(); if (browserDetails == null) { - throw new RootRequiresMoreInformation(); + throw new RootRequiresMoreInformationException(); } else { String windowName = browserDetails.getWindowName(); return retainOnRefreshRoots.get(windowName); @@ -1885,7 +1885,7 @@ public class Application implements Terminal.ErrorListener, Serializable { * *

* If {@link BrowserDetails} are required to create a Root, the - * implementation can throw a {@link RootRequiresMoreInformation} exception. + * implementation can throw a {@link RootRequiresMoreInformationException} exception. * In this case, the framework will instruct the browser to send the * additional details, whereupon this method is invoked again with the * browser details present in the wrapped request. Throwing the exception if @@ -1901,19 +1901,19 @@ public class Application implements Terminal.ErrorListener, Serializable { * @param request * the wrapped request for which a root is needed * @return a root instance to use for the request - * @throws RootRequiresMoreInformation + * @throws RootRequiresMoreInformationException * may be thrown by an implementation to indicate that * {@link BrowserDetails} are required to create a root * * @see #getRootClassName(WrappedRequest) * @see Root - * @see RootRequiresMoreInformation + * @see RootRequiresMoreInformationException * @see WrappedRequest#getBrowserDetails() * * @since 7.0 */ protected Root getRoot(WrappedRequest request) - throws RootRequiresMoreInformation { + throws RootRequiresMoreInformationException { String rootClassName = getRootClassName(request); try { Class rootClass = Class.forName(rootClassName) @@ -2260,7 +2260,7 @@ public class Application implements Terminal.ErrorListener, Serializable { * Finds the {@link Root} to which a particular request belongs. If the * request originates from an existing Root, that root is returned. In other * cases, the method attempts to create and initialize a new root and might - * throw a {@link RootRequiresMoreInformation} if all required information + * throw a {@link RootRequiresMoreInformationException} if all required information * is not available. *

* Please note that this method can also return a newly created @@ -2273,17 +2273,17 @@ public class Application implements Terminal.ErrorListener, Serializable { * @param request * the request for which a root is desired * @return a root belonging to the request - * @throws RootRequiresMoreInformation + * @throws RootRequiresMoreInformationException * if no existing root could be found and creating a new root * requires additional information from the browser * * @see #getRoot(WrappedRequest) - * @see RootRequiresMoreInformation + * @see RootRequiresMoreInformationException * * @since 7.0 */ public Root getRootForRequest(WrappedRequest request) - throws RootRequiresMoreInformation { + throws RootRequiresMoreInformationException { Root root = Root.getCurrentRoot(); if (root != null) { return root; diff --git a/src/com/vaadin/RootRequiresMoreInformation.java b/src/com/vaadin/RootRequiresMoreInformationException.java similarity index 89% rename from src/com/vaadin/RootRequiresMoreInformation.java rename to src/com/vaadin/RootRequiresMoreInformationException.java index 1268081978..ed0fa41437 100644 --- a/src/com/vaadin/RootRequiresMoreInformation.java +++ b/src/com/vaadin/RootRequiresMoreInformationException.java @@ -20,6 +20,6 @@ import com.vaadin.terminal.WrappedRequest.BrowserDetails; * * @since 7.0 */ -public class RootRequiresMoreInformation extends Exception { +public class RootRequiresMoreInformationException extends Exception { // Nothing of interest here } diff --git a/src/com/vaadin/terminal/WrappedRequest.java b/src/com/vaadin/terminal/WrappedRequest.java index 89be8a32e4..235a0513c7 100644 --- a/src/com/vaadin/terminal/WrappedRequest.java +++ b/src/com/vaadin/terminal/WrappedRequest.java @@ -15,7 +15,7 @@ import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; import com.vaadin.Application; -import com.vaadin.RootRequiresMoreInformation; +import com.vaadin.RootRequiresMoreInformationException; import com.vaadin.annotations.RootInitRequiresBrowserDetails; import com.vaadin.terminal.gwt.server.WebBrowser; import com.vaadin.ui.Root; @@ -208,7 +208,7 @@ public interface WrappedRequest extends Serializable { * * This information is only guaranteed to be available in some special * cases, for instance when {@link Application#getRoot} is called again - * after throwing {@link RootRequiresMoreInformation} or in + * after throwing {@link RootRequiresMoreInformationException} or in * {@link Root#init(WrappedRequest)} if the Root class is annotated with * {@link RootInitRequiresBrowserDetails} * diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index a28b9e53ec..1b558158e3 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -44,7 +44,7 @@ import com.liferay.portal.kernel.util.PortalClassInvoker; import com.liferay.portal.kernel.util.PropsUtil; import com.vaadin.Application; import com.vaadin.Application.SystemMessages; -import com.vaadin.RootRequiresMoreInformation; +import com.vaadin.RootRequiresMoreInformationException; import com.vaadin.terminal.DeploymentConfiguration; import com.vaadin.terminal.Terminal; import com.vaadin.terminal.WrappedRequest; @@ -606,7 +606,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet try { root = application .getRootForRequest(wrappedRequest); - } catch (RootRequiresMoreInformation e) { + } catch (RootRequiresMoreInformationException e) { // Ignore problem and continue without root } break; diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 021908ab6e..97d31df827 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -44,7 +44,7 @@ import java.util.logging.Logger; import com.vaadin.Application; import com.vaadin.Application.SystemMessages; -import com.vaadin.RootRequiresMoreInformation; +import com.vaadin.RootRequiresMoreInformationException; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; import com.vaadin.terminal.CombinedRequest; @@ -2007,7 +2007,7 @@ public abstract class AbstractCommunicationManager implements params.put("uidl", initialUIDL); } response.getWriter().write(params.toString()); - } catch (RootRequiresMoreInformation e) { + } catch (RootRequiresMoreInformationException e) { // Requiring more information at this point is not allowed // TODO handle in a better way throw new RuntimeException(e); diff --git a/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java b/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java index cfd65aa6f7..13a4ea3e1f 100644 --- a/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java +++ b/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java @@ -13,7 +13,7 @@ import java.io.Writer; import javax.servlet.http.HttpServletResponse; import com.vaadin.Application; -import com.vaadin.RootRequiresMoreInformation; +import com.vaadin.RootRequiresMoreInformationException; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; import com.vaadin.terminal.DeploymentConfiguration; @@ -142,7 +142,7 @@ public abstract class BootstrapHandler implements RequestHandler { } rootId = root.getRootId(); - } catch (RootRequiresMoreInformation e) { + } catch (RootRequiresMoreInformationException e) { rootId = application.registerPendingRoot(request); } diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java index bb05853b5b..68a0bb3805 100644 --- a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java +++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java @@ -1,7 +1,7 @@ package com.vaadin.tests.application; import com.vaadin.Application; -import com.vaadin.RootRequiresMoreInformation; +import com.vaadin.RootRequiresMoreInformationException; import com.vaadin.terminal.ApplicationResource; import com.vaadin.terminal.DownloadStream; import com.vaadin.terminal.PaintException; @@ -77,7 +77,7 @@ public class ThreadLocalInstances extends AbstractTestApplication { @Override protected Root getRoot(WrappedRequest request) - throws RootRequiresMoreInformation { + throws RootRequiresMoreInformationException { return mainWindow; } diff --git a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java index f112f7a6d2..f40de92777 100644 --- a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java +++ b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.root; -import com.vaadin.RootRequiresMoreInformation; +import com.vaadin.RootRequiresMoreInformationException; import com.vaadin.annotations.RootInitRequiresBrowserDetails; import com.vaadin.terminal.ExternalResource; import com.vaadin.terminal.WrappedRequest; @@ -25,12 +25,12 @@ public class LazyInitRoots extends AbstractTestApplication { @Override public Root getRoot(WrappedRequest request) - throws RootRequiresMoreInformation { + throws RootRequiresMoreInformationException { if (request.getParameter("lazyCreate") != null) { // Root created on second request final BrowserDetails browserDetails = request.getBrowserDetails(); if (browserDetails == null) { - throw new RootRequiresMoreInformation(); + throw new RootRequiresMoreInformationException(); } else { Root root = new Root() { @Override -- 2.39.5