Added: servicemix/site/production/docs/5.x/developers-guide/features-maven-plugin-validate.html URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/developers-guide/features-maven-plugin-validate.html?rev=1597958&view=auto ============================================================================== --- servicemix/site/production/docs/5.x/developers-guide/features-maven-plugin-validate.html (added) +++ servicemix/site/production/docs/5.x/developers-guide/features-maven-plugin-validate.html Wed May 28 09:56:27 2014 @@ -0,0 +1,108 @@ + + + + + Apache ServiceMix Documentation - + + + + + + + + + + + + +
+ +
+ +
+

Goal features:validate

The features:validate goal validates a features XML descriptor by checking if all the required imports for the bundles defined in the features can be matched to a provided export.

By default, the plugin tries to add the Karaf standard features (standard and enterprise) in the repositories set.
It means that it's not necessary to explicitly define the Karaf features descriptor in the repository section of your features descriptor.

Example

The example below validates the features defined in the target/features.xml by checking all the imports and exports. It reads the definition for the packages that are exported by the system bundle from the src/main/resources/config.properties file.

<project>
  <build>�
 0A;    <plugins>
      <plugin>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>features-maven-plugin</artifactId>
        <version>2.3.0</version>
          <executions>
            <execution>
              <id>validate</id>
              <phase>process-resources</phase>
              <goals>
                <goal>validate</goal>
              </goals>
 
              <configuration>
                <file>target/features.xml</file>
                <karafConfig>src/main/resources/config.properties</karafConfig>
              </configuration>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.slf4j</groupId>
              <artifactId>slf4j-simple</artifactId>
              <version>1.4.3</version>
	        
 </dependency>
          </dependencies>
        </plugin>
    </plugins>
  </build>  
</project>

Parameters

Name Type Description
file File The features XML descriptor file to validate.
Default value: /x1/asf/karaf-2.3.x/target/checkout/manual/target/classes/features.xml
karafConfig String The Karaf config.properties< /tt> file to use during the validation process
Default value: config.properties
jreVersion String The JRE version that is used during the validation process
Default value: {{jre-1.5})
karafVersion String The target Karaf version used to get the Karaf core features (standard and enterprise)
Default value is the version of the plugin
repositories String[] Additional features XML descriptors that will be used during the validation process
+
+ +
+ +
+ + \ No newline at end of file Added: servicemix/site/production/docs/5.x/developers-guide/features-maven-plugin.html URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/developers-guide/features-maven-plugin.html?rev=1597958&view=auto ============================================================================== --- servicemix/site/production/docs/5.x/developers-guide/features-maven-plugin.html (added) +++ servicemix/site/production/docs/5.x/developers-guide/features-maven-plugin.html Wed May 28 09:56:27 2014 @@ -0,0 +1,108 @@ + + + + + Apache ServiceMix Documentation - + + + + + + + + + + + + +
+ +
+ +
+

Using the features-maven-plugin

The features-maven-plugin provides several goals to help you create and validate features XML descriptors as well as leverage your features to create a custom Karaf distribution.

