Lock down HostedMode's public API for now.
git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/1.6@4319 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/HostedMode.java b/dev/core/src/com/google/gwt/dev/HostedMode.java
index 951775d..93ebb2c 100644
--- a/dev/core/src/com/google/gwt/dev/HostedMode.java
+++ b/dev/core/src/com/google/gwt/dev/HostedMode.java
@@ -42,7 +42,9 @@
import java.util.Map;
/**
- * The main executable class for the hosted mode shell.
+ * The main executable class for the hosted mode shell. NOTE: the public API for
+ * this class is to be determined. Consider this class as having <b>no</b>
+ * public API other than {@link #main(String[])}.
*/
public class HostedMode extends HostedModeBase {
@@ -184,26 +186,10 @@
console.setMaxDetail(TreeLogger.WARN);
}
- public boolean setServer(TreeLogger logger, String serverClassName) {
- Throwable t;
- try {
- Class<?> clazz = Class.forName(serverClassName, true,
- Thread.currentThread().getContextClassLoader());
- Class<? extends ServletContainerLauncher> sclClass = clazz.asSubclass(ServletContainerLauncher.class);
- launcher = sclClass.newInstance();
- return true;
- } catch (ClassCastException e) {
- t = e;
- } catch (ClassNotFoundException e) {
- t = e;
- } catch (InstantiationException e) {
- t = e;
- } catch (IllegalAccessException e) {
- t = e;
- }
- logger.log(TreeLogger.ERROR, "Unable to load server class '"
- + serverClassName + "'", t);
- return false;
+ /**
+ * The public API of this class is yet to be determined.
+ */
+ private HostedMode() {
}
@Override
@@ -342,6 +328,28 @@
return module;
}
+ protected boolean setServer(TreeLogger logger, String serverClassName) {
+ Throwable t;
+ try {
+ Class<?> clazz = Class.forName(serverClassName, true,
+ Thread.currentThread().getContextClassLoader());
+ Class<? extends ServletContainerLauncher> sclClass = clazz.asSubclass(ServletContainerLauncher.class);
+ launcher = sclClass.newInstance();
+ return true;
+ } catch (ClassCastException e) {
+ t = e;
+ } catch (ClassNotFoundException e) {
+ t = e;
+ } catch (InstantiationException e) {
+ t = e;
+ } catch (IllegalAccessException e) {
+ t = e;
+ }
+ logger.log(TreeLogger.ERROR, "Unable to load server class '"
+ + serverClassName + "'", t);
+ return false;
+ }
+
/**
* Perform an initial hosted mode link, without overwriting newer or
* unmodified files in the output folder.