You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2015/08/24 18:22:29 UTC

[2/3] incubator-tamaya git commit: Replaced the name 'are' with 'section'. Implemented management JMX extension for Tamaya incl a minimal test bed.

Replaced the name 'are' with 'section'.
Implemented management JMX extension for Tamaya incl a minimal test bed.


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

Branch: refs/heads/master
Commit: a88f52fc19b9c76d8d81f2d788b61b0826b18016
Parents: 689aeaf
Author: anatole <an...@apache.org>
Authored: Mon Aug 24 18:15:29 2015 +0200
Committer: anatole <an...@apache.org>
Committed: Mon Aug 24 18:15:29 2015 +0200

----------------------------------------------------------------------
 docs/src/main/asciidoc/mod_functions.adoc  |   9 +-
 docs/src/main/asciidoc/mod_management.adoc | 127 ++++++++++++++++++++++++
 2 files changed, 132 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a88f52fc/docs/src/main/asciidoc/mod_functions.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/mod_functions.adoc b/docs/src/main/asciidoc/mod_functions.adoc
index 9031940..f80cd4e 100644
--- a/docs/src/main/asciidoc/mod_functions.adoc
+++ b/docs/src/main/asciidoc/mod_functions.adoc
@@ -1,7 +1,7 @@
-= Apache Tamaya -- Extension: Formats
+= Apache Tamaya -- Extension: Functions
 
 :name: Tamaya
-:rootpackage: org.apache.tamaya.ext.formats
+:rootpackage: org.apache.tamaya.functions
 :title: Apache Tamaya Extension: Functions
 :revnumber: 0.1.1
 :revremark: Incubator
@@ -58,7 +58,8 @@ import static org.apache.tamaya.functions.ConfigurationFunctions.*;
 Set<String> sections = ConfigurationProvider.getConfiguration().with(areas("a", false).with(transitiveAreas());
 -------------------------------------------------------------------
 
-The expression above returns all section that are child sections of the root section 'a'.
+The expression above returns all fully qualified section names that are child sections of the root section 'a'.
+So given the entries +a.b.entry1, a.b.entry2, a.a.entry3, a.b.c.entry4+ the reult would be +a, a.a, a.b, a.b.c+.
 
 === Compatibility
 
@@ -66,7 +67,7 @@ The module is based on Java 7, so it can be used with Java 7 and beyond.
 
 === Installation
 
-To benefit from dynamic value resolution you only must add the corresponding dependency to your module:
+For using the functionality shown in this document you only must add the corresponding dependency to your module:
 
 [source, xml]
 -----------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/a88f52fc/docs/src/main/asciidoc/mod_management.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/mod_management.adoc b/docs/src/main/asciidoc/mod_management.adoc
new file mode 100644
index 0000000..96b03d4
--- /dev/null
+++ b/docs/src/main/asciidoc/mod_management.adoc
@@ -0,0 +1,127 @@
+= Apache Tamaya -- Extension: JMX Management Access
+
+:name: Tamaya
+:rootpackage: org.apache.tamaya.management
+:title: Apache Tamaya Extension: JMX Management Access
+:revnumber: 0.1
+:revremark: Incubator
+:revdate: August 2015
+:longversion: {revnumber} ({revremark}) {revdate}
+:authorinitials: ATR
+:author: Anatole Tresch
+:email: <an...@apache.org>
+:source-highlighter: coderay
+:website: http://tamaya.incubator.apache.org/
+:toc:
+:toc-placement: manual
+:encoding: UTF-8
+:numbered:
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+'''
+
+<<<
+
+toc::[]
+
+<<<
+:numbered!:
+<<<
+[[ExtModel]]
+== Tamaya Management (JMX Support) (Extension Module)
+=== Overview
+
+The Tamaya management module provides support for registering a JMX management bean for accessing configuration.
+
+=== Compatibility
+
+The module is based on Java 7, so it will not run on Java 7 and beyond.
+
+
+=== Installation
+
+To benefit from configuration builder support you only must add the corresponding dependency to your module:
+
+[source, xml]
+-----------------------------------------------
+<dependency>
+  <groupId>org.apache.tamaya.ext</groupId>
+  <artifactId>tamaya-management</artifactId>
+  <version>{tamayaVersion}</version>
+</dependency>
+-----------------------------------------------
+
+
+=== The ManagedConfigMBean bean
+
+The management model defines the MBean of type +ManagedConfigMBean+ as follows:
+
+
+[source,java]
+-----------------------------------------------------------------------------
+public interface ManagedConfigMBean {
+    String getJsonConfigurationInfo();
+    String getXmlConfigurationInfo();
+    Map<String, String> getConfiguration();
+    Map<String, String> getSection(String area, boolean recursive);
+    Set<String> getSections();
+    Set<String> getTransitiveSections();
+    boolean isSectionExisting(String area);
+    default boolean isSectionEmpty(String area);
+}
+-----------------------------------------------------------------------------
+
+* +getJsonConfigurationInfo,getXmlConfigurationInfo+ return a JSON or XML representation of the
+current configuration.
+* +getConfiguration+ access the current configuration properties.
+* +getSection+ allows to extract all entries below a certain subkey. With _recursive_ the query
+  will not only return direct children, but also recursively walk down all subsection of the
+  given section key.
+* +getSections+ returns all current known section names.
+* +getTransitiveSections+ return all sections, but also adds all transitive subsection as single
+  entries to the set as well.
+* +isSectionExisting+ and +isSectionEmpty+ allow for quering if entries are present under the given
+  section keys.
+
+=== Registering the ManagedConfigMBean
+
+For registering the current +ManagedConfigMBean+ instance to the current MBean platform server, the
+following static methods are available:
+
+[source,java]
+-----------------------------------------------------------------------------
+public final class ConfigManagementSupport{
+
+    private JMXSupport(){}
+
+    public static ObjectName registerMBean();
+    public static ObjectName registerMBean(String context);
+    public static ObjectName unregisterMBean();
+    public static ObjectName unregisterMBean(String context);
+}
+-----------------------------------------------------------------------------
+
+* +registerMBean+ creates a new +ManagedConfigMBean+ instance using the +ServiceContextManager+
+  and registers it. Optionally an additional _context_ parameter can be passed, which allows
+  to register the management bean for different classloaders, e.g. for different
+  ears.
+* +unregisterMBean+ does the oppsite than registering obviously.
+
+NOTE: The instance of +ManagedConfigMBean+ to be created and registered is evaluated by use og the
+      +ServiceContextManager+. So you can replace the bean implementation by registering your
+      overriding implementation using the current +ServiceContext+ (by default using
+      +java.util.ServiceLoader+ and +@Priority+ annotation.
\ No newline at end of file