]> source.dussan.org Git - vaadin-framework.git/commitdiff
Changed how UnsupportedBrowserHandler 'singleton' stored to match app resource handler.
authorMarc Englund <marc@vaadin.com>
Thu, 22 Dec 2011 13:15:40 +0000 (15:15 +0200)
committerMarc Englund <marc@vaadin.com>
Thu, 22 Dec 2011 13:15:52 +0000 (15:15 +0200)
src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java

index 942f12886229a39512952eda73fd7f75b2f32a95..83a6a807e30700700d3f2dc503491d5ae3706063 100644 (file)
@@ -96,6 +96,8 @@ public abstract class AbstractCommunicationManager implements
 
     private static final RequestHandler APP_RESOURCE_HANDLER = new ApplicationResourceHandler();
 
+    private static final RequestHandler UNSUPPORTED_BROWSER_HANDLER = new UnsupportedBrowserHandler();
+
     /**
      * TODO Document me!
      * 
@@ -187,7 +189,7 @@ public abstract class AbstractCommunicationManager implements
         this.application = application;
         application.addRequestHandler(getBootstrapHandler());
         application.addRequestHandler(APP_RESOURCE_HANDLER);
-        application.addRequestHandler(UnsupportedBrowserHandler.getInstance());
+        application.addRequestHandler(UNSUPPORTED_BROWSER_HANDLER);
         requireLocale(application.getLocale().toString());
     }
 
index 42da74bf6546688d055235ec3ea5a5241e2803f9..b27bf1193405b98c4055450b617e857d4ba10e4a 100644 (file)
@@ -13,10 +13,10 @@ import com.vaadin.terminal.WrappedResponse;
  * use is unsupported. Recognizes Chrome Frame and allow it to be used.
  * 
  * <p>
- * This handler is a usually used as a singleton added to the application by
+ * This handler is usually added to the application by
  * {@link AbstractCommunicationManager}. It can be removed/replaced by doing
  * something like this: <code><pre>
- * application.removeRequestHandler(UnsupportedBrowserHandler.getInstance());
+ * application.removeRequestHandler(AbstractCommunicationManager.UNSUPPORTED_BROWSER_HANDLER);
  * </pre></code>
  * </p>
  */
@@ -26,20 +26,6 @@ public class UnsupportedBrowserHandler implements RequestHandler {
     /** Cookie used to ignore browser checks */
     public static final String FORCE_LOAD_COOKIE = "vaadinforceload=1";
 
-    private static UnsupportedBrowserHandler instance;
-
-    /**
-     * Get the {@link UnsupportedBrowserHandler} singleton instance.
-     * 
-     * @return the {@link UnsupportedBrowserHandler} singleton
-     */
-    public static synchronized UnsupportedBrowserHandler getInstance() {
-        if (instance == null) {
-            instance = new UnsupportedBrowserHandler();
-        }
-        return instance;
-    }
-
     @Override
     public boolean handleRequest(Application application,
             WrappedRequest request, WrappedResponse response)