Goal Description
features:add-features-to-repo Copies all the bundles required for a given set of features into a directory
(e.g. for creating your own Karaf-based distribution)
features:generate-features-file Deprecated - use features:generate-features-xml instead
features:generate-features-xml Generates a features XML descriptor for a set of bundles
features:validate Validate a features XML descriptor by checking if all the required imports can be matched to exports
{{features:create-kar

Configure the features-maven-plugin

In order to use the features-maven-plugin, you have to define the plugin in your project's pom.xml file:

<project>
  <build>
    <plugins>
      <plugin>
        
 <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>features-maven-plugin</artifactId>
        <version>2.3.0</version>

        <executions>
          <!-- add execution definitions here -->
        </executions>
      </plugin>
    </plugins>
  </build>  
</project>
+
+ +
+ +
+ + \ No newline at end of file Added: servicemix/site/production/docs/5.x/developers-guide/github-contributions.html URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/developers-guide/github-contributions.html?rev=1597958&view=auto ============================================================================== --- servicemix/site/production/docs/5.x/developers-guide/github-contributions.html (added) +++ servicemix/site/production/docs/5.x/developers-guide/github-contributions.html Wed May 28 09:56:27 2014 @@ -0,0 +1,142 @@ + + + + + Apache ServiceMix Documentation - + + + + + + + + + + + + +
+ +
+ +
+

Github Contributions

Some people prefer to make contributions to karaf source via github. If you are one of them, this is for you!

Introduction

Apache Karaf is available as a periodically replicated mirror on: https://github.com/apache/karaf

Suggested Workflow

  1. make a fork of karaf repo github mirror

  2. do all your new work on your own karaf fork

  3. when ready, file a jira issue https://issues.apache.org/jira/browse/KARAF, attach the link to your github pull request, and ask for a review

  4. one of karaf committers will discuss your pull request on github; and at some point your pull request will be accepted

  5. when your pull request is accepted, squash it into a single commit and attach singl e patch file to the original jira, with ASF grant check box selected

  6. now pray to your favorite ASF committer to really accept the patch :-)

  7. when your patch is committed to the svn, and you can verify it in the latest karaf snapshot, close your pull request on github

License Reminder

in order for your contributions to be accepted:

  • all files must contain ASL license grant header

  • you must select ASF grant check box when attaching patch to the jira

How to Generate a One-File-Patch Via Throw-Away Branch

here is one way to generate squash of your commits:

http://stackoverflow.com/questions/616556/how-do-you-squash-commits-into-one-patch-with-git-format-patch

+
+#
+# 'archon' referers to karaf mirror
+# 'origin' referers to your own fork
+#
+
+# attach karaf mirror as remote, if not done yet
+git remote add archon https://github.com/apache/karaf
+
+# fetch latest karaf mirror
+git fetch archon 
+
+# ensure you are on your fork trunk
+git checkout origin/trunk
+
+# kill previous patch delivery, if you had one
+git branch -D delivery
+
+# make new delivery throw-away branch, based on latest karaf mirror
+git branch delivery archon/trunk
+
+# use it
+git checkout delivery
+
+# squash all your local development into a single commit
+git merge --squash trunk
+
+# commit it to the delivery branch
+git commit -m "delivery"
+
+# generate a patch file against the mirror
+git format-patch archon/trunk
+
+

root of your karaf source now contains a file named "0001-delivery.patch.txt" (please attach the .txt ending;this will allow commiters to open your patch directly in the browser and give it a short look there) which you should attach to your karaf jira, and ask to commit to the svn trunk

+
+ +
+ +
+ + \ No newline at end of file Added: servicemix/site/production/docs/5.x/developers-guide/index.html URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/developers-guide/index.html?rev=1597958&view=auto ============================================================================== --- servicemix/site/production/docs/5.x/developers-guide/index.html (added) +++ servicemix/site/production/docs/5.x/developers-guide/index.html Wed May 28 09:56:27 2014 @@ -0,0 +1,108 @@ + + + + + Apache ServiceMix Documentation - + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + \ No newline at end of file Added: servicemix/site/production/docs/5.x/developers-guide/shell-syntax.html URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/developers-guide/shell-syntax.html?rev=1597958&view=auto ============================================================================== --- servicemix/site/production/docs/5.x/developers-guide/shell-syntax.html (added) +++ servicemix/site/production/docs/5.x/developers-guide/shell-syntax.html Wed May 28 09:56:27 2014 @@ -0,0 +1,187 @@ + + + + + Apache ServiceMix Documentation - + + + + + + + + + + + + +
+ +
+ +
+

Shell syntax

Easy to use interactively - no unnecessary syntax

+// simple command
+karaf@root> echo hello world
+hello world
+
+// session variables
+karaf@root> msg = "hello world"
+hello world
+karaf@root> echo $msg
+hello world
+
+// execution quotes () - similar to bash backquotes
+karaf@root> (bundle 1) location
+mvn:org.ops4j.pax.url/pax-url-mvn/1.1.3
+

List, maps, pipes and closures

+// lists - []
+karaf@root> list = [1 2 a b]
+1
+2
+a
+b
+
+karaf@root> map = [Jan=1 Feb=2 Mar=3]
+Jan                 1
+Feb                 2
+Mar                 3
+
+// pipes
+karaf@root> bundles | grep felix
+000000 ACT org.apache.felix.framework-3.0.2
+000005 ACT org.apache.felix.configadmin-1.2.4
+000006 ACT org.apache.felix.fileinstall-3.0.2
+
+// closures - {}
+karaf@root> echo2 = { echo xxx $args yyy }
+org.apache.felix.gogo.runtime.shell.Closure@2ffb36c2
+karaf@root> echo2 hello world
+xxx hello world yyy
+

Leverages existing Java capabilities, via reflection

+// exception handling - console shows summary, but full context available
+karaf@root> start xxx
+Error executing command osgi:start: unable to convert argument ids with value '[xxx]' to type java.util.List<java.lang.Long>
+karaf@root> $karaf.lastException printStackTrace
+org.apache.felix.gogo.commands.CommandException: Unable to convert argument ids with value '[xxx]' to type java.util.List<java.lang.Long>
+	at org.apache.felix.gogo.commands.basic.DefaultActionPreparator.prepare(DefaultActionPreparator.java:347)
+	at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:34)
+	at org.apache.felix.gogo.runtime.shell.CommandProxy.execute(CommandProxy.java:50)
+	at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:229)
+	at org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:162)
+	at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:101)
+	at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:79)
+	at org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71)
+	at org.apache.karaf.shell.console.jline.Console.run(Console.java:169)
+	at java.lang.Thread.run(Thread.java:637)
+Caused by: java.lang.Exception: Unable to convert from [xxx] to java.util.List<java.lang.Long>(error converting collection entry)
+	at org.apache.aries.blueprint.container.AggregateConverter.convertToCollection(AggregateConverter.java:318)
+	at org.apache.aries.blueprint.container.AggregateConverter.convert(AggregateConverter.java:159)
+	at org.apache.karaf.shell.console.commands.BlueprintCommand$BlueprintActionPreparator.convert(BlueprintCommand.java:73)
+	at org.apache.felix.gogo.commands.basic.DefaultActionPreparator.prepare(DefaultActionPreparator.java:344)
+	... 9 more
+Caused by: java.lang.NumberFormatException: For input string: "xxx"
+	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
+	at java.lang.Long.parseLong(Long.java:410)
+	at java.lang.Long.valueOf(Long.java:525)
+	at org.apache.aries.blueprint.container.AggregateConverter.convertFromString(AggregateConverter.java:261)
+	at org.apache.aries.blueprint.container.AggregateConverter.convert(AggregateConverter.java:151)
+	at org.apache.aries.blueprint.container.AggregateConverter.convertToCollection(AggregateConverter.java:316)
+	... 12 more
+
+// add all public methods on java.lang.System as commands:
+karaf@root> addcommand system (loadClass java.lang.System)
+karaf@root> system:getproperty karaf.name
+root
+
+// create new objects
+karaf@root> map = (new java.util.HashMap)
+karaf@root> $map put 0 0
+karaf@root> $map
+0                   0
+
+
+ +
+ +
+ + \ No newline at end of file Added: servicemix/site/production/docs/5.x/developers-guide/toc.html URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/developers-guide/toc.html?rev=1597958&view=auto ============================================================================== --- servicemix/site/production/docs/5.x/developers-guide/toc.html (added) +++ servicemix/site/production/docs/5.x/developers-guide/toc.html Wed May 28 09:56:27 2014 @@ -0,0 +1,132 @@ + + + + + Apache ServiceMix Documentation - + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + \ No newline at end of file Added: servicemix/site/production/docs/5.x/developers-guide/writing-tests.html URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/developers-guide/writing-tests.html?rev=1597958&view=auto ============================================================================== --- servicemix/site/production/docs/5.x/developers-guide/writing-tests.html (added) +++ servicemix/site/production/docs/5.x/developers-guide/writing-tests.html Wed May 28 09:56:27 2014 @@ -0,0 +1,108 @@ + + + + + Apache ServiceMix Documentation - + + + + + + + + + + + + +
+ +
+ +
+

