-
Notifications
You must be signed in to change notification settings - Fork 1
/
NettymvcGrailsPlugin.groovy
41 lines (35 loc) · 1.02 KB
/
NettymvcGrailsPlugin.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import grails.plugin.nettymvc.Server
import grails.plugin.nettymvc.http.SessionManager
class NettymvcGrailsPlugin {
String version = '0.1'
String grailsVersion = '2.0 > *'
String author = 'Burt Beckwith'
String authorEmail = '[email protected]'
String title = 'NettyMVC Plugin'
String description = 'NettyMVC Plugin'
String documentation = 'http://grails.org/plugin/nettymvc'
List pluginExcludes = [
'docs/**',
'src/docs/**'
]
String license = 'APACHE'
def issueManagement = [system: 'GitHub', url: 'https://github.com/burtbeckwith/grails-nettymvc/issues']
def scm = [url: 'https://github.com/burtbeckwith/grails-nettymvc']
def doWithSpring = {
def port = application.config.grails.plugin.nettymvc.port
if (!(port instanceof Number)) {
port = 8080
}
nettyServer(Server, port) { bean ->
bean.destroyMethod = 'stop'
}
nettySessionManager(SessionManager) {
servletContext = ref('servletContext')
}
}
def doWithApplicationContext = { ctx ->
Thread.start {
ctx.nettyServer.start()
}
}
}