brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: support multiple instances of the...
Date Fri, 07 Nov 2014 20:27:12 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/307#discussion_r20035153
  
    --- Diff: core/src/main/java/brooklyn/management/ha/OsgiManager.java ---
    @@ -87,19 +90,32 @@ public void stop() {
     
         public void registerBundle(String bundleUrl) {
             try {
    -            String nv = bundleUrlToNameVersionString.get(bundleUrl);
    +            String nv = urlToBundleIdentifier.get(bundleUrl);
                 if (nv!=null) {
    -                if (Osgis.getBundle(framework, nv).isPresent()) {
    +                if (Osgis.bundleFinder(framework).id(nv).requiringFromUrl(bundleUrl).find().isPresent())
{
                         log.trace("Bundle from "+bundleUrl+" already installed as "+nv+";
not re-registering");
                         return;
    +                } else {
    +                    log.debug("Bundle "+nv+" from "+bundleUrl+" is known in map but not
installed; perhaps in the process of installing?");
                     }
                 }
    +            
                 Bundle b = Osgis.install(framework, bundleUrl);
                 nv = b.getSymbolicName()+":"+b.getVersion().toString();
    -            // TODO if there is another entry for name:version we should log a warning
at the very least,
    -            // or better provide a way to get back *this* bundle
    -            bundleUrlToNameVersionString.put(bundleUrl, nv);
    -            log.debug("Bundle from "+bundleUrl+" successfully installed as " + nv + "
("+b+")");
    +            
    +            List<Bundle> matches = Osgis.bundleFinder(framework).id(nv).findAll();
    +            if (matches.isEmpty()) {
    +                log.error("OSGi not find bundle "+nv+" in search after installing it
from "+bundleUrl);
    --- End diff --
    
    typo: "OSGi could not find"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message