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.apache.cactus.integration.ant.container
Class ContainerRunner

    java.lang.Object
      org.apache.cactus.integration.ant.container.ContainerRunner

public final class ContainerRunner
extends java.lang.Object

Support class that handles the lifecycle of a container, which basically consists of startup and shutdown.

Version:
  $Id: ContainerRunner.java 239130 2005-01-29 15:49:18Z vmassol $

Constructor Summary
`ContainerRunner(Container theContainer)` Constructor.

Method Summary
`java.lang.String` | `getServerName()` Returns the server name as reported in the 'Server' header of HTTP responses from the server.
`void` | `setCheckInterval(long theCheckInterval)` Sets the time interval to sleep between polling the container.
`void` | `setLog(org.apache.commons.logging.Log theLog)` Sets the log to write to.
`void` | `setShutDownWait(long theShutDownWait)` Sets the time to wait after the container has been shut down.
`void` | `setTimeout(long theTimeout)` Sets the timeout after which to stop trying to call the container.
`void` | `setURL(java.net.URL theTestURL)` Sets the HTTP/HTTPS URL that will be continuously pinged to check if the container is running.
`void` | `shutDownContainer()` Method called by the task to perform the stopping of the container.
`void` | `startUpContainer()` Method called by the task to perform the startup of the container.

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

Constructor Detail

### ContainerRunner

    public ContainerRunner(Container theContainer)

  Constructor.

Parameters:
  `theContainer` - The container to run

Method Detail

### getServerName

    public java.lang.String getServerName()

  Returns the server name as reported in the 'Server' header of HTTP responses from the server.

  Returns:
    The server name

### startUpContainer

    public void startUpContainer()
                          throws java.lang.IllegalStateException

  Method called by the task to perform the startup of the container. This method takes care of starting the container in another thread, and polling the test URL to check whether startup has completed. As soon as the URL is available (or the timeout is exceeded), control is returned to the caller.

  Throws:
    `java.lang.IllegalStateException` - If the 'url' property is `null`

### shutDownContainer

    public void shutDownContainer()
                           throws java.lang.IllegalStateException

  Method called by the task to perform the stopping of the container. This method takes care of stopping the container in another thread, and polling the test URL to check whether shutdown has completed. As soon as the URL stops responding, control is returned to the caller.

  Throws:
    `java.lang.IllegalStateException` - If the 'url' property is `null`

### setCheckInterval

    public void setCheckInterval(long theCheckInterval)

  Sets the time interval to sleep between polling the container. The default interval is 500 milliseconds.

  Parameters:
    `theCheckInterval` - The interval in milliseconds

### setLog

    public void setLog(org.apache.commons.logging.Log theLog)

  Sets the log to write to.

  Parameters:
    `theLog` - The log to set

### setShutDownWait

    public void setShutDownWait(long theShutDownWait)

  Sets the time to wait after the container has been shut down. The default time is 2 seconds.

  Parameters:
    `theShutDownWait` - The time to wait in milliseconds

### setTimeout

    public void setTimeout(long theTimeout)

  Sets the timeout after which to stop trying to call the container. The default timeout is 3 minutes.

  Parameters:
    `theTimeout` - The timeout in milliseconds

### setURL

    public void setURL(java.net.URL theTestURL)

  Sets the HTTP/HTTPS URL that will be continuously pinged to check if the container is running.

  Parameters:
    `theTestURL` - The URL to set

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 © 2000-2004 Apache Software Foundation. All Rights Reserved.