Package org.servicemix.jbi.deployment

Examples of org.servicemix.jbi.deployment.Descriptor


     * @param location
     * @throws DeploymentException
     */
    public void removeArchive(String location) throws DeploymentException {
        log.info("Attempting to remove archive at: " + location);
        Descriptor root = (Descriptor) descriptorMap.remove(location);
        if (root != null) {
            try {
                container.getBroker().suspend();
                if (root.getComponent() != null) {
                    String componentName = root.getComponent().getIdentification().getName();
                    log.info("Uninstalling Component: " + componentName);
                    autoRemoveSAs(componentName);
                    installationService.unloadInstaller(componentName, true);
                }
                if (root.getSharedLibrary() != null) {
                    String name = root.getSharedLibrary().getIdentification().getName();
                    log.info("removing shared library: " + name);
                    installationService.uninstallSharedLibrary(name);
                }
                if (root.getServiceAssembly() != null) {
                    ServiceAssembly sa = root.getServiceAssembly();
                    String name = sa.getIdentification().getName();
                    log.info("removing service assembly " + name);
                    try {
                        if (deploymentService.isSaDeployed(name)) {
                            deploymentService.shutDown(name);
View Full Code Here


     *
     * @param location
     * @return the Descriptor if installed
     */
    protected Descriptor getInstalledDescriptor(String location) throws JBIException{
        Descriptor result = null;
        boolean exists = false;
        try {
            File tmp = AutoDeploymentService.unpackLocation(environmentContext.getTmpDir(), location);
            Descriptor root = AutoDeploymentService.buildDescriptor(tmp);
            if (root.getComponent() != null) {
                String componentName = root.getComponent().getIdentification().getName();
                exists = container.getRegistry().isLocalComponentRegistered(componentName);
            }
            else if (root.getServiceAssembly() != null) {
                ServiceAssembly sa = root.getServiceAssembly();
                String name = sa.getIdentification().getName();
                exists = deploymentService.isSaDeployed(name);
            }
            else if (root.getSharedLibrary() != null) {
                String name = root.getSharedLibrary().getIdentification().getName();
                exists = installationService.containsSharedLibrary(name);
            }
            if (exists) {
                result = root;
            }
View Full Code Here

     *
     * @param tmpDir
     * @return the Descriptor object
     */
    protected static Descriptor buildDescriptor(File tmpDir) {
        Descriptor root = null;
        File descriptorFile = new File(tmpDir, DESCRIPTOR_FILE);
        if (descriptorFile.exists()) {
            ClassLoader cl = Thread.currentThread().getContextClassLoader();
            try {
                Thread.currentThread().setContextClassLoader(AutoDeploymentService.class.getClassLoader());
View Full Code Here

            File[] files = dir.listFiles();
            if (files != null) {
                for (int i = 0;i < files.length;i++) {
                    File file = files[i];
                    if (file.getPath().endsWith(".jar") || file.getPath().endsWith(".zip")) {
                        Descriptor root = getInstalledDescriptor(file.getAbsolutePath());
                        if (root != null) {
                            descriptorMap.put(file.getAbsolutePath(), root);
                        }
                    }
                }
View Full Code Here

   * @param installRoot
   *            The root of the installation
   * @return The deployment descriptor
   */
   public static Descriptor getDescriptor(String installRoot) {
       Descriptor root = null;
       File descriptor = new File(installRoot + META_INF, DESCRIPTOR_FILE);
       log.debug("Checking for descriptor " + descriptor.getAbsolutePath());
       if (descriptor.exists()) {
           try {
               Thread.currentThread().setContextClassLoader(Descriptor.class.getClassLoader());
View Full Code Here

   */
  public void loadServiceUnitServices(String installationRoot,
      String serviceUnitName) {
    if (DescriptorFactory.hasDescriptor(installationRoot)) {
      log.debug("Descriptor exists, parsing");
      Descriptor descriptor = DescriptorFactory
          .getDescriptor(installationRoot);
      if (descriptor.getServices() != null) {
        log
            .debug("Found services, assuming 'fixed provider', building endpoints");
        addServices(descriptor.getServices(), serviceUnitName);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.servicemix.jbi.deployment.Descriptor

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.