Commit b76463d3 authored by Arnaud Saval's avatar Arnaud Saval
Browse files

WEBLAB-637 add startup script

WEBLAB-748 use Petlas 4.0

git-svn-id: svn://svn.forge.objectweb.org/svnroot/weblab/trunk/WebLabApplications/bundle@2975 a803c184-d8de-4a0e-a52b-d3eef88212b6
parent d59037e2
......@@ -70,6 +70,12 @@
<!-- README file -->
<source>README.txt</source>
</file>
<file>
<!-- Copy WebLab Launcher -->
<source>libraries/weblab-launcher/target/weblab-launcher-1.0.0-SNAPSHOT-jar-with-dependencies.jar</source>
<destName>weblab-launcher.jar</destName>
</file>
<file>
<!-- Support inter pages events in portal-ext.properties -->
<source>liferayData/portal-ext.properties</source>
......@@ -80,6 +86,12 @@
<source>petals/target/sa-weblab-chain-distribution.zip</source>
<outputDirectory>${petals.path}/toInstall</outputDirectory>
</file>
<file>
<!-- Copy -->
<source>libraries/se-pojo/target/weblab-se-pojo-petals4.zip</source>
<destName>petals-se-pojo-weblab.zip</destName>
<outputDirectory>${petals.path}/toInstall</outputDirectory>
</file>
</files>
<dependencySets>
......@@ -88,7 +100,7 @@
<includes>
<include>org.apache.tomcat:apache-tomcat:zip</include>
<include>com.liferay:liferay-portal-tomcat:zip</include>
<include>org.ow2.petals:petals-platform:zip</include>
<include>org.ow2.petals:petals-esb:zip</include>
</includes>
<outputFileNameMapping>${artifact.artifactId}</outputFileNameMapping>
<unpack>true</unpack>
......@@ -170,7 +182,7 @@
<dependencySet>
<includes>
<include>org.ow2.petals:petals-bc-soap:zip:*</include>
<include>org.ow2.petals:petals-se-pojo:zip:*</include>
<!-- <include>org.ow2.petals:petals-se-pojo:zip:*</include> -->
<include>org.ow2.weblab.engines:weblab-se-chain:zip:*</include>
</includes>
<outputDirectory>${petals.path}/toInstall</outputDirectory>
......
......@@ -16,15 +16,6 @@
<name>WebLab Portlets assembly.</name>
<description>WebLab Portlets.</description>
<!-- <modules>
<module>launch-chain</module>
<module>result</module>
<module>docview</module>
<module>search</module>
<module>metadata</module>
<module>facet</module>
</modules> -->
<dependencies>
<!-- Common libraries -->
......@@ -46,24 +37,6 @@
<version>${weblab.annotator.version}</version>
<type>jar</type>
</dependency>
<!-- <dependency>
<groupId>org.ow2.weblab.core.helpers</groupId>
<artifactId>rdf-helper-jena</artifactId>
<version>${weblab.rdf-helper-jena.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.ow2.weblab.core.helpers</groupId>
<artifactId>rdf-helper-jena-selection</artifactId>
<version>${weblab.rdf-helper-jena-selection.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.ow2.weblab.core.helpers</groupId>
<artifactId>rdf-helper-jena-structure</artifactId>
<version>${weblab.rdf-helper-jena-structure.version}</version>
<type>jar</type>
</dependency> -->
<dependency>
<groupId>org.ow2.weblab.portlets</groupId>
<artifactId>weblab-portlet</artifactId>
......
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>petals4</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>jbi.xml</source>
<outputDirectory>META-INF</outputDirectory>
</file>
</files>
<fileSets>
<fileSet>
<directory>petals-se-pojo/target/weblab-se-pojo-libs</directory>
<outputDirectory>/</outputDirectory>
<excludes>
<exclude>*.zip</exclude>
<exclude>weblab-*</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jbi version="1.0" xmlns="http://java.sun.com/xml/ns/jbi">
<component type="service-engine">
<identification>
<name>petals-se-pojo</name>
<description>JBI Components and Shared Libraries for Petals ESB</description>
</identification>
<component-class-name>
org.ow2.petals.se.pojo.PojoComponent
</component-class-name>
<component-class-path>
<path-element>axiom-api-1.2.7.jar</path-element>
<path-element>axiom-impl-1.2.7.jar</path-element>
<path-element>commons-io-1.4.jar</path-element>
<path-element>commons-lang-2.4.jar</path-element>
<path-element>commons-logging-1.1.1.jar</path-element>
<path-element>commons-pool-1.4.jar</path-element>
<path-element>dom4j-1.6.1.jar</path-element>
<path-element>easycommons.logger-1.1.jar</path-element>
<path-element>easycommons.uri-1.1.jar</path-element>
<path-element>easycommons.xml-1.1.jar</path-element>
<path-element>easywsdl-ext-wsdl4complexwsdl-2.3.jar</path-element>
<path-element>easywsdl-schema-2.3.jar</path-element>
<path-element>easywsdl-wsdl-2.3.jar</path-element>
<path-element>geronimo-activation_1.1_spec-1.0.2.jar</path-element>
<path-element>geronimo-javamail_1.4_spec-1.5.jar</path-element>
<path-element>geronimo-jta_1.1_spec-1.1.1.jar</path-element>
<path-element>geronimo-stax-api_1.0_spec-1.0.1.jar</path-element>
<path-element>icu4j-2.6.1.jar</path-element>
<path-element>jaxb-api-2.1.jar</path-element>
<path-element>jaxb-impl-2.1.10.jar</path-element>
<path-element>jaxen-1.1.1.jar</path-element>
<path-element>jdom-1.1.jar</path-element>
<path-element>neethi-2.0.4.jar</path-element>
<path-element>petals-cdk-api-2.1.2.jar</path-element>
<path-element>petals-cdk-core-5.1.2.jar</path-element>
<path-element>petals-cdk-jbidescriptor-2.1.1.jar</path-element>
<path-element>petals-commons-1.0.4.jar</path-element>
<path-element>petals-jbi-1.0.2.jar</path-element>
<path-element>petals-jbi-ext-1.0.1.jar</path-element>
<path-element>petals-se-pojo-2.2.6.jar</path-element>
<path-element>runtime-0.4.1.5.jar</path-element>
<path-element>saxonhe-9.2.0.6.jar</path-element>
<path-element>ws-addressing-definition-1.2.1.jar</path-element>
<path-element>wsdl4j-1.6.2.jar</path-element>
<path-element>ws-notification-definition-1.2.1.jar</path-element>
<path-element>ws-notification-extension-1.2.1.jar</path-element>
<path-element>ws-notification-service-1.2.1.jar</path-element>
<path-element>ws-resource-definition-1.2.1.jar</path-element>
<path-element>wstx-asl-3.2.4.jar</path-element>
<path-element>xml-apis-1.3.02.jar</path-element>
<path-element>xmlsec-1.4.2.jar</path-element>
<path-element>xom-1.0.jar</path-element>
</component-class-path>
<bootstrap-class-name>
org.ow2.petals.component.framework.DefaultBootstrap
</bootstrap-class-name>
<bootstrap-class-path>
<path-element>axiom-api-1.2.7.jar</path-element>
<path-element>axiom-impl-1.2.7.jar</path-element>
<path-element>commons-io-1.4.jar</path-element>
<path-element>commons-lang-2.4.jar</path-element>
<path-element>commons-logging-1.1.1.jar</path-element>
<path-element>commons-pool-1.4.jar</path-element>
<path-element>dom4j-1.6.1.jar</path-element>
<path-element>easycommons.logger-1.1.jar</path-element>
<path-element>easycommons.uri-1.1.jar</path-element>
<path-element>easycommons.xml-1.1.jar</path-element>
<path-element>easywsdl-ext-wsdl4complexwsdl-2.3.jar</path-element>
<path-element>easywsdl-schema-2.3.jar</path-element>
<path-element>easywsdl-wsdl-2.3.jar</path-element>
<path-element>geronimo-activation_1.1_spec-1.0.2.jar</path-element>
<path-element>geronimo-javamail_1.4_spec-1.5.jar</path-element>
<path-element>geronimo-jta_1.1_spec-1.1.1.jar</path-element>
<path-element>geronimo-stax-api_1.0_spec-1.0.1.jar</path-element>
<path-element>icu4j-2.6.1.jar</path-element>
<path-element>jaxb-api-2.1.jar</path-element>
<path-element>jaxb-impl-2.1.10.jar</path-element>
<path-element>jaxen-1.1.1.jar</path-element>
<path-element>jdom-1.1.jar</path-element>
<path-element>neethi-2.0.4.jar</path-element>
<path-element>petals-cdk-api-2.1.2.jar</path-element>
<path-element>petals-cdk-core-5.1.2.jar</path-element>
<path-element>petals-cdk-jbidescriptor-2.1.1.jar</path-element>
<path-element>petals-commons-1.0.4.jar</path-element>
<path-element>petals-jbi-1.0.2.jar</path-element>
<path-element>petals-jbi-ext-1.0.1.jar</path-element>
<path-element>petals-se-pojo-2.2.6.jar</path-element>
<path-element>runtime-0.4.1.5.jar</path-element>
<path-element>saxonhe-9.2.0.6.jar</path-element>
<path-element>ws-addressing-definition-1.2.1.jar</path-element>
<path-element>wsdl4j-1.6.2.jar</path-element>
<path-element>ws-notification-definition-1.2.1.jar</path-element>
<path-element>ws-notification-extension-1.2.1.jar</path-element>
<path-element>ws-notification-service-1.2.1.jar</path-element>
<path-element>ws-resource-definition-1.2.1.jar</path-element>
<path-element>wstx-asl-3.2.4.jar</path-element>
<path-element>xml-apis-1.3.02.jar</path-element>
<path-element>xmlsec-1.4.2.jar</path-element>
<path-element>xom-1.0.jar</path-element>
</bootstrap-class-path>
<petalsCDK:acceptor-pool-size xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">5</petalsCDK:acceptor-pool-size>
<petalsCDK:processor-pool-size xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">10</petalsCDK:processor-pool-size>
<petalsCDK:ignored-status xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">DONE_AND_ERROR_IGNORED</petalsCDK:ignored-status>
<petalsCDK:notifications xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">false</petalsCDK:notifications>
<petalsCDK:jbi-listener-class-name xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">org.ow2.petals.se.pojo.listener.JBIListener</petalsCDK:jbi-listener-class-name>
</component>
</jbi>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>libs</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.ow2.weblab.bundle</groupId>
<artifactId>versions</artifactId>
<version>1.2.5-SNAPSHOT</version>
<relativePath>../../../versions/pom.xml</relativePath>
</parent>
<groupId>org.ow2.weblab.engines</groupId>
<artifactId>weblab-se-pojo</artifactId>
<version>1.2.5-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Custom Petals Se POJO.</name>
<description>Custom Petals Se POJO.</description>
<dependencies>
<dependency>
<groupId>org.ow2.petals</groupId>
<artifactId>petals-se-pojo</artifactId>
<version>${petals.se-pojo.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.ow2.petals</groupId>
<artifactId>petals-se-pojo</artifactId>
<version>${petals.se-pojo.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxonhe</artifactId>
<version>9.2.0.6</version>
</dependency>
<dependency>
<groupId>org.ow2.petals</groupId>
<artifactId>petals-commons</artifactId>
<version>1.0.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven.assembly-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptor>assembly.xml</descriptor>
<finalName>weblab-se-pojo</finalName>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>released third party</id>
<name>WebLab released third party</name>
<layout>default</layout>
<url>http://weblab.ow2.org/release-repository/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.ow2.weblab.bundle</groupId>
<artifactId>versions</artifactId>
<version>1.2.5-SNAPSHOT</version>
<relativePath>../../versions/pom.xml</relativePath>
</parent>
<groupId>org.ow2.weblab.engines</groupId>
<artifactId>custom-petals-se-pojo</artifactId>
<version>4.0</version>
<packaging>pom</packaging>
<name>WebLab encompassed Custom Petals Se POJO.</name>
<description>WebLab encompassed Custom Petals Se POJO.</description>
<modules>
<module>petals-se-pojo</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven.assembly-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptor>assembly.xml</descriptor>
<finalName>weblab-se-pojo</finalName>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>released third party</id>
<name>WebLab released third party</name>
<layout>default</layout>
<url>http://weblab.ow2.org/release-repository/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.ow2.weblab.bundle</groupId>
<artifactId>versions</artifactId>
<version>1.2.5-SNAPSHOT</version>
<relativePath>../../versions/pom.xml</relativePath>
</parent>
<artifactId>weblab-launcher</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>WebLab Bundle launcher</name>
<description>
launcher to configure and start servers. In case something goes wrong, explains, as much as possible, where it failed and why.
</description>
<dependencies>
<dependency>
<groupId>org.ow2.petals</groupId>
<artifactId>petals-cli</artifactId>
<version>${petals-cli.version}</version>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxonhe</artifactId>
<version>${saxonhe.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven.assembly-plugin.version}</version>
<configuration>
<archive>
<manifest>
<mainClass>org.ow2.weblab.bundle.Launcher</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showWarnings>true</showWarnings>
<showDeprecations>true</showDeprecations>
<debug>true</debug>
<optimize>false</optimize>
<verbose>true</verbose>
</configuration>
<inherited>true</inherited>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>archives.org repository</id>
<url>http://builds.archive.org:8080/maven2/</url>
</repository>
<repository>
<id>petals-link</id>
<url>http://maven.petalslink.com/public/</url>
</repository>
</repositories>
</project>
package org.ow2.weblab.bundle;
import java.io.File;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
import org.ow2.petals.admin.api.AdminFactory;
import org.ow2.petals.admin.api.ArtifactAdministration;
import org.ow2.petals.admin.api.artifact.Artifact;
import org.ow2.petals.admin.api.exception.ArtifactAdministrationException;
public class ArtifactsUtils {
public static ArtifactAdministration getArtifactAdministration(){
Utils.setSystemPropertiesForPetalsCLI();
return AdminFactory.newInstance().createArtifactAdministration();
}
/**
* List all deployed artifacts
* @return
*/
public static Set<String> listArtifacts(ArtifactAdministration aa){
// List deployed artifacts
Set<String> artifacts = new HashSet<String>();
try {
for(Artifact a:aa.listArtifacts()){
artifacts.add(a.getName());
}
} catch (ArtifactAdministrationException e2) {
e2.printStackTrace();
}
return artifacts;
}
/**
* sort artifact depending on their names bc/se/sa.
* @param toInstall dir where there are artifacts
* @return the orderred set of artifacts
*/
public static Set<File> sortArtifacts(final File toInstall){
// sort bc/se/sa to deploy them in the good order
// rule 1 : components should be deployed in the following order: bc/se/sa
// rule 2 : petals components should be deployed before weblab ones
final TreeSet<File> orderedSet = new TreeSet<File>(new Comparator<File>() {
@Override
public int compare(File f1, File f2) {
String name1 = f1.getName();
String name2 = f2.getName();
boolean ibc1 = name1.contains("bc-");
boolean ibc2 = name2.contains("bc-");
boolean ise1 = name1.contains("se-");
boolean ise2 = name2.contains("se-");
boolean isp1 = name1.contains("petals");
boolean isp2 = name2.contains("petals");
if (ibc1 && !ibc2){
return -1;
}else if (!ibc1 && ibc2){
return 1;
}
if (ise1 && !ise2){
return -1;
}else if (!ise1 && ise2){
return 1;
}
if (isp1 && !isp2){
return -1;
}else if (!isp1 && isp2){
return 1;
}
return name1.compareTo(name2);
}
});
orderedSet.addAll(Arrays.asList(toInstall.listFiles()));
return orderedSet;
}
}
package org.ow2.weblab.bundle;
public interface Executor<T>{
public T execute() throws Exception;
}
package org.ow2.weblab.bundle;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashSet;
import java.util.Set;
import org.ow2.petals.admin.api.ArtifactAdministration;
import org.ow2.petals.admin.api.exception.ArtifactAdministrationException;
import org.ow2.petals.admin.jmx.JMXClientConnection;
import org.ow2.petals.jmx.JMXClient;
import org.ow2.petals.jmx.exception.ConnectionErrorException;
import org.ow2.petals.jmx.exception.InstallationServiceDoesNotExistException;
import org.ow2.petals.jmx.exception.InstallationServiceErrorException;
/**
* WebLab Launcher to launch and stop servers
* TODO: do better management for out and err stream
*
* @author asaval
*
*/
public class Launcher {
/**
* Remove Saxon xml transformer from OPTS
*/
public static String PETALS_OPTS = "-Djava.net.preferIPv4Stack=true -Xmx1024m -XX:MaxPermSize=256m";