]> source.dussan.org Git - vaadin-framework.git/commitdiff
Relentlessly remove the last traces of URIHandler
authorLeif Åstrand <leif@vaadin.com>
Wed, 9 Nov 2011 09:17:42 +0000 (11:17 +0200)
committerLeif Åstrand <leif@vaadin.com>
Wed, 9 Nov 2011 09:17:42 +0000 (11:17 +0200)
src/com/vaadin/Application.java
src/com/vaadin/terminal/URIHandler.java [deleted file]
src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java

index aae6465ebb8e7e87061f463a919e9b6aa02f1c5f..153906ed01f337cce9d5a9c849398e0046decc95 100644 (file)
@@ -23,13 +23,11 @@ import java.util.logging.Logger;
 
 import com.vaadin.service.ApplicationContext;
 import com.vaadin.terminal.ApplicationResource;
-import com.vaadin.terminal.DownloadStream;
 import com.vaadin.terminal.ErrorMessage;
 import com.vaadin.terminal.ParameterHandler;
 import com.vaadin.terminal.RequestHandler;
 import com.vaadin.terminal.SystemError;
 import com.vaadin.terminal.Terminal;
-import com.vaadin.terminal.URIHandler;
 import com.vaadin.terminal.VariableOwner;
 import com.vaadin.terminal.WrappedRequest;
 import com.vaadin.terminal.WrappedResponse;
@@ -93,8 +91,8 @@ import com.vaadin.ui.Window;
  * @since 3.0
  */
 @SuppressWarnings("serial")
-public abstract class Application implements URIHandler,
-        Terminal.ErrorListener, Serializable {
+public abstract class Application implements Terminal.ErrorListener,
+        Serializable {
 
     private final static Logger logger = Logger.getLogger(Application.class
             .getName());
@@ -407,50 +405,6 @@ public abstract class Application implements URIHandler,
         return context.generateApplicationResourceURL(resource, key);
     }
 
-    /**
-     * Application URI handling hub.
-     * 
-     * <p>
-     * This method gets called by terminal. It has lots of duties like to pass
-     * uri handler to proper uri handlers registered to windows etc.
-     * </p>
-     * 
-     * <p>
-     * In most situations developers should NOT OVERRIDE this method. Instead
-     * developers should implement and register uri handlers to windows.
-     * </p>
-     * 
-     * @deprecated this method is called be the terminal implementation only and
-     *             might be removed or moved in the future. Instead of
-     *             overriding this method, add your {@link URIHandler} to a top
-     *             level {@link Window} (eg.
-     *             getMainWindow().addUriHanler(handler) instead.
-     */
-    @Deprecated
-    public DownloadStream handleURI(URL context, String relativeUri) {
-
-        if (this.context.isApplicationResourceURL(context, relativeUri)) {
-
-            // Handles the resource request
-            final String key = this.context.getURLKey(context, relativeUri);
-            final ApplicationResource resource = keyResourceMap.get(key);
-            if (resource != null) {
-                DownloadStream stream = resource.getStream();
-                if (stream != null) {
-                    stream.setCacheTime(resource.getCacheTime());
-                    return stream;
-                } else {
-                    return null;
-                }
-            } else {
-                // Resource requests override uri handling
-                return null;
-            }
-        } else {
-            return null;
-        }
-    }
-
     /**
      * Gets the default locale for this application.
      * 
@@ -787,8 +741,6 @@ public abstract class Application implements URIHandler,
         Object owner = null;
         if (event instanceof VariableOwner.ErrorEvent) {
             owner = ((VariableOwner.ErrorEvent) event).getVariableOwner();
-        } else if (event instanceof URIHandler.ErrorEvent) {
-            owner = ((URIHandler.ErrorEvent) event).getURIHandler();
         } else if (event instanceof ParameterHandler.ErrorEvent) {
             owner = ((ParameterHandler.ErrorEvent) event).getParameterHandler();
         } else if (event instanceof ChangeVariablesErrorEvent) {
diff --git a/src/com/vaadin/terminal/URIHandler.java b/src/com/vaadin/terminal/URIHandler.java
deleted file mode 100644 (file)
index 2d5facb..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-import java.net.URL;
-
-/**
- * A URIHandler is used for handling URI:s requested by the user and can
- * optionally provide a {@link DownloadStream}. If a {@link DownloadStream} is
- * returned by {@link #handleURI(URL, String)}, the stream is sent to the
- * client.
- * 
- * @author IT Mill Ltd.
- * @version
- * @VERSION@
- * @since 3.0
- */
-public interface URIHandler extends Serializable {
-
-    /**
-     * Handles a given URI. If the URI handler to emit a downloadable stream it
-     * should return a {@code DownloadStream} object.
-     * 
-     * @param context
-     *            the base URL
-     * @param relativeUri
-     *            a URI relative to {@code context}
-     * @return A downloadable stream or null if no stream is provided
-     */
-    public DownloadStream handleURI(URL context, String relativeUri);
-
-    /**
-     * An {@code ErrorEvent} implementation for URIHandler.
-     */
-    public interface ErrorEvent extends Terminal.ErrorEvent {
-
-        /**
-         * Gets the URIHandler that caused this error.
-         * 
-         * @return the URIHandler that caused the error
-         */
-        public URIHandler getURIHandler();
-
-    }
-}
index 9b500542bbdb93889ef072423cc07b8befcf714c..f86e2723eefb766d8d4769428c3facb91fee29bf 100644 (file)
@@ -40,7 +40,6 @@ import com.vaadin.Application.SystemMessages;
 import com.vaadin.terminal.ParameterHandler;
 import com.vaadin.terminal.Terminal;
 import com.vaadin.terminal.ThemeResource;
-import com.vaadin.terminal.URIHandler;
 import com.vaadin.terminal.WrappedRequest;
 import com.vaadin.terminal.WrappedResponse;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
@@ -2303,45 +2302,6 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
 
     }
 
