Package org.apache.geronimo.deployment.plugin

Examples of org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager


        if(!libFile.exists() || !libFile.isFile() || !libFile.canRead()) {
            throw new DeploymentException("File does not exist or not a normal file or not readable. "+libFile);
        }
        DeploymentManager dmgr = connection.getDeploymentManager();
        if(dmgr instanceof GeronimoDeploymentManager) {
            GeronimoDeploymentManager mgr = (GeronimoDeploymentManager) dmgr;
            String groupId = installLibraryCommandArgs.getGroupId();
            try {
                Artifact artifact = mgr.installLibrary(libFile, groupId);
                if(artifact != null) {
                    consoleReader.printString(DeployUtils.reformat("Installed "+artifact, 4, 72));
                } else {
                    throw new DeploymentException("Unable to install library "+installLibraryCommandArgs.getArgs()[0]);
                }
View Full Code Here


    //todo: provide a way to handle a username and password for the remote repo?

    public void execute(ConsoleReader consoleReader, ServerConnection connection, CommandArgs commandArgs) throws DeploymentException {
        DeploymentManager dmgr = connection.getDeploymentManager();
        if (dmgr instanceof GeronimoDeploymentManager) {
            GeronimoDeploymentManager mgr = (GeronimoDeploymentManager) dmgr;
            try {
                String repo;
                if (commandArgs.getArgs().length == 1) {
                    repo = commandArgs.getArgs()[0];
                } else {
View Full Code Here

        PluginArtifactType instance = new PluginArtifactType();
        pluginType.getPluginArtifact().add(instance);
        ArtifactType artifactType = PluginInstallerGBean.toArtifactType(geronimoArtifact);
        instance.setModuleId(artifactType);

        GeronimoDeploymentManager mgr = getDeploymentManager2();
        Object key = mgr.startInstall(pluginListType, defaultRepository, false, null, null);
//        Object key = mgr.startInstall(artifactFile, defaultRepository, false, null, null);
        waitTillDone(mgr, key);

        if (startModules) {
            getLog().info("Starting modules...");
            Target[] allTargets = mgr.getTargets();
            TargetModuleID[] allModules;
            try {
                allModules = mgr.getAvailableModules(null, allTargets);
            } catch (TargetException e) {
                throw new MojoExecutionException("Unable to load module list from server", e);
            }
            TargetModuleID id = null;
            for (TargetModuleID test : allModules) {
View Full Code Here

                throw new DeploymentException("File does not exist or not a normal file or not readable. "+bundleFile);
            }
           
            DeploymentManager dmgr = connection.getDeploymentManager();
            if(dmgr instanceof GeronimoDeploymentManager) {
                GeronimoDeploymentManager mgr = (GeronimoDeploymentManager) dmgr;
               
                boolean start = recordBundleCommandArgs.isStart();
                int startLevel = recordBundleCommandArgs.getStartLevel();
                String groupId = recordBundleCommandArgs.getGroupId();
                try {
                    long bundleId = mgr.recordInstall(bundleFile, groupId, startLevel);
                    if ( bundleId > 0 ){
                        consoleReader.printString(DeployUtils.reformat("Installed and recorded bundle: " + bundleId, 4, 72));
                       
                        if (start){
                            if(mgr instanceof RemoteDeploymentManager) {
View Full Code Here

        if(!libFile.exists() || !libFile.isFile() || !libFile.canRead()) {
            throw new DeploymentException("File does not exist or not a normal file or not readable. "+libFile);
        }
        DeploymentManager dmgr = connection.getDeploymentManager();
        if(dmgr instanceof GeronimoDeploymentManager) {
            GeronimoDeploymentManager mgr = (GeronimoDeploymentManager) dmgr;
            String groupId = installLibraryCommandArgs.getGroupId();
            try {
                Artifact artifact = mgr.installLibrary(libFile, groupId);
                if(artifact != null) {
                    consoleReader.printString(DeployUtils.reformat("Installed "+artifact, 4, 72));
                } else {
                    throw new DeploymentException("Unable to install library "+installLibraryCommandArgs.getArgs()[0]);
                }
View Full Code Here

           
            long bundleId = Long.parseLong(commandArgs.getArgs()[0]);
           
            DeploymentManager dmgr = connection.getDeploymentManager();
            if(dmgr instanceof GeronimoDeploymentManager) {
                GeronimoDeploymentManager mgr = (GeronimoDeploymentManager) dmgr;
                try {
                    mgr.eraseUninstall(bundleId);
                    consoleReader.printString(DeployUtils.reformat("Uninstalled and erased bundle: " + bundleId, 4, 72));
                   
                } catch (Exception e) {
                    throw new DeploymentException("Unable to erase bundle: " + bundleId, e);
                }
View Full Code Here

    //todo: provide a way to handle a username and password for the remote repo?

    public void execute(ConsoleReader consoleReader, ServerConnection connection, CommandArgs commandArgs) throws DeploymentException {
        DeploymentManager dmgr = connection.getDeploymentManager();
        if (dmgr instanceof GeronimoDeploymentManager) {
            GeronimoDeploymentManager mgr = (GeronimoDeploymentManager) dmgr;
            try {
                String repo;
                if (commandArgs.getArgs().length == 1) {
                    repo = commandArgs.getArgs()[0];
                } else {
View Full Code Here

    public void execute(ConsoleReader consoleReader, ServerConnection connection, CommandArgs commandArgs) throws DeploymentException {
        DeploymentManager dmgr = connection.getDeploymentManager();
        if(dmgr instanceof GeronimoDeploymentManager) {
            try {
                GeronimoDeploymentManager mgr = (GeronimoDeploymentManager) dmgr;
                if (commandArgs.getArgs().length == 0) {
                    throw new DeploymentException("Must specify Plugin CAR file");
                }
                File carFile = new File(commandArgs.getArgs()[0]);
                carFile = carFile.getAbsoluteFile();
                if(!carFile.exists() || !carFile.canRead()) {
                    throw new DeploymentException("CAR file cannot be read: "+carFile.getAbsolutePath());
                }
                //TODO figure out if there is a plausible default repo
                Object key = mgr.startInstall(carFile, null, false, null, null);
                long start = System.currentTimeMillis();
                DownloadResults results = showProgress(consoleReader, mgr, key);
                int time = (int)(System.currentTimeMillis() - start) / 1000;
                printResults(consoleReader, results, time);
            } catch (IOException e) {
View Full Code Here

    protected String groupId = null;

    @Override
    public void execute() throws MojoExecutionException {
        getLog().info("libraryFile: " + libraryFile.getAbsolutePath());
        GeronimoDeploymentManager mgr = getGeronimoDeploymentManager();
        try {
            mgr.installLibrary(libraryFile, groupId);
        } catch (IOException e) {
            throw new MojoExecutionException("Could not install library", e);
        }
    }
View Full Code Here

           
            long bundleId = Long.parseLong(commandArgs.getArgs()[0]);
           
            DeploymentManager dmgr = connection.getDeploymentManager();
            if(dmgr instanceof GeronimoDeploymentManager) {
                GeronimoDeploymentManager mgr = (GeronimoDeploymentManager) dmgr;
                try {
                    mgr.eraseUninstall(bundleId);
                    consoleReader.printString(DeployUtils.reformat("Uninstalled bundle: " + bundleId, 4, 72));
                   
                } catch (Exception e) {
                    throw new DeploymentException("Unable to uninstall bundle: " + bundleId, e);
                }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager

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.