Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

## org.codehaus.groovy.grails.cli.fork
[Groovy] Class ForkedGrailsProcess

    java.lang.Object
      org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess

    abstract class ForkedGrailsProcess
    extends java.lang.Object

Helper class for kicking off forked JVM processes, helpful in managing the setup and execution of the forked process. Subclasses should provided a static void main method.

Authors:
  Graeme Rocher

Since:
  2.2

Nested Class Summary
`static class` | `ForkedGrailsProcess.TextDumper`

Field Summary
`static java.lang.String` | `DEBUG_FORK`
`static int` | `DEFAULT_DAEMON_PORT`
`static java.lang.String` | `DEFAULT_DEBUG_ARGS`

Property Summary
`boolean` | `daemon`
`int` | `daemonPort`
`boolean` | `debug`
`java.lang.String` | `debugArgs`
`java.lang.String` | `encoding`
`ExecutionContext` | `executionContext`
`boolean` | `forkReserve`
`java.net.URLClassLoader` | `forkedClassLoader`
`java.util.List` | `jvmArgs`
`int` | `maxMemory`
`int` | `maxPerm`
`int` | `minMemory`
`boolean` | `reloading`
`java.io.File` | `reloadingAgent`

Constructor Summary
`ForkedGrailsProcess()`

Method Summary
`protected java.lang.Process` | `attachOutputListener(java.lang.Process process, boolean async = false)`
`protected java.util.List` | `buildMinimalIsolatedClasspath(BuildSettings buildSettings)`
`protected java.util.List` | `buildProcessCommand(ExecutionContext executionContext, java.lang.String classpathString, boolean isReserve = false, boolean isDaemon = false)`
`void` | `configure(java.util.Map forkConfig)`
`protected void` | `configureFork(BuildSettings buildSettings)`
`protected groovy.lang.GroovyClassLoader` | `createClassLoader(BuildSettings buildSettings)`
`protected void` | `discoverAndSetAgent(ExecutionContext executionContext)`
`protected java.io.File` | `findJarFile(java.lang.Class targetClass)`
`java.util.Collection` | `findSystemClasspathJars(BuildSettings buildSettings)`
`protected java.io.File` | `findToolsJar()`
`java.lang.Process` | `fork(java.util.Map argsMap = new LinkedHashMap()`
`void` | `forkDaemon(ExecutionContext executionContext = getExecutionContext()`
`void` | `forkReserve(ExecutionContext executionContext = getExecutionContext()`
`protected void` | `forkReserveProcess(java.util.List cmd, ExecutionContext executionContext, boolean attachListener = true)`
`protected java.lang.String` | `getBoostrapClasspath(ExecutionContext executionContext)`
`protected java.io.File` | `getResumeDir()`
`protected BuildSettings` | `initializeBuildSettings(ExecutionContext ec)`
`protected java.net.URLClassLoader` | `initializeClassLoader(BuildSettings buildSettings)`
`protected void` | `initializeLogging(java.io.File grailsHome, java.lang.ClassLoader classLoader)`
`protected boolean` | `isDaemonProcess()` Returns: Whether this process is a reserve process.
`boolean` | `isDaemonRunning()`
`protected boolean` | `isDebugForkEnabled()`
`boolean` | `isForkingReserveEnabled()`
`protected boolean` | `isReserveProcess()` Returns: Whether this process is a reserve process.
`protected boolean` | `isWindows()`
`void` | `killAfterTimeout()`
`ExecutionContext` | `readExecutionContext()`
`protected ExecutionContext` | `readExecutionContext(java.lang.String location)`
`static java.lang.String` | `readLine(java.io.InputStream inputStream)`
`void` | `restartDaemon(ExecutionContext executionContext = getExecutionContext()`
`protected void` | `runDaemonCommand(java.lang.String daemonCmd)`
`protected void` | `setupReloading(java.net.URLClassLoader classLoader, BuildSettings buildSettings)` @param classLoader
`protected boolean` | `shouldRunWithDaemon()`
`void` | `startDaemon(groovy.lang.Closure callable)`
`protected void` | `startProjectWatcher(java.net.URLClassLoader classLoader, BuildSettings buildSettings)`
`protected java.io.File` | `storeExecutionContext(ExecutionContext executionContext)`
`protected void` | `waitForResume()`

Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### DEBUG_FORK

    public static final java.lang.String DEBUG_FORK

### DEFAULT_DAEMON_PORT

    public static final int DEFAULT_DAEMON_PORT

### DEFAULT_DEBUG_ARGS

    public static final java.lang.String DEFAULT_DEBUG_ARGS

Property Detail

### daemon

    boolean daemon

### daemonPort

    int daemonPort

### debug

    boolean debug

### debugArgs

    java.lang.String debugArgs

### encoding

    java.lang.String encoding

### executionContext

    ExecutionContext executionContext

### forkReserve

    boolean forkReserve

### forkedClassLoader

    java.net.URLClassLoader forkedClassLoader

### jvmArgs

    java.util.List jvmArgs

### maxMemory

    int maxMemory

### maxPerm

    int maxPerm

