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;
* @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());
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.
*
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) {
+++ /dev/null
-/*
-@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();
-
- }
-}
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;
}
- /**
- * 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;
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;
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