NO-JIRA: a few additions and tweaks around OSGI

This commit is contained in:
Clebert Suconic 2016-10-19 13:15:59 -04:00
parent b1804da00c
commit b7d79f328f
3 changed files with 23 additions and 14 deletions

View File

@ -93,9 +93,9 @@ public class ReloadManagerImpl extends ActiveMQScheduledComponent implements Rel
ReloadRegistry(URL uri) {
try {
file = new File(uri.toURI());
file = new File(uri.toURI());//"file:etc/artemis.xml"
} catch (Exception e) {
logger.warn(e.getMessage(), e);
logger.debug(e.getMessage(), e);
file = new File(uri.getPath());
}

View File

@ -6,18 +6,21 @@ Apache ActiveMQ Artemis is OSGi ready. Below you can find instruction on how to
Apache ActiveMQ Artemis provides features that makes it easy to install the broker on Apache Karaf (4.x or later). First you need to define the feature URL, like
karaf@root()> feature:repo-add mvn:org.apache.activemq/artemis-features/1.3.0-SNAPSHOT/xml/features
```sh
karaf@root()> feature:repo-add mvn:org.apache.activemq/artemis-features/1.3.0-SNAPSHOT/xml/features
```
This will add Artemis related features
karaf@root()> feature:list | grep artemis
artemis | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | Full ActiveMQ Artemis broker with default configuration
netty-core | 4.0.32.Final | | Uninstalled | artemis-1.3.0-SNAPSHOT | Netty libraries
artemis-core | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis broker libraries
artemis-amqp | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis AMQP protocol libraries
artemis-stomp | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis Stomp protocol libraries
artemis-mqtt | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis MQTT protocol libraries
artemis-hornetq | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis HornetQ protocol libraries
```
karaf@root()> feature:list | grep artemis
artemis | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | Full ActiveMQ Artemis broker with default configuration
netty-core | 4.0.32.Final | | Uninstalled | artemis-1.3.0-SNAPSHOT | Netty libraries
artemis-core | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis broker libraries
artemis-amqp | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis AMQP protocol libraries
artemis-stomp | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis Stomp protocol libraries
artemis-mqtt | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis MQTT protocol libraries
artemis-hornetq | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis HornetQ protocol libraries
```
Feature named `artemis` contains full broker installation, so running
@ -41,4 +44,4 @@ The broker is installed as `org.apache.activemq.artemis` OSGi component, so it's
| domain | JAAS domain to use for security | karaf |
| rolePrincipalClass | Class name used for role authorization purposes | org.apache.karaf.jaas.boot.principal.RolePrincipal |
The default broker configuration file is located in `${KARAF_BASE}/etc/artemis.xml`
The default broker configuration file is located in `${KARAF_BASE}/etc/artemis.xml`

View File

@ -64,7 +64,12 @@ import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfi
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
// uncomment this to be able to debug it
// import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration;
/**
* Useful docs about this test: https://ops4j1.jira.com/wiki/display/paxexam/FAQ
*/
@RunWith(PaxExam.class)
public class ArtemisFeatureTest extends Assert {
@ -102,7 +107,8 @@ public class ArtemisFeatureTest extends Assert {
Option[] options = new Option[]{karafDistributionConfiguration().frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").versionAsInProject()).unpackDirectory(new File("target/paxexam/unpack/")),
KarafDistributionOption.keepRuntimeFolder(), logLevel(LogLevelOption.LogLevel.INFO), editConfigurationFilePut("etc/config.properties", "karaf.startlevel.bundle", "50"),
//debugConfiguration("5005", true),
// uncomment this to debug it.
// debugConfiguration("5005", true),
features(getArtemisMQKarafFeatureUrl(), f.toArray(new String[f.size()]))};
return options;