Skip to content

Commit

Permalink
[tx-control] Simplify Tx Control Service providers, and add configura…
Browse files Browse the repository at this point in the history
…ble recovery logging for XA

git-svn-id: https://svn.apache.org/repos/asf/aries/trunk@1750128 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
timothyjward committed Jun 24, 2016
1 parent 1e0ebd4 commit 7f1e7ab
Show file tree
Hide file tree
Showing 10 changed files with 536 additions and 113 deletions.
1 change: 1 addition & 0 deletions tx-control/tx-control-jpa-itests/.gitignore
@@ -1 +1,2 @@
/target/
/bin/

This file was deleted.

Expand Up @@ -21,20 +21,33 @@
import java.util.Dictionary;
import java.util.Hashtable;

import org.apache.aries.tx.control.service.common.activator.AbstractActivator;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.service.transaction.control.TransactionControl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Activator extends AbstractActivator {
public class Activator implements BundleActivator {

private static final Logger logger = LoggerFactory.getLogger(Activator.class);

@Override
protected TransactionControl getTransactionControl() {
return new TransactionControlImpl();
public void start(BundleContext context) throws Exception {
Dictionary<String, Object> properties = getProperties();
logger.info("Registering a new Local TransactionControl service with properties {}", properties);
context.registerService(TransactionControl.class,
new TransactionControlImpl(), properties);
}

@Override
protected Dictionary<String, Object> getProperties() {
public void stop(BundleContext context) throws Exception { }

private Dictionary<String, Object> getProperties() {
Dictionary<String, Object> props = new Hashtable<>();
props.put("osgi.local.enabled", Boolean.TRUE);
props.put(Constants.SERVICE_DESCRIPTION, "The Apache Aries Transaction Control Service for Local Transactions");
props.put(Constants.SERVICE_VENDOR, "Apache Aries");
return props;
}
}
72 changes: 46 additions & 26 deletions tx-control/tx-control-service-xa/pom.xml
@@ -1,11 +1,12 @@
<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">
<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.apache.aries.tx-control</groupId>
<artifactId>tx-control</artifactId>
<version>0.0.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<parent>
<groupId>org.apache.aries.tx-control</groupId>
<artifactId>tx-control</artifactId>
<version>0.0.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.apache.aries.tx-control</groupId>
<artifactId>tx-control-service-xa</artifactId>
<packaging>bundle</packaging>
Expand Down Expand Up @@ -36,22 +37,18 @@
<aries.osgi.export.pkg>
org.osgi.service.transaction.control
</aries.osgi.export.pkg>
<!--
The JTA API package should be private as we don't share any of it, but we
Must take javax.transaction.xa from the outside
-->
<!-- The JTA API package should be private as we don't share any of it,
but we Must take javax.transaction.xa from the outside -->
<aries.osgi.private.pkg>
javax.resource.spi,
javax.transaction,
org.apache.aries.tx.control.service.common.*,
org.apache.aries.tx.control.service.xa.*,
org.apache.geronimo.transaction.*
org.apache.geronimo.transaction.*,
org.objectweb.howl.log.*
</aries.osgi.private.pkg>
<!--
No transaction log at the moment.
Also we must explicitly import javax.transaction.xa at zero so that we can pick it
up from the JRE.
-->
<!-- No transaction log at the moment. Also we must explicitly import javax.transaction.xa
at zero so that we can pick it up from the JRE. -->
<aries.osgi.import.pkg>
!javax.resource.*,
!org.objectweb.howl.*,
Expand Down Expand Up @@ -102,6 +99,23 @@
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.cm</artifactId>
<version>1.5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.metatype.annotations</artifactId>
<version>1.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.objectweb.howl</groupId>
<artifactId>howl</artifactId>
<version>1.0.1-1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -113,6 +127,12 @@
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.191</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -138,15 +158,15 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<instructions>
<Provide-Capability>osgi.service;objectClass="org.osgi.service.transaction.control.TransactionControl";osgi.local.enabled="true";osgi.xa.enabled="true";uses:="org.osgi.service.transaction.control"</Provide-Capability>
</instructions>
</configuration>
</plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<instructions>
<Provide-Capability>osgi.service;objectClass="org.osgi.service.transaction.control.TransactionControl";osgi.local.enabled="true";osgi.xa.enabled="true";uses:="org.osgi.service.transaction.control"</Provide-Capability>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 7f1e7ab

Please sign in to comment.