You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2015/01/20 16:00:50 UTC

karaf git commit: [KARAF-3453] Add jolokia feature and update documentation

Repository: karaf
Updated Branches:
  refs/heads/master 23346643c -> cf654b1d4


[KARAF-3453] Add jolokia feature and update documentation


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/cf654b1d
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/cf654b1d
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/cf654b1d

Branch: refs/heads/master
Commit: cf654b1d4af2a9b14f7d95145652290fb7b904ad
Parents: 2334664
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Tue Jan 20 16:00:15 2015 +0100
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Tue Jan 20 16:00:15 2015 +0100

----------------------------------------------------------------------
 .../standard/src/main/feature/feature.xml         | 12 ++++++++++--
 .../itests/features/StandardFeaturesTest.java     |  5 +++++
 .../src/main/webapp/users-guide/monitoring.conf   | 18 +++++++-----------
 pom.xml                                           |  1 +
 4 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/cf654b1d/assemblies/features/standard/src/main/feature/feature.xml
----------------------------------------------------------------------
diff --git a/assemblies/features/standard/src/main/feature/feature.xml b/assemblies/features/standard/src/main/feature/feature.xml
index f05172f..c581915 100644
--- a/assemblies/features/standard/src/main/feature/feature.xml
+++ b/assemblies/features/standard/src/main/feature/feature.xml
@@ -126,8 +126,6 @@
         </conditional>
     </feature>
 
-    <!-- NB: this file is not the one really used. This file is used by the karaf-maven-plugin to define the start-level of bundles in the generated feature.xml -->
-
     <feature name="wrapper" description="Provide OS integration" version="${project.version}">
         <bundle start-level="30">mvn:org.apache.karaf.wrapper/org.apache.karaf.wrapper.core/${project.version}</bundle>
     </feature>
@@ -553,4 +551,14 @@
         <bundle>mvn:org.apache.karaf.profile/org.apache.karaf.profile.core/${project.version}</bundle>
     </feature>
 
+    <feature name="jolokia" description="Jolokia monitoring support" version="${jolokia.version}">
+        <feature>http</feature>
+        <config name="org.jolokia.osgi">
+            org.jolokia.user=karaf
+            org.jolokia.realm=karaf
+            org.jolokia.authMode=jaas
+        </config>
+        <bundle>mvn:org.jolokia/jolokia-osgi/${jolokia.version}</bundle>
+    </feature>
+
 </features>

http://git-wip-us.apache.org/repos/asf/karaf/blob/cf654b1d/itests/src/test/java/org/apache/karaf/itests/features/StandardFeaturesTest.java
----------------------------------------------------------------------
diff --git a/itests/src/test/java/org/apache/karaf/itests/features/StandardFeaturesTest.java b/itests/src/test/java/org/apache/karaf/itests/features/StandardFeaturesTest.java
index 97031db..4278e0b 100644
--- a/itests/src/test/java/org/apache/karaf/itests/features/StandardFeaturesTest.java
+++ b/itests/src/test/java/org/apache/karaf/itests/features/StandardFeaturesTest.java
@@ -131,4 +131,9 @@ public class StandardFeaturesTest extends KarafTestSupport {
         installAssertAndUninstallFeatures("scr");
     }
 
