Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWITCHYARD-1935: Upgrade KIE/Drools/jBPM from 6.0.0.Final to 6.0.1.Final #385

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;

import javax.enterprise.inject.spi.Extension;

import org.apache.log4j.Logger;
import org.jboss.as.server.deployment.Attachments;
Expand All @@ -23,7 +26,9 @@
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.DeploymentUnitProcessor;
import org.jboss.as.weld.WeldDeploymentMarker;
import org.jboss.as.weld.deployment.WeldAttachments;
import org.jboss.modules.Module;
import org.jboss.weld.bootstrap.spi.Metadata;
import org.switchyard.as7.extension.ExtensionMessages;
import org.switchyard.as7.extension.SwitchYardDeploymentMarker;

Expand Down Expand Up @@ -73,14 +78,55 @@ private void checkExtension(final String extensionName, DeploymentUnit deploymen
Method registerMethod = weldPortableExtensionsClass.getDeclaredMethod(TRY_REGISTER_EXTENSION, Class.class, DeploymentUnit.class);
Object extensions = getExtensionMethod.invoke(null, deploymentUnit);
Class<?> extensionClass = null;
extensionClass = module.getClassLoader().loadClass(extensionName);
try {
extensionClass = module.getClassLoader().loadClass(extensionName);
} catch (ClassNotFoundException cnfe) {
throw new DeploymentUnitProcessingException(cnfe);
}
if (extensionClass != null) {
registerMethod.invoke(extensions, extensionClass, deploymentUnit);
} else {
throw ExtensionMessages.MESSAGES.extensionNotfound(extensionName);
}
} catch (ClassNotFoundException cnfe) {
throw new DeploymentUnitProcessingException(cnfe);
} catch (ClassNotFoundException wcnfe) {
final List<Metadata<Extension>> extensions = parent.getAttachmentList(WeldAttachments.PORTABLE_EXTENSIONS);

boolean found = false;
for (Metadata<Extension> extension : extensions) {
if (extension.getLocation().equals(extensionName)) {
found = true;
break;
}
}

if (!found) {
_logger.debug("SwitchYard Application for deployment unit '" + deploymentUnit.getName() + "' contains CDI Beans. "
+ "Attaching SwitchYard CDI Discovery (" + extensionName + ") to deployment.");

try {
Class<?> extensionClass = module.getClassLoader().loadClass(extensionName);
final Extension extensionInstance = (Extension) extensionClass.newInstance();

Metadata<Extension> metadata = new Metadata<Extension>() {
@Override
public Extension getValue() {
return extensionInstance;
}

@Override
public String getLocation() {
return extensionName;
}
};
parent.addToAttachmentList(WeldAttachments.PORTABLE_EXTENSIONS, metadata);
} catch (InstantiationException ie) {
throw new DeploymentUnitProcessingException(ie);
} catch (IllegalAccessException iae) {
throw new DeploymentUnitProcessingException(iae);
} catch (ClassNotFoundException cnfe) {
throw new DeploymentUnitProcessingException(cnfe);
}
}
} catch (IllegalAccessException iae) {
throw new DeploymentUnitProcessingException(iae);
} catch (NoSuchMethodException nsme) {
Expand Down
16 changes: 16 additions & 0 deletions jboss-as7/kiedroolsjbpm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@
<version>${version.jbpm}</version>
<type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-human-task-audit</artifactId>
<version>${version.jbpm}</version>
<type>jar</type>
</artifactItem>
<artifactItem>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-kie-services</artifactId>
<version>${version.jbpm}</version>
<type>jar</type>
</artifactItem>
</artifactItems>
<includes>META-INF/*.xsd,META-INF/*orm.xml</includes>
<outputDirectory>${project.build.directory}/jbpm-meta-inf</outputDirectory>
Expand Down Expand Up @@ -185,6 +197,10 @@
<groupId>org.jbpm</groupId>
<artifactId>jbpm-flow-builder</artifactId>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-human-task-audit</artifactId>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-human-task-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<include>org.jbpm:jbpm-bpmn2</include>
<include>org.jbpm:jbpm-flow</include>
<include>org.jbpm:jbpm-flow-builder</include>
<include>org.jbpm:jbpm-human-task-audit</include>
<include>org.jbpm:jbpm-human-task-core</include>
<include>org.jbpm:jbpm-human-task-workitems</include>
<include>org.jbpm:jbpm-kie-services</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<resource-root path="jbpm-bpmn2-${version.jbpm}.jar"/>
<resource-root path="jbpm-flow-${version.jbpm}.jar"/>
<resource-root path="jbpm-flow-builder-${version.jbpm}.jar"/>
<resource-root path="jbpm-human-task-audit-${version.jbpm}.jar"/>
<resource-root path="jbpm-human-task-core-${version.jbpm}.jar"/>
<resource-root path="jbpm-human-task-workitems-${version.jbpm}.jar"/>
<resource-root path="jbpm-kie-services-${version.jbpm}.jar"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@
<module name="com.google.protobuf"/>
<module name="org.jboss.logging"/>
<module name="org.drools" export="true"/>
<module name="org.jbpm" export="true"/>
<module name="org.jbpm" export="true">
<imports>
<include path="META-INF/services"/>
</imports>
<exports>
<include path="META-INF/services"/>
</exports>
</module>
<module name="org.kie" export="true"/>
<module name="org.switchyard.api"/>
<module name="org.switchyard.common"/>
Expand Down