Examples of ManagementException


Examples of org.apache.aries.application.management.ManagementException

    }
   
    public ApplicationMetadataFactory getApplicationMetadataFactory() throws ManagementException {
        ApplicationMetadataFactory service = (ApplicationMetadataFactory) applicationFactoryTracker.getService();
        if (service == null) {
            throw new ManagementException(new ServiceException(ApplicationMetadataFactory.class.getName(), ServiceException.UNREGISTERED));          
        }
        return service;
    }
View Full Code Here

Examples of org.apache.aries.application.management.ManagementException

    }
   
    private AriesApplicationManager getAriesApplicationManager() throws ManagementException {
        AriesApplicationManager service = (AriesApplicationManager) applicationManagerTracker.getService();
        if (service == null) {
            throw new ManagementException(new ServiceException(AriesApplicationManager.class.getName(), ServiceException.UNREGISTERED));          
        }
        return service;
    }
View Full Code Here

Examples of org.apache.aries.application.management.ManagementException

                        // Step 3: Lookup bundle location using the resolver
                        bundleInfo = findBundleInfoUsingResolver(resolver, bundleSymbolicName, bundleVersion);
                    }
                   
                    if (bundleInfo == null) {
                        throw new ManagementException("Could not find bundle: " + bundleSymbolicName + "_" + bundleVersion);
                    }
                       
                    contentBundle = bundleContext.installBundle(bundleInfo.getLocation());
                   
                    applicationBundles.add(contentBundle);
View Full Code Here

Examples of org.apache.aries.application.management.ManagementException

        if (ref != null) {
            service = bundle.getBundleContext().getService(ref);
        }
       
        if (service == null) {
            throw new ManagementException(new ServiceException(type.getName(), ServiceException.UNREGISTERED));
        }
       
        return type.cast(service);
    }
View Full Code Here

Examples of org.apache.aries.application.management.ManagementException

       
        // Validate: symbolic names must match
        String appSymbolicName = applicationMetadata.getApplicationSymbolicName();
        String depSymbolicName = applicationMetadata.getApplicationSymbolicName();
        if (!appSymbolicName.equals(depSymbolicName)) {
          throw new ManagementException (MessageUtil.getMessage("APPMANAGEMENT0002E", ebaFile.getName(), appSymbolicName, depSymbolicName));
        }
      }
     
      /* We require that all other .jar and .war files included by-value be valid bundles
       * because a DEPLOYMENT.MF has been provided. If no DEPLOYMENT.MF, migrate
       * wars to wabs, plain jars to bundles
       */
       
      Set<BundleInfo> extraBundlesInfo = new HashSet<BundleInfo>();
      for (IFile f : ebaFile) {
        if (f.isDirectory()) {
          continue;
        }
       
        BundleManifest bm = getBundleManifest (f);
        if (bm != null) {
          if (bm.isValid()) {
            extraBundlesInfo.add(new SimpleBundleInfo(_applicationMetadataFactory, bm, f.toURL().toExternalForm()));
          } else if (deploymentMetadata != null) {
            throw new ManagementException (MessageUtil.getMessage("APPMANAGEMENT0003E", f.getName(), ebaFile.getName()));
          } else {
            // We have a jar that needs converting to a bundle, or a war to migrate to a WAB
            InputStream convertedBinary = null;
            Iterator<BundleConverter> converters = _bundleConverters.iterator();
            List<ConversionException> conversionExceptions = Collections.emptyList();
            while (converters.hasNext() && convertedBinary == null) {
              try {
                convertedBinary = converters.next().convert(ebaFile, f);
              } catch (ServiceException sx) {
                // We'll get this if our optional BundleConverter has not been injected.
              } catch (ConversionException cx) {
                conversionExceptions.add(cx);
              }
            }
            if (conversionExceptions.size() > 0) {
              for (ConversionException cx : conversionExceptions) {
                _logger.error("APPMANAGEMENT0004E", new Object[]{f.getName(), ebaFile.getName(), cx});
              }
              throw new ManagementException (MessageUtil.getMessage("APPMANAGEMENT0005E", ebaFile.getName()));
            }
            if (convertedBinary != null) {
              modifiedBundles.put (f.getName(), convertedBinary);
              bm = BundleManifest.fromBundle(f);
              extraBundlesInfo.add(new SimpleBundleInfo(_applicationMetadataFactory, bm, f.getName()));
            }
          }
        }
      }

      application = new AriesApplicationImpl (applicationMetadata, extraBundlesInfo, _localPlatform);
      application.setDeploymentMetadata(deploymentMetadata);
      // Store a reference to any modified bundles
      application.setModifiedBundles (modifiedBundles);
    } catch (IOException iox) {
      _logger.error ("APPMANAGEMENT0006E", new Object []{ebaFile.getName(), iox});
      throw new ManagementException(iox);
    }
    return application;
  }