+    @Test
+    public void installJolokiaFeature() throws Exception {
+        installAssertAndUninstallFeatures("jolokia");
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/cf654b1d/manual/src/main/webapp/users-guide/monitoring.conf
----------------------------------------------------------------------
diff --git a/manual/src/main/webapp/users-guide/monitoring.conf b/manual/src/main/webapp/users-guide/monitoring.conf
index 01d2a8e..d44b3da 100644
--- a/manual/src/main/webapp/users-guide/monitoring.conf
+++ b/manual/src/main/webapp/users-guide/monitoring.conf
@@ -219,16 +219,10 @@ More over, you may want to write your own application/web application. In that c
 
 [Jolokia|http://www.jolokia.org/] can be installed in Apache Karaf as a remote JMX-HTTP bridge.
 
-First, you have to install the {{http}} feature:
+Karaf provides a jolokia feature, ready to install:
 
 {code}
-karaf@root()> feature:install http
-{code}
-
-Now, you can install directly the Jolokia bundle:
-
-{code}
-karaf@root()> bundle:install -s mvn:org.jolokia/jolokia-osgi/1.1.5
+karaf@root()> feature:install jolokia
 {code}
 
 By default, Jolokia is listening on the port {{8181}} (see the [WebContainer (JSP/Servlet)|webcontainer] page for details about the HTTP configuration).
@@ -236,7 +230,7 @@ By default, Jolokia is listening on the port {{8181}} (see the [WebContainer (JS
 If you point a browser on [http://localhost:8181/jolokia] you will see a JSON output like:
 
 {code}
-{"timestamp":1387552680,"status":200,"request":{"type":"version"},"value":{"protocol":"7.0","agent":"1.1.5","info":{"product":"felix","vendor":"Apache","version":"4.2.1"}}}
+{"timestamp":1421765829,"status":200,"request":{"type":"version"},"value":{"protocol":"7.2","config":{"useRestrictorService":"false","canonicalNaming":"true","includeStackTrace":"true","listenForHttpService":"true","historyMaxEntries":"10","agentId":"192.168.134.10-5922-6eb8d517-osgi","debug":"false","realm":"karaf","serializeException":"false","agentContext":"\/jolokia","agentType":"servlet","policyLocation":"classpath:\/jolokia-access.xml","user":"karaf","debugMaxEntries":"100","authMode":"jaas","mimeType":"text\/plain"},"agent":"1.2.4-SNAPSHOT","info":{"product":"felix","vendor":"Apache","version":"4.4.1"}}}
 {code}
 
 You can manipulate the Apache Karaf JMX layer via HTTP and JSON, via system tools (like {{curl}}, {{jmx4perl}}, monitoring tools (supporting HTTP/JSON), or web applications.
@@ -257,7 +251,9 @@ The format of the request is:
 We can send this JSON request using {{curl}} and get the result:
 
 {code}
-curl -d "{\"type\":\"read\",\"mbean\":\"java.lang:type=Memory\",\"attribute\":\"HeapMemoryUsage\",\"path\":\"used\"}" http://localhost:8080/jolokia/ && echo ""
+curl -u karaf -d "{\"type\":\"read\",\"mbean\":\"java.lang:type=Memory\",\"attribute\":\"HeapMemoryUsage\",\"path\":\"used\"}" http://localhost:8181/jolokia/ && echo ""
+Enter host password for user 'karaf':
+{"timestamp":1421765948,"status":200,"request":{"mbean":"java.lang:type=Memory","path":"used","attribute":"HeapMemoryUsage","type":"read"},"value":69121000}
 {code}
 
-You can find details on the [Jolokia website|http://www.jolokia.org] and in the [documentation|http://www.jolokia.org/reference/html/].
\ No newline at end of file
+You can find details on the [Jolokia website|http://www.jolokia.org] and in the [documentation|http://www.jolokia.org/reference/html/].

http://git-wip-us.apache.org/repos/asf/karaf/blob/cf654b1d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7196a7d..442d5b4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -142,6 +142,7 @@
         <commons-pool.version>1.6</commons-pool.version>
         <dom4j.bundle.version>1.6.1_5</dom4j.bundle.version>
         <jasypt.bundle.version>1.9.2_1</jasypt.bundle.version>
+        <jolokia.version>1.2.4-SNAPSHOT</jolokia.version>
         <serp.bundle.version>1.14.1_1</serp.bundle.version>
         <servlet.spec.groupId>org.apache.geronimo.specs</servlet.spec.groupId>
         <servlet.spec.artifactId>geronimo-servlet_3.0_spec</servlet.spec.artifactId>