Writing integration tests

We recommend using PAX Exam to write integration tests when developing
applications using Karaf.

Karaf provides an helper library to help writing such integration tests.

   @Configuration
   public static Option[] configuration() throws Exception{
       return combine(
           // Default karaf environment
           Helper.getDefaultOptions<
 span class="o">(),
           // Test on both equinox and felix
           equinox(), felix()
       );
   }

If you need to provision a few features in addition to the default Karaf environment, you can do so by adding the following code:

           scanFeatures(
                  maven().groupId("org.apache.felix.karaf")
                         .artifactId("apache-felix-karaf")
                         .type("xml").classifier("features")
                         .versionAsInProject(),
                  "obr", "wrapper"
           ),
+
+ +
+ +
+ + \ No newline at end of file Added: servicemix/site/production/docs/5.x/images/ASF-logo.png URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/images/ASF-logo.png?rev=1597958&view=auto ============================================================================== Binary file - no diff available. Propchange: servicemix/site/production/docs/5.x/images/ASF-logo.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: servicemix/site/production/docs/5.x/images/logodesign.png URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/images/logodesign.png?rev=1597958&view=auto ============================================================================== Binary file - no diff available. Propchange: servicemix/site/production/docs/5.x/images/logodesign.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: servicemix/site/production/docs/5.x/images/new-logo.png URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/images/new-logo.png?rev=1597958&view=auto ============================================================================== Binary file - no diff available. Propchange: servicemix/site/production/docs/5.x/images/new-logo.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: servicemix/site/production/docs/5.x/images/samplelog.png URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/images/samplelog.png?rev=1597958&view=auto ============================================================================== Binary file - no diff available. Propchange: servicemix/site/production/docs/5.x/images/samplelog.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: servicemix/site/production/docs/5.x/images/samplelogactivemq.png URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/images/samplelogactivemq.png?rev=1597958&view=auto ============================================================================== Binary file - no diff available. Propchange: servicemix/site/production/docs/5.x/images/samplelogactivemq.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: servicemix/site/production/docs/5.x/images/smx-overview.dia URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/images/smx-overview.dia?rev=1597958&view=auto ============================================================================== Binary file - no diff available. Propchange: servicemix/site/production/docs/5.x/images/smx-overview.dia ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: servicemix/site/production/docs/5.x/images/smx-overview.png URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/images/smx-overview.png?rev=1597958&view=auto ============================================================================== Binary file - no diff available. Propchange: servicemix/site/production/docs/5.x/images/smx-overview.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: servicemix/site/production/docs/5.x/images/smx4-start.gif URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/images/smx4-start.gif?rev=1597958&view=auto ============================================================================== Binary file - no diff available. Propchange: servicemix/site/production/docs/5.x/images/smx4-start.gif ------------------------------------------------------------------------------ svn:mime-type = image/gif Added: servicemix/site/production/docs/5.x/index.html URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/index.html?rev=1597958&view=auto ============================================================================== --- servicemix/site/production/docs/5.x/index.html (added) +++ servicemix/site/production/docs/5.x/index.html Wed May 28 09:56:27 2014 @@ -0,0 +1,182 @@ + + + + + Apache ServiceMix Documentation - Home + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+