View Full Code Here

Examples of org.apache.aries.application.management.ManagementException

      os = new FileOutputStream (tempFile);
      IOUtils.copy(is, os);
      IDirectory downloadedSource = FileSystem.getFSRoot(tempFile);
      app = createApplication (downloadedSource);
    } catch (IOException iox) {
      throw new ManagementException (iox);
    }
      finally {
      IOUtils.close(os);
    }
    return app;
View Full Code Here

Examples of org.apache.aries.application.management.ManagementException

            }
            // if application was successfully installed & started it
            // should have registered its ApplicationContext by now
            applicationContext = contextMap.get(key);
            if (applicationContext == null) {
                throw new ManagementException("No ApplicationContext");
            }
        }

        return applicationContext;
    }
View Full Code Here

Examples of org.apache.aries.application.management.ManagementException

        if (ref != null) {
            resolver = (AriesApplicationResolver) bundleContext.getService(ref);
        }

        if (resolver == null) {
            throw new ManagementException("AriesApplicationResolver service not found");
        }

        DeploymentMetadata meta = application.getDeploymentMetadata();
       
        List<DeploymentContent> bundlesToInstall = new ArrayList<DeploymentContent>();
        bundlesToInstall.addAll(meta.getApplicationDeploymentContents());
        bundlesToInstall.addAll(meta.getApplicationProvisionBundles());
       
        applicationBundles = new HashSet<Bundle>();
        try {
            for (DeploymentContent content : bundlesToInstall) {
                String bundleSymbolicName = content.getContentName();
                Version bundleVersion = content.getExactVersion();

                BundleInfo bundleInfo = null;

                for (BundleInfo info : application.getBundleInfo()) {
                    if (info.getSymbolicName().equals(bundleSymbolicName)
                        && info.getVersion().equals(bundleVersion)) {
                        bundleInfo = info;
                        break;
                    }
                }

                if (bundleInfo == null) {
                    // call out to the bundle repository.
                    bundleInfo = resolver.getBundleInfo(bundleSymbolicName, bundleVersion);
                }

                if (bundleInfo == null) {
                    throw new ManagementException("Cound not find bundles: " + bundleSymbolicName + "_" + bundleVersion);
                }

                Bundle bundle = bundleContext.installBundle(bundleInfo.getLocation());

                applicationBundles.add(bundle);
View Full Code Here

Examples of org.apache.ode.bpel.pmapi.ManagementException

    public ProcessInfoDocument activate(QName pid) {
        try {
            _store.setState(pid, org.apache.ode.bpel.iapi.ProcessState.ACTIVE);
        } catch (Exception ex) {
            __log.error("Exception while setting process state", ex);
            throw new ManagementException("Error setting process state: " + ex.toString());
        }
        return genProcessInfoDocument(pid, ProcessInfoCustomizer.NONE);
    }
View Full Code Here

Examples of org.apache.ode.bpel.pmapi.ManagementException

            return runnable.exec();
        } catch (ManagementException me) {
            throw me;
        } catch (Exception e) {
            __log.error("Exception during database operation", e);
            throw new ManagementException("Exception during database operation: " + e.toString());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.