public class GroovySocketServer extends Object
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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.
Constructor and description |
---|
GroovySocketServer
(GroovyShell groovy, boolean isScriptFile, String scriptFilenameOrText, boolean autoOutput, int port) This creates and starts the socket server on a new Thread. |
GroovySocketServer
(GroovyShell groovy, GroovyCodeSource source, boolean autoOutput, int port) This creates and starts the socket server on a new Thread. |
This creates and starts the socket server on a new Thread. There is no need to call run or spawn a new thread yourself.
groovy
- The GroovyShell object that evaluates the incoming text. If you need additional classes in the
classloader then configure that through this object.isScriptFile
- Whether the incoming socket data String will be a script or a file path.scriptFilenameOrText
- This will be a groovy script or a file location depending on the argument isScriptFile.autoOutput
- whether output should be automatically echoed back to the clientport
- the port to listen onThis creates and starts the socket server on a new Thread. There is no need to call run or spawn a new thread yourself.
groovy
- The GroovyShell object that evaluates the incoming text. If you need additional classes in the
classloader then configure that through this object.source
- GroovyCodeSource for the Groovy scriptautoOutput
- whether output should be automatically echoed back to the clientport
- the port to listen onCopyright © 2003-2015 The Apache Software Foundation. All rights reserved.