/** * {@inheritDoc} */ @Override public void undeployWebApp(Deployable deployable) { throw new ContainerException("Not supported"); } }
/** * {@inheritDoc} */ @Override public void undeploy(Deployable deployable) { throw new ContainerException("Not supported"); }
/** * {@inheritDoc} */ @Override public void deploy(Deployable deployable) { throw new ContainerException("Not supported"); }
/** * {@inheritDoc} */ @Override public void start(Deployable deployable) { throw new ContainerException("Not supported"); }
/** * {@inheritDoc} */ @Override public void stop(Deployable deployable) { throw new ContainerException("Not supported"); }
/** * {@inheritDoc} */ @Override public void undeployWebApp(Deployable deployable) { throw new ContainerException("Not supported"); } }
/** * @param artifactName the artifact for which to return the location (eg "simple-war"). * @return the location of the artifact as a string */ public String getTestDataFileFor(String artifactName) { String result = this.testDataArtifacts.get(artifactName); if (result == null) { throw new ContainerException("Test data artifact not found [" + artifactName + "]"); } return result; } }
/** * @param artifactName the artifact for which to return the location (eg "simple-war"). * @return the location of the artifact as a string */ public String getTestDataFileFor(String artifactName) { String result = this.testDataArtifacts.get(artifactName); if (result == null) { throw new ContainerException("Test data artifact not found [" + artifactName + "]"); } return result; } }
/** * {@inheritDoc} */ @Override protected String getRemoteFileName(Deployable deployable, String deployableIdentifier, boolean askFromServer) { String result = this.findRemoteFileName(deployable, deployableIdentifier, askFromServer); if (result == null) { throw new ContainerException("Cannot find deployable " + deployable + " in the remote JONAS_BASE/deploy"); } return result; }
/** * {@inheritDoc} */ @Override public void start(Deployable deployable) { try { Object webapp = getDeployedWebAppContext(deployable); webapp.getClass().getMethod("start").invoke(webapp); } catch (Exception e) { throw new ContainerException("Failed to start [" + deployable.getFile() + "]", e); } }
/** * {@inheritDoc} */ @Override public void start(Deployable deployable) { try { Object deployedWebAppContext = getDeployedWebAppContext(deployable); webAppContextClass.getMethod("start", null).invoke(deployedWebAppContext, null); } catch (Exception e) { throw new ContainerException("Failed to start [" + deployable.getFile() + "]", e); } }
/** * {@inheritDoc} */ @Override public void stop(Deployable deployable) { try { Object deployedWebAppContext = getDeployedWebAppContext(deployable); webAppContextClass.getMethod("stop", null).invoke(deployedWebAppContext, null); } catch (Exception e) { throw new ContainerException("Failed to stop [" + deployable.getFile() + "]", e); } } }
/** * {@inheritDoc} */ @Override public void verify() { super.verify(); String configurationName = getPropertyValue(JBossPropertySet.CONFIGURATION); if (configurationName == null || configurationName.isEmpty()) { throw new ContainerException("Invalid JBoss configuration: [" + JBossPropertySet.CONFIGURATION + "] doesn't exist."); } }
/** * {@inheritDoc} */ @Override public void verify() { super.verify(); String configurationName = getPropertyValue(JBossPropertySet.CONFIGURATION); if (configurationName == null || configurationName.isEmpty()) { throw new ContainerException("Invalid JBoss configuration: [" + JBossPropertySet.CONFIGURATION + "] doesn't exist."); } }
/** * Verifies that the property {@link WildFlySwarmPropertySet#SWARM_APPLICATION_URL} has been * defined. */ private void verifyPingURL() { String pingUrl = getConfiguration().getPropertyValue(WildFlySwarmPropertySet.SWARM_APPLICATION_URL); if (pingUrl == null || pingUrl.isEmpty()) { throw new ContainerException("Missing mandatory configuration property [" + WildFlySwarmPropertySet.SWARM_APPLICATION_URL + "]."); } }
/** * @return the list of applications available in Tomcat and their statuses. */ public String list() { getLogger().debug("Getting the list of applications and their statuses", this.getClass().getName()); try { return getTomcatManager().list(); } catch (IOException|TomcatManagerException exception) { throw new ContainerException("Failed to get the list of applications", exception); } }
/** * {@inheritDoc} */ @Override public void doStart(JvmLauncher java) throws Exception { java.addAppArguments("start"); startUpAdditions(java); int returnCode = java.execute(); if (returnCode != 0) { throw new ContainerException("Resin start command returned " + returnCode + ", expected return code was 0"); } }
/** * Gets the webapp path for the specified deployable. * * @param deployable the deployable * @return the webapp path for the specified deployable */ protected String getPath(Deployable deployable) { if (deployable.getType() != DeployableType.WAR) { throw new ContainerException("Only WAR archives are supported for deployment in " + "Tomcat. Got [" + deployable.getFile() + "]"); } return "/" + ((WAR) deployable).getContext(); }
/** * Check if the directory exists. * * @param dir the directory name */ protected void checkDirExists(String dir) { String path = getFileHandler().append(getHome(), dir); boolean exists = getFileHandler().exists(path); if (!exists) { throw new ContainerException("Invalid existing configuration: directory [" + path + "] does not exist in JONAS_BASE"); } }
/** * Check if the directory exists. * * @param dir the directory name */ protected void checkDirExists(String dir) { String path = getFileHandler().append(getHome(), dir); boolean exists = getFileHandler().exists(path); if (!exists) { throw new ContainerException("Invalid existing configuration: directory [" + path + "] does not exist in JONAS_BASE"); } }