If you're new to Apache ServiceMix, this document will guide you in your first steps in Apache ServiceMix.

+ +
+ + + +
+

Apache ServiceMix contains a lot of different components and it embeds a lot of other Apache projects. This user guide will help you select and configure the right components when building your own solution.

+
+ + + + +
+

Apache ServiceMix embeds Apache ActiveMQ to provide a JMS message broker that you can interact with from your Camel routes, providing support for message persistence, clustering, failover, ...

+
+ + + +
+

Apache Camel is a core component of Apache ServiceMix. This guide will show you how to build and deploy Camel routes for Apache ServiceMix.

+ +
+ + + +
+

Apache ServiceMix embeds Activiti to provide a light-weight workflow and Business Process Management (BPM) Platform targeted at business people, developers and system admins, ...

+
+ + + +
+

Help pages for all the available commands in the Apache ServiceMix console.

+
+ + + +
+

Apache ServiceMix uses Apache Karaf as the underlying OSGi server runtime. This manual explains about the features and functionality provided by Karaf.

+
+ + + +
+

The Apache Karaf Developer Guide gives you some information about developing with and for the OSGi server runtime.

+
+ + + + +
+

Documentation from commercial providers and books you can buy.

+
+
+ +
+ +
+ +
+ + \ No newline at end of file Added: servicemix/site/production/docs/5.x/karaf/index.html URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/karaf/index.html?rev=1597958&view=auto ============================================================================== --- servicemix/site/production/docs/5.x/karaf/index.html (added) +++ servicemix/site/production/docs/5.x/karaf/index.html Wed May 28 09:56:27 2014 @@ -0,0 +1,156 @@ + + + + + Apache ServiceMix Documentation - + + + + + + + + + + + + +
+ +
+ +
+

