From 4011783ed51dffe80ceb5642c02d65033de6d400 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 6 Sep 2012 16:58:43 +0300 Subject: Remove Application from UIProvider API (#9402) --- server/src/com/vaadin/Application.java | 7 +++---- server/src/com/vaadin/server/AbstractUIProvider.java | 4 ++-- server/src/com/vaadin/server/DefaultUIProvider.java | 8 ++++---- server/src/com/vaadin/server/UIProvider.java | 7 +++---- server/src/com/vaadin/server/VaadinSession.java | 10 ++++------ 5 files changed, 16 insertions(+), 20 deletions(-) (limited to 'server/src') diff --git a/server/src/com/vaadin/Application.java b/server/src/com/vaadin/Application.java index 121e156da8..d755817896 100644 --- a/server/src/com/vaadin/Application.java +++ b/server/src/com/vaadin/Application.java @@ -90,8 +90,7 @@ public abstract class Application extends AbstractUIProvider implements protected abstract void init(); @Override - public Class getUIClass(VaadinSession application, - WrappedRequest request) { + public Class getUIClass(WrappedRequest request) { UI uiInstance = getUIInstance(request); if (uiInstance != null) { return uiInstance.getClass(); @@ -100,8 +99,8 @@ public abstract class Application extends AbstractUIProvider implements } @Override - public UI createInstance(VaadinSession application, - Class type, WrappedRequest request) { + public UI createInstance(Class type, + WrappedRequest request) { return getUIInstance(request); } diff --git a/server/src/com/vaadin/server/AbstractUIProvider.java b/server/src/com/vaadin/server/AbstractUIProvider.java index e93e1a6ae1..321ca75f65 100644 --- a/server/src/com/vaadin/server/AbstractUIProvider.java +++ b/server/src/com/vaadin/server/AbstractUIProvider.java @@ -27,8 +27,8 @@ import com.vaadin.ui.UI; public abstract class AbstractUIProvider implements UIProvider { @Override - public UI createInstance(VaadinSession application, - Class type, WrappedRequest request) { + public UI createInstance(Class type, + WrappedRequest request) { try { return type.newInstance(); } catch (InstantiationException e) { diff --git a/server/src/com/vaadin/server/DefaultUIProvider.java b/server/src/com/vaadin/server/DefaultUIProvider.java index 0a5613a588..c4a8069269 100644 --- a/server/src/com/vaadin/server/DefaultUIProvider.java +++ b/server/src/com/vaadin/server/DefaultUIProvider.java @@ -21,10 +21,10 @@ import com.vaadin.ui.UI; public class DefaultUIProvider extends AbstractUIProvider { @Override - public Class getUIClass(VaadinSession application, - WrappedRequest request) { - Object uiClassNameObj = application.getConfiguration() - .getInitParameters().getProperty(VaadinSession.UI_PARAMETER); + public Class getUIClass(WrappedRequest request) { + Object uiClassNameObj = request.getVaadinService() + .getDeploymentConfiguration().getInitParameters() + .getProperty(VaadinSession.UI_PARAMETER); if (uiClassNameObj instanceof String) { String uiClassName = uiClassNameObj.toString(); diff --git a/server/src/com/vaadin/server/UIProvider.java b/server/src/com/vaadin/server/UIProvider.java index de68b121f0..752da3aafc 100644 --- a/server/src/com/vaadin/server/UIProvider.java +++ b/server/src/com/vaadin/server/UIProvider.java @@ -20,11 +20,10 @@ import com.vaadin.annotations.Widgetset; import com.vaadin.ui.UI; public interface UIProvider { - public Class getUIClass(VaadinSession application, - WrappedRequest request); + public Class getUIClass(WrappedRequest request); - public UI createInstance(VaadinSession application, - Class type, WrappedRequest request); + public UI createInstance(Class type, + WrappedRequest request); public String getPageTitleForUI(WrappedRequest request, Class uiClass); diff --git a/server/src/com/vaadin/server/VaadinSession.java b/server/src/com/vaadin/server/VaadinSession.java index 094f3501d7..42194b2609 100644 --- a/server/src/com/vaadin/server/VaadinSession.java +++ b/server/src/com/vaadin/server/VaadinSession.java @@ -650,7 +650,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { @Deprecated public Class getUIClass(WrappedRequest request) { UIProvider uiProvider = getUiProvider(request, null); - return uiProvider.getUIClass(this, request); + return uiProvider.getUIClass(request); } /** @@ -667,7 +667,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { protected T createUIInstance(WrappedRequest request, Class uiClass) { UIProvider uiProvider = getUiProvider(request, uiClass); - return uiClass.cast(uiProvider.createInstance(this, uiClass, request)); + return uiClass.cast(uiProvider.createInstance(uiClass, request)); } /** @@ -695,8 +695,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { .getAttribute(UIProvider.class.getName()); if (provider != null) { // Cached provider found, verify that it's a sensible selection - Class providerClass = provider.getUIClass(this, - request); + Class providerClass = provider.getUIClass(request); if (uiClass == null && providerClass != null) { // Use it if it gives any answer if no specific class is // required @@ -729,8 +728,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { for (int i = providersSize - 1; i >= 0; i--) { UIProvider provider = uiProviders.get(i); - Class providerClass = provider.getUIClass(this, - request); + Class providerClass = provider.getUIClass(request); // If we found something if (providerClass != null) { if (uiClass == null) { -- cgit v1.2.3