/*
 * Copyright 2002-2013 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package org.springframework.xd.demo.gemfire;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author David Turanski
 *
 */
@Configuration
@EnableScheduling
public class MvcConfig  extends WebMvcConfigurerAdapter {
	@Override
	public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
		configurer.setDefaultTimeout(30*1000L);
	}
}

@@ -646,16 +646,111 @@
 mfire;%0A%0A
+import javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A%0A
 import o
@@ -802,16 +802,16 @@
 ration;%0A
-
 import o
@@ -950,16 +950,94 @@
 igurer;%0A
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;%0A
 import o
@@ -1109,16 +1109,90 @@
 Adapter;
+%0Aimport org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
 %0A%0A/**%0A *
@@ -1278,17 +1278,16 @@
 cConfig 
- 
 extends 
@@ -1395,16 +1395,16 @@
 urer) %7B%0A
-
 %09%09config
@@ -1439,11 +1439,365 @@
 00L);%0A%09%7D
+%0A%0A%09public void addInterceptors(InterceptorRegistry registry) %7B%0A%09%09registry.addInterceptor(new HandlerInterceptorAdapter() %7B%0A%09%09%09@Override%0A%09%09%09public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) %7B%0A%09%09%09%09response.setHeader(%22Access-Control-Allow-Origin%22, %22http://localhost:9889%22);%0A        return true;%0A%09%09%09%7D%0A%09%09%7D);%0A%09%7D
 %0A%7D%0A

Add cross-domain origin header to responses.