Package javax.jbi.management

Examples of javax.jbi.management.DeploymentException


           
                Class bootstrapClass;
                try {
                    bootstrapClass = bootstrapClassLoader.loadClass(bootstrapClassName);
                    if (bootstrapClass == null){
                        throw new DeploymentException("Could not find bootstrap class: " + bootstrapClassName);
                    }
                    this.bootstrap = (Bootstrap) bootstrapClass.newInstance();
                    this.bootstrap.init(ic);
                }
                catch (ClassNotFoundException e) {
                    log.error("Class not found: " + bootstrapClassName,e);
                    throw new DeploymentException(e);
                }
                catch (InstantiationException e) {
                    log.error("Could not instantiate : " + bootstrapClassName,e);
                    throw new DeploymentException(e);
                }
                catch (IllegalAccessException e) {
                    log.error("Illegal access on: " + bootstrapClassName,e);
                    throw new DeploymentException(e);
                }
                catch (JBIException e) {
                    log.error("Could not initialize : " + bootstrapClassName,e);
                    throw new DeploymentException(e);
                }
               
          
           
           
View Full Code Here


            }
            }
            else {
                String err = "component class " + context.getComponentClassName() + " not found";
                log.error(err);
                throw new DeploymentException(err);
            }
        }
        catch (ClassNotFoundException e) {
            log.error("component class " + context.getComponentClassName() + " not found");
            throw new DeploymentException(e);
        }
        catch (InstantiationException e) {
            throw new DeploymentException(e);
        }
        catch (IllegalAccessException e) {
            throw new DeploymentException(e);
        }
        return result;
    }
View Full Code Here

            springLoader.setXmlPreprocessors(xmlPreprocessors);
            ServiceName configurationName = springLoader.load("xbean");
            kernel.startService(configurationName);
            services = kernel.getServices(EndpointSpec.class);
            if (services == null || services.size() == 0) {
                throw new DeploymentException("no endpoints specified");
            }
            loaded = true;
        } finally {
            if (!loaded) {
                kernel.destroy();
View Full Code Here

                InstallerMBeanImpl installer = doInstallArchive(tmpDir,root);
                if(installer != null){
                    try{
                        installer.install();
                    }catch(JBIException e){
                        throw new DeploymentException(e);
                    }
                    if(autoStart){
                        try{
                            ComponentNameSpace cns = new ComponentNameSpace(container.getName(),componentName,
                                    componentName);
                            LocalComponentConnector lcc = container.getRegistry().getLocalComponentConnector(cns);
                            if(container.getRegistry().isLocalComponentRegistered(componentName)){
                                ComponentMBean mbean = lcc.getComponentMBean();
                                if(mbean != null){

                                    mbean.start();

                                }else{
                                    log.warn("No ComponentMBean found for Component " + componentName);
                                }
                            }else{
                                log.warn("No ComponentConnector found for Component " + componentName);
                            }
                        }catch(JBIException e){
                            String errStr = "Failed to start Component: " + componentName;
                            log.error(errStr,e);
                            throw new DeploymentException(e);
                        }

                    }
                    installers.put(componentName,installer);
                }
View Full Code Here

                File installationDir = environmentContext.createSharedLibraryDirectory(result);
                if (installationDir.exists()) {
                    FileUtil.deleteFile(installationDir);
                }
                if (!tmpDirectory.renameTo(installationDir)) {
                    throw new DeploymentException("Unable to rename " + tmpDirectory + " to " + installationDir);
                }
                log.info("moved " + tmpDirectory + " to " + installationDir);
                classLoaderService.addSharedLibrary(installationDir, descriptor);
            }
            catch (IOException e) {
                log.error("Deployment of Shared Library failed", e);
                // remove any files created for installation
                environmentContext.removeComponentRootDirectory(descriptor.getIdentification().getName());
                throw new DeploymentException(e);
            }
        }
        return result;
    }
View Full Code Here

        File installationDir;
        try {
            installationDir = environmentContext.getInstallationDirectory(name);
        }
        catch (IOException e) {
            throw new DeploymentException(e);
        }
        FileUtil.deleteFile(installationDir);
        tmpDirectory.renameTo(installationDir);
        log.info("moved " + tmpDirectory + " to " + installationDir);
        // create the Installation context
View Full Code Here

        }
        catch (Throwable e) {
            log.error("Deployment of Component failed", e);
            // remove any files created for installation
            environmentContext.removeComponentRootDirectory(descriptor.getIdentification().getName());
            throw new DeploymentException(e);
        }
        return result;
    }
View Full Code Here

                        if(installer != null){
                            if(installer != null){
                                try{
                                    installer.install();
                                }catch(JBIException e){
                                    throw new DeploymentException(e);
                                }
                                // now get and set running state
                                ComponentNameSpace cns = new ComponentNameSpace(container.getName(),componentName,
                                        componentName);
                                try{
                                    LocalComponentConnector lcc = container.getRegistry().getLocalComponentConnector(
                                            cns);
                                    if(lcc != null){

                                        lcc.setRunningState();

                                    }else{
                                        log.error("Failed to get LocalComponentConnector for Component: "
                                                + componentName);
                                    }
                                }catch(JBIException e){
                                    log.warn("Failed to set running state for Component: " + componentName);
                                }
                            }
                            installers.put(componentName,installer);
                            log.info("Created installer for existing component:  " + componentName);
                        }
                    }else{
                        log.warn("Component " + componentName + " is already installed");
                    }
                }
            }
        }catch(IOException e){
            throw new DeploymentException(e);
        }
    }
View Full Code Here

            }
            if (serviceUnitName == null || serviceUnitName.length() == 0) {
                throw new IllegalArgumentException("serviceUnitName should be non null and non empty");
            }
            if (this.serviceUnits.get(serviceUnitName) != null) {
                throw new DeploymentException(createFailureMessage("deploy", "Service Unit '" + serviceUnitName + "' is already deployed"));
            }
            ServiceUnit su = doDeploy(serviceUnitName, serviceUnitRootPath);
            this.serviceUnits.put(serviceUnitName, su);
            if (logger.isDebugEnabled()) {
                logger.debug("Service unit deployed");
            }
            return createSuccessMessage("deploy");
        } catch (DeploymentException e) {
            throw e;
        } catch (Exception e) {
            throw new DeploymentException(createFailureMessage("deploy", e));
        }
    }
View Full Code Here

            }
            if (serviceUnitName == null || serviceUnitName.length() == 0) {
                throw new IllegalArgumentException("serviceUnitName should be non null and non empty");
            }
            if (this.serviceUnits.get(serviceUnitName) == null) {
                throw new DeploymentException(createFailureMessage("deploy", "Service Unit '" + serviceUnitName + "' is not deployed"));
            }
            doInit(serviceUnitName, serviceUnitRootPath);
            if (logger.isDebugEnabled()) {
                logger.debug("Service unit initialized");
            }
        } catch (DeploymentException e) {
            throw e;
        } catch (Exception e) {
            throw new DeploymentException(createFailureMessage("init", e));
        }
    }
View Full Code Here

TOP

Related Classes of javax.jbi.management.DeploymentException

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.