ServiceMix 5.0.1 Documentation

ServiceMix 5.0.1 uses Apache Karaf.

+
+ +
+ +
+ + \ No newline at end of file Added: servicemix/site/production/docs/5.x/karaf/toc.html URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/karaf/toc.html?rev=1597958&view=auto ============================================================================== --- servicemix/site/production/docs/5.x/karaf/toc.html (added) +++ servicemix/site/production/docs/5.x/karaf/toc.html Wed May 28 09:56:27 2014 @@ -0,0 +1,228 @@ + + + + + Apache ServiceMix Documentation - + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + \ No newline at end of file Added: servicemix/site/production/docs/5.x/quickstart/activemq.html URL: http://svn.apache.org/viewvc/servicemix/site/production/docs/5.x/quickstart/activemq.html?rev=1597958&view=auto ============================================================================== --- servicemix/site/production/docs/5.x/quickstart/activemq.html (added) +++ servicemix/site/production/docs/5.x/quickstart/activemq.html Wed May 28 09:56:27 2014 @@ -0,0 +1,103 @@ + + + + + Apache ServiceMix Documentation - + + + + + + + + + + + + +
+ +
+ +
+

Adding ActiveMQ to the 'Mix

Out-of-the-box, every Apache ServiceMix instance comes with an embedded ActiveMQ JMS broker. This makes it easy to communicate between Camel routes using persistent messages on the same machine, but it will also enable you to distribute your routes over multiple instances afterwards for clustering or load-balancing.

Our scenario

In this scenario, we also want to move files between directories. Instead of logging the move directly, we are going to send an event JMS message onto a queue. Afterwards, we will create a second Camel route to receive the events and log them.

Moving files and sending event messages

The first Blueprint XML file we'll create contains a Camel route that moves the files from activemq/input to the activemq/output directory. Afterwards, it will generate an event message and send that to an ActiveMQ queue called events.

<?xml version="1.0" encoding="UTF-8"?>
<blueprint
    xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
      http://www.osgi.org/xmlns/blueprint/v1.0.0
      http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route>
        <from uri="file:activemq/input"/>
        <to uri="file:activemq/output"/>

        <setBody>
          <simple>
            FileMovedEvent(file: ${file:name}, timestamp: ${date:now:hh:MM:ss.SSS})
          </simple>
        </setBody>
        <to uri="activemq://events" />
      </route>
    </camelContext>
</blueprint>
<
 /pre>

Save this file in ServiceMix' deploy folder and use osgi:list to check on the bundle status as you did with the simple Camel example. You should now be able to put files in the activemq/input directory and see them being moved to activemq/output.

Receiving the event messages

After deploying the first XML file, you're obviously not seeing any events being logged yet. The event messages are sent to an ActiveMQ queue, but there's nobody to receive the events yet. Let's change that now by creating a second Blueprint XML file.

<?xml version="1.0" encoding="UTF-8"?>
<blueprint
    xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
      http://www.osgi.org/xmlns/blueprint/v1.0.0
      http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route>
        <from uri="activemq://events"/>
        <to uri="log:events"/>
      </route>
    </c
 amelContext>
</blueprint>

As soon as this second file has been deployed, you'll start seeing the event messages in your log:display output.

Using the shell to manage the routes

You can now start and stop both routes from the command shell. The important thing to note here is that you can stop the event handler route while files are being processed. As soon as you restart that bundle afterwards, you'll receive the events from all files that have been moved while the route was not running.

+
+ +
+ +
+ + \ No newline at end of file