### minMemory

    int minMemory

### reloading

    boolean reloading

### reloadingAgent

    java.io.File reloadingAgent

Constructor Detail

### ForkedGrailsProcess

    ForkedGrailsProcess()

Method Detail

### attachOutputListener

    @groovy.transform.CompileStatic
    protected java.lang.Process attachOutputListener(java.lang.Process process, boolean async = false)

### buildMinimalIsolatedClasspath

    @groovy.transform.CompileStatic
    protected java.util.List buildMinimalIsolatedClasspath(BuildSettings buildSettings)

### buildProcessCommand

    @groovy.transform.CompileStatic
    protected java.util.List buildProcessCommand(ExecutionContext executionContext, java.lang.String classpathString, boolean isReserve = false, boolean isDaemon = false)

### configure

    @groovy.transform.CompileStatic
    void configure(java.util.Map forkConfig)

### configureFork

    protected void configureFork(BuildSettings buildSettings)

### createClassLoader

    @groovy.transform.CompileStatic
    protected groovy.lang.GroovyClassLoader createClassLoader(BuildSettings buildSettings)

### discoverAndSetAgent

    @groovy.transform.CompileStatic
    protected void discoverAndSetAgent(ExecutionContext executionContext)

### findJarFile

    @groovy.transform.CompileStatic
    protected java.io.File findJarFile(java.lang.Class targetClass)

### findSystemClasspathJars

    @groovy.transform.CompileStatic
    java.util.Collection findSystemClasspathJars(BuildSettings buildSettings)

### findToolsJar

    @groovy.transform.CompileStatic
    protected java.io.File findToolsJar()

### fork

    @groovy.transform.CompileStatic
    java.lang.Process fork(java.util.Map argsMap = new LinkedHashMap()

### forkDaemon

    @groovy.transform.CompileStatic
    void forkDaemon(ExecutionContext executionContext = getExecutionContext()

### forkReserve

    @groovy.transform.CompileStatic
    void forkReserve(ExecutionContext executionContext = getExecutionContext()

### forkReserveProcess

    @groovy.transform.CompileStatic
    protected void forkReserveProcess(java.util.List cmd, ExecutionContext executionContext, boolean attachListener = true)

### getBoostrapClasspath

    @groovy.transform.CompileStatic
    protected java.lang.String getBoostrapClasspath(ExecutionContext executionContext)

### getResumeDir

    protected java.io.File getResumeDir()

### initializeBuildSettings

    @groovy.transform.CompileStatic
    protected BuildSettings initializeBuildSettings(ExecutionContext ec)

### initializeClassLoader

    @groovy.transform.CompileStatic
    protected java.net.URLClassLoader initializeClassLoader(BuildSettings buildSettings)

### initializeLogging

    protected void initializeLogging(java.io.File grailsHome, java.lang.ClassLoader classLoader)

### isDaemonProcess

    protected boolean isDaemonProcess()

  Returns:
    Whether this process is a reserve process. A reserve process is an additional JVM, bootstrapped and idle that can resume execution at a later date

### isDaemonRunning

    boolean isDaemonRunning()

### isDebugForkEnabled

    @groovy.transform.CompileStatic
    protected boolean isDebugForkEnabled()

### isForkingReserveEnabled

    @groovy.transform.CompileStatic
    boolean isForkingReserveEnabled()

### isReserveProcess

    protected boolean isReserveProcess()

  Returns:
    Whether this process is a reserve process. A reserve process is an additional JVM, bootstrapped and idle that can resume execution at a later date

### isWindows

    @groovy.transform.CompileStatic
    protected boolean isWindows()

### killAfterTimeout

    @groovy.transform.CompileStatic
    void killAfterTimeout()

### readExecutionContext

    @groovy.transform.CompileStatic
    ExecutionContext readExecutionContext()

### readExecutionContext

    @groovy.transform.CompileStatic
    protected ExecutionContext readExecutionContext(java.lang.String location)

### readLine

    @groovy.transform.CompileStatic
    static java.lang.String readLine(java.io.InputStream inputStream)

### restartDaemon

    @groovy.transform.CompileStatic
    void restartDaemon(ExecutionContext executionContext = getExecutionContext()

### runDaemonCommand

    @groovy.transform.CompileStatic
    protected void runDaemonCommand(java.lang.String daemonCmd)

### setupReloading

    protected void setupReloading(java.net.URLClassLoader classLoader, BuildSettings buildSettings)

  Parameters:
    classLoader
    buildSettings

### shouldRunWithDaemon

    @groovy.transform.CompileStatic
    protected boolean shouldRunWithDaemon()

### startDaemon

    @groovy.transform.CompileStatic
    void startDaemon(groovy.lang.Closure callable)

### startProjectWatcher

    protected void startProjectWatcher(java.net.URLClassLoader classLoader, BuildSettings buildSettings)

### storeExecutionContext

    protected java.io.File storeExecutionContext(ExecutionContext executionContext)

### waitForResume

    @groovy.transform.CompileStatic
    protected void waitForResume()

Groovy Documentation