Package org.hotswap.agent.command

Examples of org.hotswap.agent.command.Command


                                          final ClassLoader classLoader, URI uri) throws IOException {
        pluginManager.getWatcher().addEventListener(classLoader, uri, new WatchEventListener() {
            @Override
            public void onEvent(WatchFileEvent event) {
                if (event.isFile()) {
                    Command command = new WatchEventCommand(pluginAnnotation, event, classLoader);
                    pluginManager.getScheduler().scheduleCommand(command, watchEventDTO.getTimeout());
                    LOGGER.trace("Resource changed {}", event);
                }
            }
        });
View Full Code Here


    public void initHotswapCommand(ClassLoader appClassLoader, String port) {
        if (port != null && port.length() > 0) {
            hotswapCommand = new ReflectionCommand(this, HotswapperCommand.class.getName(), "hotswap", appClassLoader,
                    port, reloadMap);
        } else {
            hotswapCommand = new Command() {
                @Override
                public void executeCommand() {
                    pluginManager.hotswap(reloadMap);
                }
View Full Code Here

            seenClassLoaders.put(classLoader, null);

            // ensure the classloader should not be excluded
            if (!excludedClassLoaders.contains(classLoader.getClass().getName())) {
                // schedule the excecution
                PluginManager.getInstance().getScheduler().scheduleCommand(new Command() {
                    @Override
                    public void executeCommand() {
                        PluginManager.getInstance().initClassLoader(classLoader, protectionDomain);
                    }
View Full Code Here

    }

    @Override
    public void scheduleCommand(Command command, int timeout, DuplicateSheduleBehaviour behaviour) {
        synchronized (scheduledCommands) {
            Command targetCommand = command;
            if (scheduledCommands.containsKey(command) && (command instanceof MergeableCommand)) {
                // get existing equals command and merge it
                for (Command scheduledCommand : scheduledCommands.keySet()) {
                    if (command.equals(scheduledCommand)) {
                        targetCommand = ((MergeableCommand) command).merge(scheduledCommand);
View Full Code Here

        Long currentTime = System.currentTimeMillis();
        synchronized (scheduledCommands) {
            for (Iterator<Map.Entry<Command, DuplicateScheduleConfig>> it = scheduledCommands.entrySet().iterator(); it.hasNext(); ) {
                Map.Entry<Command, DuplicateScheduleConfig> entry = it.next();
                DuplicateScheduleConfig config = entry.getValue();
                Command command = entry.getKey();

                // if timeout
                if (config.getTime() < currentTime) {
                    // command is currently running
                    if (runningCommands.contains(command)) {
View Full Code Here

                } catch (Exception e) {
                    LOGGER.warning("initOsgiEquinox() exception : {}",  e.getMessage());
                }

                if (resource != null) {
                    hotswapCommand = new Command() {
                        @Override
                        public void executeCommand() {
                            pluginManager.hotswap(reloadMap);
                        }
View Full Code Here

TOP

Related Classes of org.hotswap.agent.command.Command

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.