Skip to content
Browse files

merged padcom changes

  • Loading branch information...
2 parents eec504f + 24ae28c commit c23c7b516613697aaa847d693b5fd5e044f88f33 Cory Hacking committed Jul 21, 2011
Showing with 18 additions and 1 deletion.
  1. +18 −1 RoutingGrailsPlugin.groovy
View
19 RoutingGrailsPlugin.groovy
@@ -12,7 +12,7 @@ class RoutingGrailsPlugin {
static final log = Logger.getLogger('org.grails.plugins.routing.RoutingGrailsPlugin')
- def version = "1.1.2"
+ def version = "1.1.3"
def grailsVersion = "1.3.6 > *"
def dependsOn = [:]
def pluginExcludes = []
@@ -84,6 +84,20 @@ added with the 'grails create-route route-name' command.
def grailsClass = application."${artifactType}Classes".find { it.fullName == artifactName }
this.addMethods([grailsClass], event.ctx)
}
+
+ log.debug "Reloading bean endpoints of class ${event.source.name}..."
+ event.ctx.beanDefinitionNames.each { bean ->
+ if (event.ctx.getType(bean)?.simpleName == event.source.name) {
+ // endpoints with bean are to be restarted
+ event.ctx.camelContext.endpoints.each { endpoint ->
+ if (endpoint instanceof org.apache.camel.component.bean.BeanEndpoint && endpoint.beanName == bean) {
+ endpoint.beanHolder = null
+ endpoint.processor = null
+ endpoint.cache = false
+ }
+ }
+ }
+ }
}
def onConfigChange = { event ->
@@ -135,6 +149,9 @@ added with the 'grails create-route route-name' command.
artifact.metaClass.sendMessage = { endpoint, message ->
template.sendBody(endpoint, message)
}
+ artifact.metaClass.sendMessageAndHeaders = { endpoint, message, headers ->
+ template.sendBodyAndHeaders(endpoint, message, headers)
+ }
artifact.metaClass.requestMessage = { endpoint, message ->
template.requestBody(endpoint, message)
}

0 comments on commit c23c7b5

Please sign in to comment.
Something went wrong with that request. Please try again.