Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DROOLS-494: implementing execution server
- Loading branch information
Showing
36 changed files
with
2,688 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
/target | |||
/local | |||
|
|||
# Eclipse, Netbeans and IntelliJ files | |||
/.* | |||
!.gitignore | |||
/nbproject | |||
/*.ipr | |||
/*.iws | |||
/*.iml | |||
|
|||
# Repository wide ignore mac DS_Store files | |||
.DS_Store | |||
|
|||
# Original jbpm ignores | |||
bin/ | |||
*~ | |||
*.tlog | |||
|
|||
# Test info | |||
/settings*.xml | |||
/lib-jdbc/ | |||
bitronix-default-config.properties | |||
*.db | |||
|
|||
# modules that don't exist in this branch | |||
/jbpm-human-task-war/ | |||
|
|||
# files used for external db testing | |||
jdbc_driver.jar | |||
db-settings.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
/target | |||
/local | |||
|
|||
# Eclipse, Netbeans and IntelliJ files | |||
/.* | |||
!.gitignore | |||
/nbproject | |||
/*.ipr | |||
/*.iws | |||
/*.iml | |||
|
|||
# Repository wide ignore mac DS_Store files | |||
.DS_Store | |||
|
|||
# Original jbpm ignores | |||
bin/ | |||
*~ | |||
*.tlog | |||
|
|||
# Test info | |||
/settings*.xml | |||
/lib-jdbc/ | |||
bitronix-default-config.properties | |||
*.db | |||
|
|||
# modules that don't exist in this branch | |||
/jbpm-human-task-war/ | |||
|
|||
# files used for external db testing | |||
jdbc_driver.jar | |||
db-settings.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,75 @@ | |||
<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.kie</groupId> | |||
<artifactId>kie-server</artifactId> | |||
<version>6.2.0-SNAPSHOT</version> | |||
</parent> | |||
|
|||
<artifactId>kie-server-api</artifactId> | |||
<packaging>jar</packaging> | |||
|
|||
<name>KIE :: Execution Server :: API</name> | |||
<description>KIE Execution Server API</description> | |||
|
|||
<dependencies> | |||
<!-- core dependencies --> | |||
<dependency> | |||
<groupId>org.kie</groupId> | |||
<artifactId>kie-api</artifactId> | |||
<!-- scope>provided</scope --> | |||
</dependency> | |||
|
|||
</dependencies> | |||
|
|||
<build> | |||
<resources> | |||
<resource> | |||
<directory>src/main/resources</directory> | |||
</resource> | |||
<resource> | |||
<filtering>true</filtering> | |||
<directory>src/main/filtered-resources</directory> | |||
</resource> | |||
</resources> | |||
|
|||
<plugins> | |||
<plugin> | |||
<artifactId>maven-eclipse-plugin</artifactId> | |||
<configuration> | |||
<additionalBuildcommands> | |||
<buildCommand> | |||
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> | |||
<triggers>auto,full,incremental,</triggers> | |||
<arguments> | |||
<LaunchConfigHandle><project>/.externalToolBuilders/mvn-resources.launch</LaunchConfigHandle> | |||
</arguments> | |||
</buildCommand> | |||
</additionalBuildcommands> | |||
<additionalConfig> | |||
<file> | |||
<name>.externalToolBuilders/mvn-resources.launch</name> | |||
<content> | |||
<![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType"> | |||
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="true"/> | |||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/> | |||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> <launchConfigurationWorkingSet editPageId="org.eclipse.ui.resourceWorkingSetPage" factoryID="org.eclipse.ui.internal.WorkingSetFactory" label="workingSet" name="workingSet"> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/${project.artifactId}/src/main/resources" type="2"/> </launchConfigurationWorkingSet>}"/> | |||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:MAVEN_HOME}/bin/mvn"/> | |||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/> | |||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="resources:resources"/> | |||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/> | |||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/${artifactId}}"/> | |||
</launchConfiguration>]]> | |||
</content> | |||
</file> | |||
</additionalConfig> | |||
</configuration> | |||
</plugin> | |||
</plugins> | |||
|
|||
</build> | |||
|
|||
|
|||
</project> |
1 change: 1 addition & 0 deletions
1
kie-server/kie-server-api/src/main/filtered-resources/kie.server.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
kie.server.version=${project.version} |
55 changes: 55 additions & 0 deletions
55
kie-server/kie-server-api/src/main/java/org/kie/server/api/KieServerEnvironment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,55 @@ | |||
package org.kie.server.api; | |||
|
|||
import java.io.IOException; | |||
import java.io.InputStream; | |||
import java.util.Properties; | |||
import java.util.regex.Matcher; | |||
import java.util.regex.Pattern; | |||
|
|||
|
|||
public class KieServerEnvironment { | |||
|
|||
private static final Pattern VERSION_PAT = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)([\\.-].*)?"); | |||
private static Version version; | |||
|
|||
static { | |||
String kieServerString = KieServerEnvironment.class.getPackage().getImplementationVersion(); | |||
if (kieServerString == null) { | |||
InputStream is = null; | |||
try { | |||
is = KieServerEnvironment.class.getClassLoader().getResourceAsStream("kie.server.properties"); | |||
Properties properties = new Properties(); | |||
properties.load(is); | |||
kieServerString = properties.get("kie.server.version").toString(); | |||
is.close(); | |||
} catch ( IOException e ) { | |||
throw new RuntimeException(e); | |||
} finally { | |||
if (is != null) { | |||
try { | |||
is.close(); | |||
} catch (IOException e) { | |||
throw new RuntimeException(e); | |||
} | |||
} | |||
} | |||
} | |||
|
|||
Matcher m = VERSION_PAT.matcher(kieServerString); | |||
if( m.matches() ) { | |||
try { | |||
version = new Version( Integer.parseInt(m.group(1)), | |||
Integer.parseInt(m.group(2)), | |||
Integer.parseInt(m.group(3)), | |||
m.group(4) ); | |||
} catch (NumberFormatException e) { | |||
version = new Version(0,0,0,null); | |||
} | |||
} | |||
} | |||
|
|||
public static Version getVersion() { | |||
return version; | |||
} | |||
|
|||
} |
73 changes: 73 additions & 0 deletions
73
kie-server/kie-server-api/src/main/java/org/kie/server/api/Version.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,73 @@ | |||
package org.kie.server.api; | |||
|
|||
public class Version { | |||
|
|||
private final int major; | |||
private final int minor; | |||
private final int revision; | |||
private final String classifier; | |||
|
|||
public Version(int major, int minor, int revision, String classifier) { | |||
super(); | |||
this.major = major; | |||
this.minor = minor; | |||
this.revision = revision; | |||
this.classifier = classifier; | |||
} | |||
|
|||
public int getMajor() { | |||
return major; | |||
} | |||
|
|||
public int getMinor() { | |||
return minor; | |||
} | |||
|
|||
public int getRevision() { | |||
return revision; | |||
} | |||
|
|||
public String getClassifier() { | |||
return classifier; | |||
} | |||
|
|||
@Override | |||
public int hashCode() { | |||
final int prime = 31; | |||
int result = 1; | |||
result = prime * result + ((classifier == null) ? 0 : classifier.hashCode()); | |||
result = prime * result + major; | |||
result = prime * result + minor; | |||
result = prime * result + revision; | |||
return result; | |||
} | |||
|
|||
@Override | |||
public boolean equals(Object obj) { | |||
if (this == obj) | |||
return true; | |||
if (obj == null) | |||
return false; | |||
if (getClass() != obj.getClass()) | |||
return false; | |||
Version other = (Version) obj; | |||
if (classifier == null) { | |||
if (other.classifier != null) | |||
return false; | |||
} else if (!classifier.equals(other.classifier)) | |||
return false; | |||
if (major != other.major) | |||
return false; | |||
if (minor != other.minor) | |||
return false; | |||
if (revision != other.revision) | |||
return false; | |||
return true; | |||
} | |||
|
|||
@Override | |||
public String toString() { | |||
return major + "." + minor + "." + revision + (classifier != null ? classifier : ""); | |||
} | |||
|
|||
} |
53 changes: 53 additions & 0 deletions
53
...server/kie-server-api/src/main/java/org/kie/server/api/commands/CallContainerCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,53 @@ | |||
package org.kie.server.api.commands; | |||
|
|||
import javax.xml.bind.annotation.XmlAccessType; | |||
import javax.xml.bind.annotation.XmlAccessorType; | |||
import javax.xml.bind.annotation.XmlAttribute; | |||
import javax.xml.bind.annotation.XmlElement; | |||
import javax.xml.bind.annotation.XmlRootElement; | |||
|
|||
import org.kie.server.api.model.KieServerCommand; | |||
|
|||
@XmlRootElement(name = "call-container") | |||
@XmlAccessorType(XmlAccessType.NONE) | |||
public class CallContainerCommand implements KieServerCommand { | |||
|
|||
private static final long serialVersionUID = -1803374525440238478L; | |||
|
|||
@XmlAttribute(name = "container-id") | |||
private String containerId; | |||
|
|||
@XmlElement(name = "payload") | |||
private String payload; | |||
|
|||
public CallContainerCommand() { | |||
super(); | |||
} | |||
|
|||
public CallContainerCommand(String containerId, String cmdPayload) { | |||
this.containerId = containerId; | |||
this.payload = cmdPayload; | |||
} | |||
|
|||
public String getContainerId() { | |||
return containerId; | |||
} | |||
|
|||
public void setContainerId(String containerId) { | |||
this.containerId = containerId; | |||
} | |||
|
|||
public String getPayload() { | |||
return payload; | |||
} | |||
|
|||
public void setPayload(String payload) { | |||
this.payload = payload; | |||
} | |||
|
|||
@Override | |||
public String toString() { | |||
return "CallContainerCommand [containerId=" + containerId + ", payload=" + payload + "]"; | |||
} | |||
|
|||
} |
Oops, something went wrong.