-    /**
-     * Implementation of URIHandler.ErrorEvent interface.
-     */
-    public class URIHandlerErrorImpl implements URIHandler.ErrorEvent,
-            Serializable {
-
-        private final URIHandler owner;
-
-        private final Throwable throwable;
-
-        /**
-         * 
-         * @param owner
-         * @param throwable
-         */
-        private URIHandlerErrorImpl(URIHandler owner, Throwable throwable) {
-            this.owner = owner;
-            this.throwable = throwable;
-        }
-
-        /**
-         * Gets the contained throwable.
-         * 
-         * @see com.vaadin.terminal.Terminal.ErrorEvent#getThrowable()
-         */
-        public Throwable getThrowable() {
-            return throwable;
-        }
-
-        /**
-         * Gets the source URIHandler.
-         * 
-         * @see com.vaadin.terminal.URIHandler.ErrorEvent#getURIHandler()
-         */
-        public URIHandler getURIHandler() {
-            return owner;
-        }
-    }
-
     public class RequestError implements Terminal.ErrorEvent, Serializable {
 
         private final Throwable throwable;
index f40d56bf05b76d247689c8c54c9d50ee6e19c735..f7eaa9f2ac12e3dd0b16a8bc06d002250ff34808 100644 (file)
@@ -53,7 +53,6 @@ import com.vaadin.terminal.StreamVariable.StreamingEndEvent;
 import com.vaadin.terminal.StreamVariable.StreamingErrorEvent;
 import com.vaadin.terminal.Terminal.ErrorEvent;
 import com.vaadin.terminal.Terminal.ErrorListener;
-import com.vaadin.terminal.URIHandler;
 import com.vaadin.terminal.VariableOwner;
 import com.vaadin.terminal.WrappedRequest;
 import com.vaadin.terminal.WrappedResponse;
@@ -1940,41 +1939,6 @@ public abstract class AbstractCommunicationManager implements
         paintable.requestRepaintRequests();
     }
 
-    /**
-     * Implementation of {@link URIHandler.ErrorEvent} interface.
-     */
-    public class URIHandlerErrorImpl implements URIHandler.ErrorEvent,
-            Serializable {
-
-        private final URIHandler owner;
-
-        private final Throwable throwable;
-
-        /**
-         * 
-         * @param owner
-         * @param throwable
-         */
-        private URIHandlerErrorImpl(URIHandler owner, Throwable throwable) {
-            this.owner = owner;
-            this.throwable = throwable;
-        }
-
-        /**
-         * @see com.vaadin.terminal.Terminal.ErrorEvent#getThrowable()
-         */
-        public Throwable getThrowable() {
-            return throwable;
-        }
-
-        /**
-         * @see com.vaadin.terminal.URIHandler.ErrorEvent#getURIHandler()
-         */
-        public URIHandler getURIHandler() {
-            return owner;
-        }
-    }
-
     /**
      * Queues a locale to be sent to the client (browser) for date and time
      * entry etc. All locale specific information is derived from server-side