<commit_before>/*
 * Copyright 2007-2012 <NAME>.
 *
 * 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.
 */

import grails.plugin.remoting.RemotingPluginHelper
import org.codehaus.groovy.grails.plugins.remoting.InterceptorArtefactHandler
import org.springframework.web.context.support.StaticWebApplicationContext
import org.springframework.web.servlet.DispatcherServlet

class RemotingGrailsPlugin {

	def version = '1.2'
	def grailsVersion = '2.0 > *'
	def author = '<NAME>'
	def authorEmail = '<EMAIL>'
	def title = 'Remoting Plugin'
	def description = '''This plugin makes it easy to expose your Grails services to remote clients via RMI, Hessian, Burlap and Spring's HttpInvoker protocol.
In addition, you can easily access remote services via the same set of protocols.
'''
	def documentation = 'http://grails.org/plugin/remoting'

	def artefacts = [InterceptorArtefactHandler]
	def observe = ['services']
	def watchedResources = "file:./grails-app/remoting/*RemotingInterceptor.groovy"

	def license = "APACHE"
	def developers = [[name: '<NAME>', email: '<EMAIL>']]
	def issueManagement = [system: 'JIRA', url: 'http://jira.grails.org/browse/GPREMOTING']
	def scm = [url: 'https://github.com/burtbeckwith/grails-remoting']

	def doWithWebDescriptor = { xml ->
		// Set up servlets for each of the exporter types.
		for (String invokerType in RemotingPluginHelper.remoteExporters.keySet()) {
			// Add a servlet definition for this invoker type
			xml.servlet[xml.servlet.size() - 1] + {
				servlet {
					'servlet-name'(invokerType)
					'servlet-class'(DispatcherServlet.name)
					'init-param'() {
						'param-name'('contextClass')
						'param-value'(StaticWebApplicationContext.name)
					}
					'init-param'() {
						'param-name'('detectAllHandlerExceptionResolvers')
						'param-value'('false')
					}
					'load-on-startup'(1)
				}
			}

			xml.'servlet-mapping'[xml.'servlet-mapping'.size() - 1] + {
				'servlet-mapping' {
					'servlet-name'(invokerType)<commit_msg>bug fix - need to load after services plugin so the proxies replace the Grails service<commit_after>/*
 * Copyright 2007-2012 <NAME>.
 *
 * 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.
 */

import grails.plugin.remoting.RemotingPluginHelper
import org.codehaus.groovy.grails.plugins.remoting.InterceptorArtefactHandler
import org.springframework.web.context.support.StaticWebApplicationContext
import org.springframework.web.servlet.DispatcherServlet

class RemotingGrailsPlugin {

	def version = '1.2'
	def grailsVersion = '2.0 > *'
	def author = '<NAME>'
	def authorEmail = '<EMAIL>'
	def title = 'Remoting Plugin'
	def description = '''This plugin makes it easy to expose your Grails services to remote clients via RMI, Hessian, Burlap and Spring's HttpInvoker protocol.
In addition, you can easily access remote services via the same set of protocols.
'''
	def documentation = 'http://grails.org/plugin/remoting'

	def artefacts = [InterceptorArtefactHandler]
	def observe = ['services']
	def loadAfter = ['services']
	def watchedResources = "file:./grails-app/remoting/*RemotingInterceptor.groovy"

	def license = "APACHE"
	def developers = [[name: '<NAME>', email: '<EMAIL>']]
	def issueManagement = [system: 'JIRA', url: 'http://jira.grails.org/browse/GPREMOTING']
	def scm = [url: 'https://github.com/burtbeckwith/grails-remoting']

	def doWithWebDescriptor = { xml ->
		// Set up servlets for each of the exporter types.
		for (String invokerType in RemotingPluginHelper.remoteExporters.keySet()) {
			// Add a servlet definition for this invoker type
			xml.servlet[xml.servlet.size() - 1] + {
				servlet {
					'servlet-name'(invokerType)
					'servlet-class'(DispatcherServlet.name)
					'init-param'() {
						'param-name'('contextClass')
						'param-value'(StaticWebApplicationContext.name)
					}
					'init-param'() {
						'param-name'('detectAllHandlerExceptionResolvers')
						'param-value'('false')
					}
					'load-on-startup'(1)
				}
			}

			xml.'servlet-mapping'[xml.'servlet-mapping'.size() - 1] + {
				'servlet-mapping' {
					'servlet-name'(invokerType)
{'fraction_non_alphanumeric': 0.1160275319567355, 'fraction_numerical': 0.007472959685349066, 'mean_word_length': 4.035643564356436, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4981523', 'n_tokens_mistral': 1688, 'n_tokens_neox': 1499, 'n_words': 450}