org.devcake.groovy.remoteconsole.ConsoleServerMain.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of remoteconsole-groovy Show documentation
Show all versions of remoteconsole-groovy Show documentation
The library allows to create remote console server easily, and run Groovy scripts remotely on the console server.
It supports execution of parts of the script, with all import statements applied.
The library can be used as a standalone remote console server, and as embedded console server.
It contains default implementaiton of Remote Console client, whereas customized implementation is also available.
package org.devcake.groovy.remoteconsole
def port = args.size() > 0 ? args[0] as int : RemoteConsoleClient.DEFAULT_PORT
def server = new RemoteConsoleServer(port)
server.shellConfigurationFactory = new DefaultShellConfigurationFactory()
if (args.size() > 1) server.encoding = args[1]
server.start()
print "Remote Console Server started on port $port. Press Enter to stop."
System.in.read()
server.stop()
print 'Remote Console Server stopped'