Fragment-Host: com.springsource.org.apache.xalan
Bundle-Version: 0.12.1.SNAPSHOT
Bundle-SymbolicName: org.argeo.slc.agent.ext.xalan
-Import-Package: org.w3c.dom.traversal;resolution:=optional
+Import-Package: com.sun.org.apache.xml.internal.dtm;resolution:=optional,
+ org.w3c.dom.traversal;resolution:=optional
<service ref="jmsAgent.attachmentUploader" interface="org.argeo.slc.core.attachment.AttachmentUploader" />\r
\r
<reference id="modulesManager"\r
- interface="org.argeo.slc.execution.ExecutionModulesManager" />\r
+ interface="org.argeo.slc.execution.ExecutionModulesManager"\r
+ context-class-loader="service-provider" />\r
</beans:beans>
\ No newline at end of file
Bundle-Version: 0.12.1.SNAPSHOT
Bundle-Name: Argeo SLC Agent
Bundle-SymbolicName: org.argeo.slc.agent
+Import-Package: org.apache.xalan.processor,
+ org.apache.xerces.jaxp
-<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">
+<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.argeo.slc</groupId>
<artifactId>org.argeo.dep.osgi.commons.exec</artifactId>
</dependency>
- <!--
- <dependency> <groupId>org.apache.commons</groupId>
- <artifactId>com.springsource.org.apache.commons.logging</artifactId>
- </dependency> <dependency> <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
- </dependency>
- -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId>
}
public void run() {
+ if (getContextClassLoader() != null) {
+ if (log.isTraceEnabled())
+ log.debug("Context class loader set to "
+ + getContextClassLoader());
+ }
+
+ // Retrieve execution flow descriptor
ExecutionFlowDescriptor executionFlowDescriptor = realizedFlow
.getFlowDescriptor();
String flowName = executionFlowDescriptor.getName();
it.next().addSteps(slcExecution, steps);
}
}
-
}
org.argeo.slc.msg.event;resolution:=optional,
org.argeo.slc.msg.test.tree;resolution:=optional,
org.argeo.slc.detached;resolution:=optional,
- org.apache.xml.serialize
+ org.apache.xml.serialize;resolution:=optional,
+ org.apache.xerces.jaxp;resolution:=optional
</Import-Package>
<Fragment-Host>com.springsource.org.castor</Fragment-Host>
</instructions>
-<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">
+<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.argeo.slc</groupId>
<artifactId>org.argeo.slc.osgiboot</artifactId>
</dependency>
+ <!--
+ Xalan and Xerces are implicitly required since the JDK provided
+ implementations are overridden in the execution modules manager
+ -->
+ <dependency>
+ <groupId>org.apache.xalan</groupId>
+ <artifactId>com.springsource.org.apache.xalan</artifactId>
+ </dependency>
+
</dependencies>
</project>
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.core.Ordered;
import org.springframework.core.PriorityOrdered;
+import org.springframework.osgi.service.exporter.support.ExportContextClassLoader;
import org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean;
@SuppressWarnings(value = { "unchecked" })
private Class osgiServiceFactoryClass = OsgiServiceFactoryBean.class;
+ private Boolean useServiceProviderContextClassLoader = false;
+
public void postProcessBeanFactory(
ConfigurableListableBeanFactory beanFactory) throws BeansException {
if (!(beanFactory instanceof BeanDefinitionRegistry)) {
MutablePropertyValues mpv = new MutablePropertyValues();
mpv.addPropertyValue("interfaces", interfaces.toArray());
mpv.addPropertyValue("targetBeanName", beanName);
+ if (useServiceProviderContextClassLoader)
+ mpv.addPropertyValue("contextClassLoader",
+ ExportContextClassLoader.SERVICE_PROVIDER);
RootBeanDefinition bd = new RootBeanDefinition(
osgiServiceFactoryClass, mpv);
public int getOrder() {
return Ordered.LOWEST_PRECEDENCE;
}
+
+ public void setUseServiceProviderContextClassLoader(
+ Boolean useServiceProviderContextClassLoader) {
+ this.useServiceProviderContextClassLoader = useServiceProviderContextClassLoader;
+ }
+
}
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Properties;
import java.util.Set;
import org.apache.commons.logging.Log;
public class OsgiExecutionModulesManager extends
AbstractExecutionModulesManager implements InitializingBean,
DisposableBean, OsgiServiceLifecycleListener {
+
+ static {
+ // Force usage of vanilla Xalan when in OSGi
+ // We would like to do it in a cleaner way
+ // but the integration of Xalan and Xerces in the JRE
+ // makes it very difficult
+ // Suggestions welcome!
+ Properties systemProperties = System.getProperties();
+// if (!systemProperties
+// .containsKey("javax.xml.parsers.DocumentBuilderFactory"))
+// System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
+// "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
+// if (!systemProperties.containsKey("javax.xml.parsers.SAXParserFactory"))
+// System.setProperty("javax.xml.parsers.SAXParserFactory",
+// "org.apache.xerces.jaxp.SAXParserFactoryImpl");
+ if (!systemProperties
+ .containsKey("javax.xml.transform.TransformerFactory"))
+ System.setProperty("javax.xml.transform.TransformerFactory",
+ "org.apache.xalan.processor.TransformerFactoryImpl");
+ }
+
private final static String PROPERTY_CACHE_SERVICES = "slc.osgi.execution.cacheServices";
private final static Log log = LogFactory