Revision: 7090 Author: rda...@google.com Date: Fri Nov 20 15:46:40 2009 Log: Merging tr...@r7089 into releases/2.0. The merge was performed with the following command:
svn merge --ignore-ancestry -c 7089 http://google-web-toolkit.googlecode.com/svn/trunk . http://code.google.com/p/google-web-toolkit/source/detail?r=7090 Modified: /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/DevModeServiceRequestProcessor.java /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/MessageTransport.java /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/RemoteUI.java ======================================= --- /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/DevModeServiceRequestProcessor.java Mon Nov 9 09:38:13 2009 +++ /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/DevModeServiceRequestProcessor.java Fri Nov 20 15:46:40 2009 @@ -72,11 +72,9 @@ c1Builder.setCapability(DevModeRequest.RequestType.CAPABILITY_EXCHANGE); capabilityExchangeBuilder.addCapabilities(c1Builder); - if (remoteUI.supportsRestartWebServer()) { - CapabilityExchange.Capability.Builder c2Builder = CapabilityExchange.Capability.newBuilder(); - c2Builder.setCapability(DevModeRequest.RequestType.CAPABILITY_EXCHANGE); - capabilityExchangeBuilder.addCapabilities(c2Builder); - } + CapabilityExchange.Capability.Builder c2Builder = CapabilityExchange.Capability.newBuilder(); + c2Builder.setCapability(DevModeRequest.RequestType.RESTART_WEB_SERVER); + capabilityExchangeBuilder.addCapabilities(c2Builder); DevModeResponse.Builder devModeResponseBuilder = DevModeResponse.newBuilder(); devModeResponseBuilder.setResponseType(DevModeResponse.ResponseType.CAPABILITY_EXCHANGE); @@ -91,7 +89,7 @@ private Response processRestartServer() { if (!remoteUI.restartWebServer()) { throw new IllegalStateException( - "Unable to restart the web server. This server may not have the capability to be restarted."); + "Unable to restart the web server. It is still in the process of starting up. Wait a few seconds and try again."); } DevModeResponse.Builder devModeResponseBuilder = DevModeResponse.newBuilder(); ======================================= --- /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/MessageTransport.java Thu Nov 12 13:31:08 2009 +++ /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/MessageTransport.java Fri Nov 20 15:46:40 2009 @@ -351,7 +351,9 @@ } catch (Exception e) { messageBuilder.setMessageType(Message.MessageType.FAILURE); Message.Failure.Builder failureMessage = Message.Failure.newBuilder(); - failureMessage.setMessage(e.getLocalizedMessage()); + + failureMessage.setMessage(e.getLocalizedMessage() != null + ? e.getLocalizedMessage() : e.getClass().getName()); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw, true)); failureMessage.setStackTrace(sw.getBuffer().toString()); ======================================= --- /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/RemoteUI.java Thu Nov 19 13:50:21 2009 +++ /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/RemoteUI.java Fri Nov 20 15:46:40 2009 @@ -70,20 +70,6 @@ throw new RuntimeException(e); } } - - @Override - public TreeLogger getWebServerLogger(String serverName, byte[] serverIcon) { - return getConsoleLogger(); - } - - @Override - public void initialize(Type logLevel) { - super.initialize(logLevel); - viewerServiceClient = new ViewerServiceClient(transport); - String devModeQueryParam = BrowserListener.getDevModeURLParams(BrowserListener.computeEndpointIdentifier(browserChannelPort)); - viewerServiceClient.initialize(clientId, devModeQueryParam, webServerPort); - viewerServiceClient.checkCapabilities(); - } @Override public ModuleHandle getModuleLogger(String userAgent, String remoteSocket, @@ -139,6 +125,20 @@ return handle; } + + @Override + public TreeLogger getWebServerLogger(String serverName, byte[] serverIcon) { + return getConsoleLogger(); + } + + @Override + public void initialize(Type logLevel) { + super.initialize(logLevel); + viewerServiceClient = new ViewerServiceClient(transport); + String devModeQueryParam = BrowserListener.getDevModeURLParams(BrowserListener.computeEndpointIdentifier(browserChannelPort)); + viewerServiceClient.initialize(clientId, devModeQueryParam, webServerPort); + viewerServiceClient.checkCapabilities(); + } public void onTermination(Exception e) { getTopLogger().log(TreeLogger.INFO, @@ -157,20 +157,17 @@ } public boolean restartWebServer() { - if (!supportsRestartWebServer()) { - return false; - } - TreeLogger webServerLogger = getConsoleLogger(); - if (webServerLogger == null) { - return false; + assert (webServerLogger != null); + + RestartServerCallback callback = ((RestartServerCallback) getCallback(RestartServerEvent.getType())); + if (callback != null) { + callback.onRestartServer(webServerLogger); + return true; + } else { + // The server is still starting up } - ((RestartServerCallback) getCallback(RestartServerEvent.getType())).onRestartServer(webServerLogger); - return true; - } - - public boolean supportsRestartWebServer() { - return hasCallback(RestartServerEvent.getType()); + return false; } } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors