Tabnine Logo
LocalContainer
Code IndexAdd Tabnine to your IDE (free)

How to use
LocalContainer
in
org.codehaus.cargo.container

Best Java code snippets using org.codehaus.cargo.container.LocalContainer (Showing top 20 results out of 315)

origin: codehaus-cargo/cargo

/**
 * {@inheritDoc}
 */
@Override
protected Configuration getConfiguration()
{
  return this.container.getConfiguration();
}
origin: codehaus-cargo/cargo

  @Override
  public void run()
  {
    try
    {
      if (org.codehaus.cargo.container.State.STARTED
        == localContainer.getState()
        ||
        org.codehaus.cargo.container.State.STARTING
        == localContainer.getState())
      {
        localContainer.stop();
      }
    }
    catch (Exception e)
    {
      throw new CargoException("Failed stopping the container.", e);
    }
  }
});
origin: codehaus-cargo/cargo

  /**
   * {@inheritDoc}
   */
  @Override
  protected void executeLocalContainerAction()
  {
    this.localContainer.restart();
  }
}
origin: codehaus-cargo/cargo

/**
 * Sole constructor.
 * @param jrunContainer {@link LocalContainer}
 */
public JRun4xFilterChain(LocalContainer jrunContainer)
{
  this.jrunContainer = (InstalledLocalContainer) jrunContainer;
  this.configuration = jrunContainer.getConfiguration();
  this.xmlUtil = new XmlUtils(jrunContainer.getFileHandler());
  this.init();
}
origin: codehaus-cargo/cargo

/**
 * {@inheritDoc}
 */
@Override
public void startAndStop(URL warPingURL)
{
  String testFileName = "cargo-test/test.file";
  File testFile = new File(getLocalContainer().getConfiguration().getHome(), testFileName);
  assertFalse("File " + testFile + " already exists", testFile.exists());
  FileConfig fileConfig = new FileConfig();
  fileConfig.setFile(getTestData().getTestDataFileFor("simple-war"));
  fileConfig.setToFile(testFileName);
  getLocalContainer().getConfiguration().setConfigFileProperty(fileConfig);
  getLocalContainer().start();
  PingUtils.assertPingTrue(warPingURL.getPath() + " not started", warPingURL, getLogger());
  // CARGO-1195: DeployableFiles should be setup for ExistingLocalConfiguration
  assertTrue("File " + testFile + " was not configured", testFile.exists());
  getLocalContainer().stop();
  PingUtils.assertPingFalse(warPingURL.getPath() + " not stopped", warPingURL, getLogger());
}
origin: org.codehaus.cargo/cargo-ant

  start.setAutostart(daemonAutostartContainer);
  start.setContainer(installedLocalContainer);
  start.setDeployables(localContainer.getConfiguration().getDeployables());
  start.setHandleId(daemonHandleId);
  if (getZipURLInstaller() != null)
localContainer.start();
waitDeployableMonitor(true);
localContainer.restart();
waitDeployableMonitor(true);
localContainer.start();
waitDeployableMonitor(true);
localContainer.stop();
waitDeployableMonitor(false);
localContainer.getConfiguration().configure(localContainer);
origin: codehaus-cargo/cargo

getResourceUtils().copyResource(RESOURCE_PATH + container.getId() + "/"
  + getPropertyValue(GeronimoPropertySet.GERONIMO_SERVLET_CONTAINER_ID)
  + "/config.xml", new File(configDir, "config.xml"), filterChain, "UTF-8");
getResourceUtils().copyResource(RESOURCE_PATH + container.getId() + "/users.properties",
  new File(securityDir, "users.properties"), filterChain, "ISO-8859-1");
getResourceUtils().copyResource(RESOURCE_PATH + container.getId() + "/groups.properties",
  new File(securityDir, "groups.properties"), filterChain, "ISO-8859-1");
String keystoresDir = getFileHandler().createDirectory(securityDir, "keystores");
getResourceUtils().copyResource(RESOURCE_PATH + container.getId() + "/keystore",
  new File(keystoresDir, "geronimo-default"));
getResourceUtils().copyResource(RESOURCE_PATH + container.getId()
  + "/server-log4j.properties",
  new File(logDir, "server-log4j.properties"), filterChain, "ISO-8859-1");
getResourceUtils().copyResource(RESOURCE_PATH + container.getId()
  + "/client-log4j.properties", new File(logDir, "client-log4j.properties"), filterChain, 
  "ISO-8859-1");
getResourceUtils().copyResource(RESOURCE_PATH + container.getId()
  + "/deployer-log4j.properties",
  new File(logDir, "deployer-log4j.properties"), filterChain, "ISO-8859-1");
origin: codehaus-cargo/cargo

public String getDeployableDir(Deployable deployable)
  String jonasDeployableDir = getContainer().getConfiguration().getHome();
  if (DeployableType.WAR.equals(deployable.getType()))
    throw new ContainerException("Container " + getContainer().getName()
      + " cannot deploy " + deployable.getType() + " deployables");
origin: codehaus-cargo/cargo

/**
 * {@inheritDoc}
 */
@Override
public void doConfigure(LocalContainer container) throws Exception
{
  try
  {
    setupConfigurationDir();
    FilterChain filterChain = createJettyFilterChain();
    String etcDir = getFileHandler().createDirectory(getHome(), "etc");
    getResourceUtils().copyResource(RESOURCE_PATH + "cargocpc.war",
      new File(getHome(), "cargocpc.war"));
    getResourceUtils().copyResource(RESOURCE_PATH + container.getId() + "/webdefault.xml",
      new File(etcDir, "webdefault.xml"), filterChain, "UTF-8");
    if (container.getOutput() != null)
    {
      activateLogging(container);
    }
  }
  catch (Exception e)
  {
    throw new ContainerException("Failed to create a " + container.getName()
      + " container configuration", e);
  }
}
origin: codehaus-cargo/cargo

  /**
   * Start, test and stop WAR.
   * @param warPingURL WAR ping URL.
   */
  protected void startAndStop(URL warPingURL)
  {
    getLocalContainer().start();
    PingUtils.assertPingTrue(warPingURL.getPath() + " not started", warPingURL, getLogger());

    getLocalContainer().stop();
    PingUtils.assertPingFalse(warPingURL.getPath() + " not stopped", warPingURL, getLogger());
  }
}
origin: codehaus-cargo/cargo

if (!getContainer().getCapability().supportsDeployableType(deployable.getType()))
    + " archives are not supported for deployment in [" + getContainer().getId()
    + "]. Got [" + deployable.getFile() + "]");
      throw new ContainerException("Container " + getContainer().getName()
        + " cannot deploy expanded " + deployable.getType() + " deployables");
origin: codehaus-cargo/cargo

getLocalContainer().start();
assertEquals(State.STARTED, getContainer().getState());
getLocalContainer().restart();
assertEquals(State.STARTED, getContainer().getState());
getLocalContainer().stop();
assertEquals(State.STOPPED, getContainer().getState());
getLocalContainer().restart();
assertEquals(State.STARTED, getContainer().getState());
getLocalContainer().stop();
assertEquals(State.STOPPED, getContainer().getState());
origin: org.codehaus.cargo/cargo-core-container-tomcat

if (!getContainer().getCapability().supportsDeployableType(deployable.getType()))
  throw new ContainerException(getContainer().getName() + " doesn't support ["
    + deployable.getType().getType().toUpperCase() + "] archives. Got ["
    + deployable.getFile() + "]");
origin: codehaus-cargo/cargo

/**
 * {@inheritDoc}
 */
@Override
public void configure(LocalContainer container)
{
  if (getPropertyValue(GeneralPropertySet.JAVA_HOME) == null)
  {
    setProperty(GeneralPropertySet.JAVA_HOME, System.getProperty("java.home"));
  }
  parsePropertiesForPendingConfiguration();
  verify();
  try
  {
    doConfigure(container);
  }
  catch (Exception e)
  {
    throw new ContainerException("Failed to create a " + container.getName() + " "
      + getType().getType() + " configuration", e);
  }
  configureFiles(getFilterChain(), container);
}
origin: codehaus-cargo/cargo

/**
 * return whether or not the container is running.
 * 
 * @return true, if the container is running
 */
