Examples of ChangeStateTask


Examples of org.apache.qpid.server.configuration.updater.ChangeStateTask

                return getActualState();
            }
        }
        else
        {
            return (State)_taskExecutor.submitAndWait(new ChangeStateTask(this, currentState, desiredState));
        }
    }
View Full Code Here

Examples of org.apache.qpid.server.configuration.updater.ChangeStateTask

                return getActualState();
            }
        }
        else
        {
            return (State)_taskExecutor.submitAndWait(new ChangeStateTask(this, currentState, desiredState));
        }
    }
View Full Code Here

Examples of org.apache.qpid.server.configuration.updater.ChangeStateTask

                return getActualState();
            }
        }
        else
        {
            return (State)_taskExecutor.submitAndWait(new ChangeStateTask(this, currentState, desiredState));
        }
    }
View Full Code Here

Examples of org.apache.qpid.server.configuration.updater.ChangeStateTask

                return getState();
            }
        }
        else
        {
            return _taskExecutor.submitAndWait(new ChangeStateTask(this, currentState, desiredState));
        }
    }
View Full Code Here

Examples of org.apache.sling.installer.api.tasks.ChangeStateTask

        Subsystem subsystem = null;
        try {
            subsystem = this.bundleContext.getService(this.subsystemReference);
            if ( subsystem != null ) {
                subsystem.uninstall();
                ctx.addTaskToCurrentCycle(new ChangeStateTask(this.getResourceGroup(), ResourceState.UNINSTALLED));
                ctx.log("Uninstalled subsystem {}", subsystem);
            } else {
                ctx.log("Unable to uninstall subsystem {}.", tr);
                ctx.addTaskToCurrentCycle(new ChangeStateTask(this.getResourceGroup(), ResourceState.IGNORED));
            }
        } finally {
            if ( subsystem != null ) {
                this.bundleContext.ungetService(this.subsystemReference);
            }
View Full Code Here

Examples of org.apache.sling.installer.api.tasks.ChangeStateTask

    public void execute(final InstallationContext ctx) {
        final TaskResource tr = this.getResource();
        ctx.log("Starting subsystem from {}", tr);

        this.subsystem.start();
        ctx.addTaskToCurrentCycle(new ChangeStateTask(this.getResourceGroup(), ResourceState.INSTALLED));
        ctx.log("Started subsystem {}", this.subsystem);
    }
View Full Code Here

Examples of org.apache.sling.installer.api.tasks.ChangeStateTask

                subsystem.stop();
                subsystem.uninstall();
                ctx.addTaskToCurrentCycle(new InstallSubsystemTask(this.getResourceGroup(), this.rootSubsystem));
            } else {
                ctx.log("Unable to update subsystem {}.", tr);
                ctx.addTaskToCurrentCycle(new ChangeStateTask(this.getResourceGroup(), ResourceState.IGNORED));
            }
        } finally {
            if ( subsystem != null ) {
                this.bundleContext.ungetService(this.subsystemReference);
            }
View Full Code Here

Examples of org.apache.sling.installer.api.tasks.ChangeStateTask

            final Subsystem sub = this.rootSubsystem.install(tr.getURL(), tr.getInputStream());
            ctx.addTaskToCurrentCycle(new StartSubsystemTask(this.getResourceGroup(), sub));
            ctx.log("Installed new subsystem {}", sub);
        } catch (final IOException e) {
            ctx.log("Unable to install subsystem {} : {}", tr, e);
            ctx.addTaskToCurrentCycle(new ChangeStateTask(this.getResourceGroup(), ResourceState.IGNORED));
        }
    }
View Full Code Here

Examples of org.apache.sling.installer.api.tasks.ChangeStateTask

            // if this is an uninstall, check if we have to install an older version
            // in this case we should do an update instead of uninstall/install (!)
            final TaskResource second = group.getNextActiveResource();
            if ( second != null &&
                ( second.getState() == ResourceState.IGNORED || second.getState() == ResourceState.INSTALLED || second.getState() == ResourceState.INSTALL ) ) {
                result = new ChangeStateTask(group, ResourceState.UNINSTALLED);
            } else {
                result = new ConfigRemoveTask(group, this.configAdmin);
            }
    } else {
          result = new ConfigInstallTask(group, this.configAdmin);
View Full Code Here

Examples of org.apache.sling.installer.api.tasks.ChangeStateTask

            // check if the required info is available
            final SubsystemInfo info = checkResource(toActivate);
            if ( info == null ) {
                // ignore as info is missing
                result = new ChangeStateTask(toActivate, ResourceState.IGNORED);
            } else {
                // search a subsystem with the symbolic name
                final ServiceReference<Subsystem> ref = this.getSubsystemReference(info.symbolicName);

                final Subsystem currentSubsystem = (ref != null ? this.bundleContext.getService(ref) : null);
                try {
                    final Version newVersion = new Version(info.version);
                    final Version oldVersion = (ref == null ? null : (Version)ref.getProperty("subsystem.version"));

                    // Install
                    if ( rsrc.getState() == ResourceState.INSTALL ) {
                        if ( oldVersion != null ) {

                            final int compare = oldVersion.compareTo(newVersion);
                            if (compare < 0) {
                                // installed version is lower -> update
                                result = new UpdateSubsystemTask(toActivate, this.bundleContext, ref, this.rootSubsystem);
                            } else if ( compare == 0 && isSnapshot(newVersion) ) {
                                // same version but snapshot -> update
                                result = new UpdateSubsystemTask(toActivate, this.bundleContext, ref, this.rootSubsystem);
                            } else if ( compare == 0 && currentSubsystem != null && currentSubsystem.getState() != State.ACTIVE ) {
                                // try to start the version
                                result = new StartSubsystemTask(toActivate, currentSubsystem);
                            } else {
                                logger.info("{} is not installed, subsystem with same or higher version is already installed: {}", info, newVersion);
                                result = new ChangeStateTask(toActivate, ResourceState.IGNORED);
                            }
                        } else {
                            result = new InstallSubsystemTask(toActivate, this.rootSubsystem);
                        }

                    // Uninstall
                    } else if ( rsrc.getState() == ResourceState.UNINSTALL ) {
                        if ( oldVersion == null ) {
                            logger.error("Nothing to uninstall. {} is currently not installed.", info);
                            result = new ChangeStateTask(toActivate, ResourceState.IGNORED);
                        } else {

                            final int compare = oldVersion.compareTo(newVersion);
                            if ( compare == 0 ) {
                                result = new UninstallSubsystemTask(toActivate, this.bundleContext, ref);
                            } else {
                                logger.error("Nothing to uninstall. {} is currently not installed, different version is installed {}", info, oldVersion);
                                result = new ChangeStateTask(toActivate, ResourceState.IGNORED);
                            }
                        }
                    } else {
                        result = null;
                    }
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.