You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2017/12/18 09:36:13 UTC

[karaf] branch master updated (55cd7c0 -> 373ee03)

This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git.


    from 55cd7c0  [KARAF-5546]incorrect acl rules for system:start-level
     new be78568  [KARAF-5547] Blueprint namespace handlers cause warning to be printed
     new 373ee03  [KARAF-5548] Improve the find-class command to support package names

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/karaf/bundle/command/FindClass.java  | 16 ++++++++++++++--
 .../jaas/blueprint/config/impl/NamespaceHandler.java     | 11 +++++++----
 .../jaas/blueprint/jasypt/handler/NamespaceHandler.java  |  9 +++++++--
 3 files changed, 28 insertions(+), 8 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@karaf.apache.org" <co...@karaf.apache.org>'].

[karaf] 01/02: [KARAF-5547] Blueprint namespace handlers cause warning to be printed

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git

commit be7856896c5df8b6975e0d78edbf71424277b1b2
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon Dec 18 09:16:56 2017 +0100

    [KARAF-5547] Blueprint namespace handlers cause warning to be printed
---
 .../karaf/jaas/blueprint/config/impl/NamespaceHandler.java    | 11 +++++++----
 .../karaf/jaas/blueprint/jasypt/handler/NamespaceHandler.java |  9 +++++++--
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/jaas/blueprint/config/src/main/java/org/apache/karaf/jaas/blueprint/config/impl/NamespaceHandler.java b/jaas/blueprint/config/src/main/java/org/apache/karaf/jaas/blueprint/config/impl/NamespaceHandler.java
index 1352bbc..4f21d99 100644
--- a/jaas/blueprint/config/src/main/java/org/apache/karaf/jaas/blueprint/config/impl/NamespaceHandler.java
+++ b/jaas/blueprint/config/src/main/java/org/apache/karaf/jaas/blueprint/config/impl/NamespaceHandler.java
@@ -48,10 +48,13 @@ import org.w3c.dom.NodeList;
 public class NamespaceHandler implements org.apache.aries.blueprint.NamespaceHandler {
 
     public URL getSchemaLocation(String namespace) {
-        if ("http://karaf.apache.org/xmlns/jaas/v1.0.0".equals(namespace)) {
-            return getClass().getResource("/org/apache/karaf/jaas/blueprint/config/karaf-jaas-1.0.0.xsd");
-        } else {
-            return getClass().getResource("/org/apache/karaf/jaas/blueprint/config/karaf-jaas-1.1.0.xsd");
+        switch (namespace) {
+            case "http://karaf.apache.org/xmlns/jaas/v1.0.0":
+                return getClass().getResource("/org/apache/karaf/jaas/blueprint/config/karaf-jaas-1.0.0.xsd");
+            case "http://karaf.apache.org/xmlns/jaas/v1.1.0":
+                return getClass().getResource("/org/apache/karaf/jaas/blueprint/config/karaf-jaas-1.1.0.xsd");
+            default:
+                return null;
         }
     }
 
diff --git a/jaas/blueprint/jasypt/src/main/java/org/apache/karaf/jaas/blueprint/jasypt/handler/NamespaceHandler.java b/jaas/blueprint/jasypt/src/main/java/org/apache/karaf/jaas/blueprint/jasypt/handler/NamespaceHandler.java
index 9b4fdbb..894d358 100644
--- a/jaas/blueprint/jasypt/src/main/java/org/apache/karaf/jaas/blueprint/jasypt/handler/NamespaceHandler.java
+++ b/jaas/blueprint/jasypt/src/main/java/org/apache/karaf/jaas/blueprint/jasypt/handler/NamespaceHandler.java
@@ -52,8 +52,13 @@ public class NamespaceHandler implements org.apache.aries.blueprint.NamespaceHan
 
     private int idCounter;
 
-    public URL getSchemaLocation(String s) {
-        return getClass().getResource("/org/apache/karaf/jaas/blueprint/jasypt/handler/karaf-jasypt-1.0.0.xsd");
+    public URL getSchemaLocation(String namespace) {
+        switch (namespace) {
+            case "http://karaf.apache.org/xmlns/jasypt/v1.0.0":
+                return getClass().getResource("/org/apache/karaf/jaas/blueprint/jasypt/handler/karaf-jasypt-1.0.0.xsd");
+            default:
+                return null;
+        }
     }
 
     public Set<Class> getManagedClasses() {

-- 
To stop receiving notification emails like this one, please contact
"commits@karaf.apache.org" <co...@karaf.apache.org>.

[karaf] 02/02: [KARAF-5548] Improve the find-class command to support package names

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git

commit 373ee033a5dceee604cca5f4b3ff7a7c6a5c52f7
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon Dec 18 09:17:48 2017 +0100

    [KARAF-5548] Improve the find-class command to support package names
---
 .../java/org/apache/karaf/bundle/command/FindClass.java  | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/bundle/core/src/main/java/org/apache/karaf/bundle/command/FindClass.java b/bundle/core/src/main/java/org/apache/karaf/bundle/command/FindClass.java
index 4a9fc75..bcb8c14 100644
--- a/bundle/core/src/main/java/org/apache/karaf/bundle/command/FindClass.java
+++ b/bundle/core/src/main/java/org/apache/karaf/bundle/command/FindClass.java
@@ -47,11 +47,23 @@ public class FindClass implements Action {
 
     protected void findResource() {
         Bundle[] bundles = bundleContext.getBundles();
-        String filter = "*" + className + "*";
+        String path;
+        String filter;
+        int idx = className.lastIndexOf('.');
+        if (idx >= 0) {
+            path = className.substring(0, idx).replace('.', '/');
+            if (path.isEmpty() || path.charAt(0) != '/') {
+                path = "/" + path;
+            }
+            filter = className.substring(idx + 1) + ".class";
+        } else {
+            path = "/";
+            filter = "*" + className + "*";
+        }
         for (Bundle bundle:bundles){
             BundleWiring wiring = bundle.adapt(BundleWiring.class);
             if (wiring != null){
-                Collection<String> resources = wiring.listResources("/", filter, BundleWiring.LISTRESOURCES_RECURSE);
+                Collection<String> resources = wiring.listResources(path, filter, BundleWiring.LISTRESOURCES_RECURSE);
                 if (resources.size() > 0){
                     String title = ShellUtil.getBundleName(bundle);
                     System.out.println("\n" + title);

-- 
To stop receiving notification emails like this one, please contact
"commits@karaf.apache.org" <co...@karaf.apache.org>.