Package org.apache.aries.application.management

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


            }
            if (conversionExceptions.size() > 0) {
              for (ConversionException cx : conversionExceptions) {
                _logger.error("APPMANAGEMENT0004E", new Object[]{f.getName(), appName, cx});
              }
              throw new ManagementException (MessageUtil.getMessage("APPMANAGEMENT0005E", appName));
            }
            if (convertedBinary != null) {
              modifiedBundles.put (f.getName(), convertedBinary);            
              extraBundlesInfo.add(convertedBinary.getBundleInfo(_applicationMetadataFactory));
            }
          }
        }
      }
      // if Application-Content header was not specified build it based on the bundles included by value
      if (applicationManifest.getMainAttributes().getValue(AppConstants.APPLICATION_CONTENT) == null) {
          String appContent = buildAppContent(extraBundlesInfo);
          applicationManifest.getMainAttributes().putValue(AppConstants.APPLICATION_CONTENT, appContent);
      }
     
      ManifestDefaultsInjector.updateManifest(applicationManifest, appName, ebaFile);
      applicationMetadata = _applicationMetadataFactory.createApplicationMetadata(applicationManifest);
     
      if (deploymentManifest != null) {
        deploymentMetadata = _deploymentMetadataFactory.createDeploymentMetadata(deploymentManifest);
       
        // Validate: symbolic names must match
        String appSymbolicName = applicationMetadata.getApplicationSymbolicName();
        String depSymbolicName = deploymentMetadata.getApplicationSymbolicName();
        if (!appSymbolicName.equals(depSymbolicName)) {
          throw new ManagementException (MessageUtil.getMessage("APPMANAGEMENT0002E", appName, appSymbolicName, depSymbolicName));
        }
      }

      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 []{appPath, iox});
      throw new ManagementException(iox);
    }
    return application;
  }
View Full Code Here

      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

            // Step 3: Lookup bundle location using the resolver
            bundleInfo = findBundleInfoUsingResolver(resolver, bundleSymbolicName, bundleVersion);
        }
       
        if (bundleInfo == null) {
            throw new ManagementException("Cound not find bundles: " + bundleSymbolicName + "_" + bundleVersion);
        }
           
        Bundle bundle = _bundleContext.installBundle(bundleInfo.getLocation());
           
        _bundles.put(bundleInfo, bundle);       
View Full Code Here

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

TOP

Related Classes of org.apache.aries.application.management.ManagementException

Copyright © 2018 www.massapicom. 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.