test
Class Server

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by groovy.lang.Closure
          extended by test.Server
All Implemented Interfaces:
groovy.lang.GroovyObject, java.io.Serializable, java.lang.Cloneable, java.lang.Runnable

public class Server
extends groovy.lang.Closure
implements java.io.Serializable

Represents a connection to a remote server.

Author:
Kohsuke Kawaguchi
See Also:
Serialized Form

Field Summary
 
Fields inherited from class groovy.lang.Closure
DELEGATE_FIRST, DELEGATE_ONLY, DONE, maximumNumberOfParameters, OWNER_FIRST, OWNER_ONLY, parameterTypes, SKIP, TO_SELF
 
Constructor Summary
Server(java.lang.Object owner, hudson.remoting.Channel channel)
           
 
Method Summary
 void close()
          Terminates the remote JVM and shuts down this server.
 java.lang.Object doCall(groovy.lang.Closure closure)
          Executes a groovy closure on this server and returns the result back.
 hudson.remoting.Channel getChannel()
           
 
Methods inherited from class groovy.lang.Closure
asWritable, call, call, call, clone, curry, getDelegate, getDirective, getMaximumNumberOfParameters, getOwner, getParameterTypes, getProperty, getResolveStrategy, getThisObject, isCase, run, setDelegate, setDirective, setProperty, setResolveStrategy, throwRuntimeException
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, invokeMethod, setMetaClass
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Server

public Server(java.lang.Object owner,
              hudson.remoting.Channel channel)
Method Detail

getChannel

public hudson.remoting.Channel getChannel()

doCall

public java.lang.Object doCall(groovy.lang.Closure closure)
                        throws java.lang.Throwable
Executes a groovy closure on this server and returns the result back.

From groovy, this can be invoked as if this object is a block, like this:

 Server server = droovy.connec("db")
 server {
   println "Hello";
 }
 

Throws:
java.lang.Throwable

close

public void close()
           throws java.io.IOException,
                  java.lang.InterruptedException
Terminates the remote JVM and shuts down this server.

Throws:
java.io.IOException
java.lang.InterruptedException


Copyright © 2009. All Rights Reserved.