private boolean isRunning()
{
  return getContainer().getState().equals(State.STARTED)
    || getContainer().getState().equals(State.STARTING);
}
origin: codehaus-cargo/cargo

  /**
   * {@inheritDoc}
   */
  @Override
  public void doExecute() throws MojoExecutionException
  {
    Container container = createContainer();

    if (!container.getType().isLocal())
    {
      throw new MojoExecutionException("Only local containers can be stopped");
    }

    try
    {
      ((LocalContainer) container).stop();
      waitDeployableMonitor(container, false);
    }
    catch (Exception ex)
    {
      throw new MojoExecutionException(
          "Cannot start container [" + container + "]", ex);
    }
  }
}
origin: codehaus-cargo/cargo

  /**
   * Start container with port offset.
   * @throws Exception If anything goes wrong.
   */
  public void testStartWithPortOffset() throws Exception
  {
    int offsetValue = Integer.valueOf(OFFSET);
    int portWithOffset = getTestData().port + offsetValue;

    Deployable war = new DefaultDeployableFactory().createDeployable(getContainer().getId(),
        getTestData().getTestDataFileFor("simple-war"), DeployableType.WAR);

    getLocalContainer().getConfiguration().addDeployable(war);

    URL warPingURL = new URL("http://localhost:" + portWithOffset + "/simple-war/index.jsp");

    getLocalContainer().start();
    PingUtils.assertPingTrue(warPingURL.getPath() + " not started", warPingURL, getLogger());

    getLocalContainer().stop();
    PingUtils.assertPingFalse(warPingURL.getPath() + " not stopped", warPingURL, getLogger());
  }
}
origin: codehaus-cargo/cargo

  start.setAutostart(daemonAutostartContainer);
  start.setContainer(installedLocalContainer);
  start.setDeployables(localContainer.getConfiguration().getDeployables());
  start.setHandleId(daemonHandleId);
  if (getZipURLInstaller() != null)
localContainer.start();
waitDeployableMonitor(true);
localContainer.restart();
waitDeployableMonitor(true);
localContainer.start();
waitDeployableMonitor(true);
localContainer.stop();
waitDeployableMonitor(false);
localContainer.getConfiguration().configure(localContainer);
origin: org.codehaus.cargo/cargo-core-container-geronimo

getResourceUtils().copyResource(RESOURCE_PATH + container.getId() + "/"
  + getPropertyValue(GeronimoPropertySet.GERONIMO_SERVLET_CONTAINER_ID)
  + "/config.xml", new File(configDir, "config.xml"), filterChain, "UTF-8");
getResourceUtils().copyResource(RESOURCE_PATH + container.getId() + "/users.properties",
  new File(securityDir, "users.properties"), filterChain, "ISO-8859-1");
getResourceUtils().copyResource(RESOURCE_PATH + container.getId() + "/groups.properties",
  new File(securityDir, "groups.properties"), filterChain, "ISO-8859-1");
String keystoresDir = getFileHandler().createDirectory(securityDir, "keystores");
getResourceUtils().copyResource(RESOURCE_PATH + container.getId() + "/keystore",
  new File(keystoresDir, "geronimo-default"));
getResourceUtils().copyResource(RESOURCE_PATH + container.getId()
  + "/server-log4j.properties",
  new File(logDir, "server-log4j.properties"), filterChain, "ISO-8859-1");
getResourceUtils().copyResource(RESOURCE_PATH + container.getId()
  + "/client-log4j.properties", new File(logDir, "client-log4j.properties"), filterChain, 
  "ISO-8859-1");
getResourceUtils().copyResource(RESOURCE_PATH + container.getId()
  + "/deployer-log4j.properties",
  new File(logDir, "deployer-log4j.properties"), filterChain, "ISO-8859-1");
origin: org.codehaus.cargo/cargo-core-container-jonas

public String getDeployableDir(Deployable deployable)
  String jonasDeployableDir = getContainer().getConfiguration().getHome();
  if (DeployableType.WAR.equals(deployable.getType()))
    throw new ContainerException("Container " + getContainer().getName()
      + " cannot deploy " + deployable.getType() + " deployables");
org.codehaus.cargo.containerLocalContainer

Javadoc

A local container is a container that executes on the machine where Cargo is executing. A local container can be started and stopped and is thus controlled by Cargo. This is by opposition to a remote container which is outside the control of Cargo and which is started and stopped externally from Cargo.

Most used methods

  • getConfiguration
  • getId
  • getState
  • getName
  • stop
  • restart
  • setTimeout
  • start
  • getCapability
  • getFileHandler
  • isAppend
  • setOutput
  • isAppend,
  • setOutput,
  • getLogger,
  • getOutput,
  • getTimeout,
  • getType,
  • setAppend,
  • setConfiguration

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now