Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.varia.process
Class ChildProcessService

    java.lang.Object
      org.jboss.mx.util.JBossNotificationBroadcasterSupport
          org.jboss.system.ServiceMBeanSupport
              org.jboss.varia.process.ChildProcessService

All Implemented Interfaces:
  ChildProcessServiceMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class ChildProcessService
extends org.jboss.system.ServiceMBeanSupport
implements ChildProcessServiceMBean

A service to manage a child process.

Version:
  `$Revision: 1.2 $`
Author:
  Jason Dillon

Nested Class Summary
`protected static class` | `ChildProcessService.ReaderLoggerAdapter`

Field Summary
`protected Process` | `childProcess` The child, we are so proud.
`protected String` | `commandLine` The command line of the process to execute.
`protected Properties` | `env` The environment for the process.
`protected ChildProcessService.ReaderLoggerAdapter` | `errorAdapter` The input adapter, which takes the process' STDERR and turns them into logger calls.
`protected ChildProcessService.ReaderLoggerAdapter` | `inputAdapter` The input adapter, which takes the process' STDOUT and turns them into logger calls.
`protected String` | `loggerAdapterName` The name of the logger adapter for the child process' streams.
`protected File` | `workingDir` The working directory of the process.

Fields inherited from class org.jboss.system.ServiceMBeanSupport
`log, server, SERVICE_CONTROLLER_SIG, serviceName`

Fields inherited from interface org.jboss.system.ServiceMBean
`CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED`

Constructor Summary
`ChildProcessService()`

Method Summary
`String` | `getCommandLine()`
`Properties` | `getEnvironment()`
`Integer` | `getExitValue()`
`String` | `getLoggerAdapterName()`
`File` | `getWorkingDirectory()`
`protected String[]` | `makeEnvArray(Properties props)`
`void` | `setCommandLine(String commandLine)`
`void` | `setEnvironment(Properties env)`
`void` | `setLoggerAdapterName(String name)`
`void` | `setWorkingDirectory(File dir)`
`protected void` | `startService()`
`protected void` | `stopService()`

Methods inherited from class org.jboss.system.ServiceMBeanSupport
`create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop`

Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
`addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.jboss.system.ServiceMBean
`getName, getState, getStateString, jbossInternalLifecycle`

Methods inherited from interface org.jboss.system.Service
`create, destroy, start, stop`

Field Detail

### commandLine

    protected String commandLine

  The command line of the process to execute.

### env

    protected Properties env

  The environment for the process.

### workingDir

    protected File workingDir

  The working directory of the process.

### childProcess

    protected Process childProcess

  The child, we are so proud.

### loggerAdapterName

    protected String loggerAdapterName

  The name of the logger adapter for the child process' streams.

### inputAdapter

    protected ChildProcessService.ReaderLoggerAdapter inputAdapter

  The input adapter, which takes the process' STDOUT and turns them into logger calls.

### errorAdapter

    protected ChildProcessService.ReaderLoggerAdapter errorAdapter

  The input adapter, which takes the process' STDERR and turns them into logger calls.

Constructor Detail

### ChildProcessService

    public ChildProcessService()

Method Detail

### setCommandLine

    public void setCommandLine(String commandLine)

  Specified by:
    `setCommandLine` in interface `ChildProcessServiceMBean`

### getCommandLine

    public String getCommandLine()

  Specified by:
    `getCommandLine` in interface `ChildProcessServiceMBean`

### setEnvironment

    public void setEnvironment(Properties env)

  Specified by:
    `setEnvironment` in interface `ChildProcessServiceMBean`

### getEnvironment

    public Properties getEnvironment()

  Specified by:
    `getEnvironment` in interface `ChildProcessServiceMBean`

### setWorkingDirectory

    public void setWorkingDirectory(File dir)

  Specified by:
    `setWorkingDirectory` in interface `ChildProcessServiceMBean`

### getWorkingDirectory

    public File getWorkingDirectory()

  Specified by:
    `getWorkingDirectory` in interface `ChildProcessServiceMBean`

### getExitValue

    public Integer getExitValue()

  Specified by:
    `getExitValue` in interface `ChildProcessServiceMBean`

### setLoggerAdapterName

    public void setLoggerAdapterName(String name)

  Specified by:
    `setLoggerAdapterName` in interface `ChildProcessServiceMBean`

### getLoggerAdapterName

    public String getLoggerAdapterName()

  Specified by:
    `getLoggerAdapterName` in interface `ChildProcessServiceMBean`

### makeEnvArray

    protected String[] makeEnvArray(Properties props)

### startService

    protected void startService()
                         throws Exception

  Throws:
    `Exception`

### stopService

    protected void stopService()
                        throws Exception

  Throws:
    `Exception`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 JBoss Group, LLC. All Rights Reserved.