From 4155cb0d2c9e9ebe27d726ac38227ff7f0648bd7 Mon Sep 17 00:00:00 2001
From: Leif Åstrand null
indicates that the default class loader
- * should be used.
*/
public ApplicationStartEvent(URL applicationUrl,
Properties applicationProperties, ApplicationContext context,
- boolean productionMode, ClassLoader classLoader) {
+ boolean productionMode) {
this.applicationUrl = applicationUrl;
this.applicationProperties = applicationProperties;
this.context = context;
this.productionMode = productionMode;
- this.classLoader = classLoader;
}
/**
@@ -417,19 +411,6 @@ public class Application implements Terminal.ErrorListener, Serializable {
public boolean isProductionMode() {
return productionMode;
}
-
- /**
- * Gets the class loader to use for loading Root classes,
- * null
indicates that the default class loader should be
- * used.
- *
- * @return the class loader, or null
if not defined.
- *
- * @see Application#getClassLoader()
- */
- public ClassLoader getClassLoader() {
- return classLoader;
- }
}
private final static Logger logger = Logger.getLogger(Application.class
@@ -521,11 +502,6 @@ public class Application implements Terminal.ErrorListener, Serializable {
*/
private Set
null
- * indicates that the default class loader should be used.
- *
- * @return the class loader to use, or null
- */
- protected ClassLoader getClassLoader() {
- return classLoader;
- }
-
/**
* Provides the name of the Root
class that should be used for
* a request. The class must have an accessible no-args constructor.
diff --git a/src/com/vaadin/terminal/DeploymentConfiguration.java b/src/com/vaadin/terminal/DeploymentConfiguration.java
index 403a6d68b7..02a3f0200f 100644
--- a/src/com/vaadin/terminal/DeploymentConfiguration.java
+++ b/src/com/vaadin/terminal/DeploymentConfiguration.java
@@ -74,4 +74,13 @@ public interface DeploymentConfiguration extends Serializable {
*/
public String getApplicationOrSystemProperty(String propertyName,
String defaultValue);
+
+ /**
+ * Get the class loader to use for loading classes loaded by name, e.g.
+ * custom Root classes. null
indicates that the default class
+ * loader should be used.
+ *
+ * @return the class loader to use, or null
+ */
+ public ClassLoader getClassLoader();
}
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
index 72a0432f4b..8235859758 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
@@ -287,6 +287,12 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
return "/html";
}
}
+
+ public ClassLoader getClassLoader() {
+ // Custom class loaders not currently supported in portlets (see
+ // #8574)
+ return null;
+ }
};
@Override
@@ -857,7 +863,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
application.setLocale(locale);
// No application URL when running inside a portlet
application.start(new ApplicationStartEvent(null,
- applicationProperties, context, isProductionMode(), null));
+ applicationProperties, context, isProductionMode()));
}
}
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
index c295e05ed7..18cc3f97f4 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
@@ -171,6 +171,14 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
public boolean isStandalone(WrappedRequest request) {
return true;
}
+
+ public ClassLoader getClassLoader() {
+ try {
+ return AbstractApplicationServlet.this.getClassLoader();
+ } catch (ServletException e) {
+ throw new RuntimeException(e);
+ }
+ }
};
static final String UPLOAD_URL_PREFIX = "APP/UPLOAD/";
@@ -1037,7 +1045,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
application.setLocale(locale);
application.start(new ApplicationStartEvent(applicationUrl,
applicationProperties, webApplicationContext,
- isProductionMode(), getClassLoader()));
+ isProductionMode()));
}
}
--
cgit v1.2.3