Skip to content

Commit

Permalink
Package renaming 'org.codehaus' to 'org.grails'
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Jun 6, 2014
1 parent 4810b06 commit 8717a71
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 40 deletions.
Expand Up @@ -19,7 +19,7 @@
import org.codehaus.groovy.grails.compiler.injection.AbstractGrailsArtefactTransformer;
import org.codehaus.groovy.grails.compiler.injection.AstTransformer;
import org.codehaus.groovy.grails.compiler.web.ControllerTransformer;
import org.codehaus.groovy.grails.plugins.web.async.api.ControllersAsyncApi;
import org.grails.plugins.web.async.api.ControllersAsyncApi;

import java.net.URL;

Expand Down
Expand Up @@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.groovy.grails.plugins.web.async
package org.grails.plugins.web.async

import grails.async.Promises
import grails.util.GrailsUtil
import org.codehaus.groovy.grails.plugins.web.async.mvc.AsyncActionResultTransformer
import org.grails.plugins.web.async.mvc.AsyncActionResultTransformer
import org.springframework.context.ApplicationContext

import javax.servlet.http.HttpServletRequest
import org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
Expand All @@ -38,7 +39,7 @@ class ControllersAsyncGrailsPlugin {
asyncPromiseResponseActionResultTransformer(AsyncActionResultTransformer)
}

def doWithDynamicMethods = {
def doWithDynamicMethods(ApplicationContext appCtx) {
Promises.promiseFactory.addPromiseDecoratorLookupStrategy(new WebRequestPromiseDecoratorLookupStrategy())
def original = HttpServletRequest.metaClass.getMetaMethod("startAsync", null)
if (original == null) {
Expand Down
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.groovy.grails.plugins.web.async
package org.grails.plugins.web.async

import groovy.transform.CompileStatic

Expand Down
@@ -1,26 +1,10 @@
/*
* Copyright 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.codehaus.groovy.grails.plugins.web.async
package org.grails.plugins.web.async

import groovy.transform.CompileStatic
import groovy.transform.TypeCheckingMode
import org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
import org.codehaus.groovy.grails.web.util.WebUtils
import org.grails.async.decorator.PromiseDecorator
import org.grails.async.decorator.PromiseDecoratorLookupStrategy

/**
* A promise decorated lookup strategy that binds a WebRequest to the promise thread
Expand All @@ -29,21 +13,10 @@ import org.grails.async.decorator.PromiseDecoratorLookupStrategy
* @since 2.3
*/
@CompileStatic
class WebRequestPromiseDecoratorLookupStrategy implements PromiseDecoratorLookupStrategy{
@Override
List<PromiseDecorator> findDecorators() {
final webRequest = GrailsWebRequest.lookup()
if (webRequest) {
return [new WebRequestPromsiseDecorator(webRequest)]
}
return Collections.emptyList()
}
}
@CompileStatic
class WebRequestPromsiseDecorator implements PromiseDecorator{
class WebRequestPromiseDecorator implements PromiseDecorator {
GrailsWebRequest webRequest

WebRequestPromsiseDecorator(GrailsWebRequest webRequest) {
WebRequestPromiseDecorator(GrailsWebRequest webRequest) {
this.webRequest = webRequest
}

Expand Down
@@ -0,0 +1,41 @@
/*
* Copyright 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.grails.plugins.web.async

import groovy.transform.CompileStatic
import groovy.transform.TypeCheckingMode
import org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
import org.codehaus.groovy.grails.web.util.WebUtils
import org.grails.async.decorator.PromiseDecorator
import org.grails.async.decorator.PromiseDecoratorLookupStrategy

/**
* A promise decorated lookup strategy that binds a WebRequest to the promise thread
*
* @author Graeme Rocher
* @since 2.3
*/
@CompileStatic
class WebRequestPromiseDecoratorLookupStrategy implements PromiseDecoratorLookupStrategy {
@Override
List<PromiseDecorator> findDecorators() {
final webRequest = GrailsWebRequest.lookup()
if (webRequest) {
return [new WebRequestPromiseDecorator(webRequest)]
}
return Collections.emptyList()
}
}
Expand Up @@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.groovy.grails.plugins.web.async.api
package org.grails.plugins.web.async.api

import javax.servlet.AsyncContext
import javax.servlet.http.HttpServletRequest

import org.codehaus.groovy.grails.plugins.web.async.GrailsAsyncContext
import org.grails.plugins.web.async.GrailsAsyncContext
import org.codehaus.groovy.grails.web.servlet.GrailsApplicationAttributes
import org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
import org.springframework.web.context.request.RequestContextHolder
Expand Down
Expand Up @@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.groovy.grails.plugins.web.async.mvc
package org.grails.plugins.web.async.mvc

import grails.async.Promise
import grails.async.PromiseList
import grails.async.web.AsyncGrailsWebRequest
import groovy.transform.CompileStatic
import org.codehaus.groovy.grails.plugins.web.async.GrailsAsyncContext
import org.grails.plugins.web.async.GrailsAsyncContext
import org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver
import org.codehaus.groovy.grails.web.servlet.GrailsApplicationAttributes
import org.codehaus.groovy.grails.web.servlet.mvc.ActionResultTransformer
Expand Down
@@ -1,3 +1,3 @@
<plugin name='controllers'>
<type>org.codehaus.groovy.grails.plugins.web.async.ControllersAsyncGrailsPlugin</type>
<type>org.grails.plugins.web.async.ControllersAsyncGrailsPlugin</type>
</plugin>

0 comments on commit 8717a71

Please sign in to comment.