Package javax.jbi.management

Examples of javax.jbi.management.DeploymentException


            if (serviceUnitName == null || serviceUnitName.length() == 0) {
                throw new IllegalArgumentException("serviceUnitName should be non null and non empty");
            }
            ServiceUnit su = (ServiceUnit) this.serviceUnits.get(serviceUnitName);
            if (su == null) {
                throw new DeploymentException(createFailureMessage("deploy", "Service Unit '" + serviceUnitName + "' is not deployed"));
            }
            if (!LifeCycleMBean.STOPPED.equals(su.getCurrentState()) &&
                !LifeCycleMBean.SHUTDOWN.equals(su.getCurrentState())) {
                throw new DeploymentException("ServiceUnit should be in a SHUTDOWN or STOPPED state");
            }
            su.start();
            if (logger.isDebugEnabled()) {
                logger.debug("Service unit started");
            }
        } catch (DeploymentException e) {
            throw e;
        } catch (Exception e) {
            throw new DeploymentException(createFailureMessage("start", e));
        }
    }
View Full Code Here


            if (serviceUnitName == null || serviceUnitName.length() == 0) {
                throw new IllegalArgumentException("serviceUnitName should be non null and non empty");
            }
            ServiceUnit su = (ServiceUnit) this.serviceUnits.get(serviceUnitName);
            if (su == null) {
                throw new DeploymentException(createFailureMessage("deploy", "Service Unit '" + serviceUnitName + "' is not deployed"));
            }
            if (!LifeCycleMBean.RUNNING.equals(su.getCurrentState())) {
                throw new DeploymentException("ServiceUnit should be in a SHUTDOWN state");
            }
            su.stop();
            if (logger.isDebugEnabled()) {
                logger.debug("Service unit stopped");
            }
        } catch (DeploymentException e) {
            throw e;
        } catch (Exception e) {
            throw new DeploymentException(createFailureMessage("stop", e));
        }
    }
View Full Code Here

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

            if (serviceUnitName == null || serviceUnitName.length() == 0) {
                throw new IllegalArgumentException("serviceUnitName should be non null and non empty");
            }
            ServiceUnit su = (ServiceUnit) this.serviceUnits.get(serviceUnitName);
            if (su == null) {
                throw new DeploymentException(createFailureMessage("deploy", "Service Unit '" + serviceUnitName + "' is not deployed"));
            }
            if (!LifeCycleMBean.SHUTDOWN.equals(su.getCurrentState())) {
                throw new DeploymentException("ServiceUnit should be in a SHUTDOWN state");
            }
            doUndeploy(su);
            this.serviceUnits.remove(serviceUnitName);
            if (logger.isDebugEnabled()) {
                logger.debug("Service unit undeployed");
            }
            return createSuccessMessage("undeploy");
        } catch (DeploymentException e) {
            throw e;
        } catch (Exception e) {
            throw new DeploymentException(createFailureMessage("undeploy", e));
        }
    }
View Full Code Here

            counterMonitor.setInitThreshold(threshold);
            counterMonitor.setOffset(offset);
            mbeanServer.registerMBean(cc,ourName);
            mbeanServer.addNotificationListener(ourName,this,null,new Object());
        }catch(Exception e){
            throw new DeploymentException(e);
        }
    }
View Full Code Here

       
    }

    protected void validate() throws JBIException{
        if(observedObjectName == null){
            throw new DeploymentException("observedObjectName is null");
        }
        if(attributeName == null){
            throw new DeploymentException("attributeName is null");
        }
        if(threshold == null){
            throw new DeploymentException("threshold is null");
        }
        if(offset == null){
            throw new DeploymentException("offset is null");
        }
    }
View Full Code Here

   
    URL[] urls = new URL[classPathNames.length];
    for (int i = 0; i < classPathNames.length; i++) {
      File file = new File(dir, classPathNames[i]);
      if (!file.exists()) {
        throw new DeploymentException("Unable to add File " + file
            + " to class path as it doesn't exist: "
            + file.getAbsolutePath());
      }
      urls[i] = file.toURL();
    }
View Full Code Here

        ServiceAssembly sa = root.getServiceAssembly();
        if (sa != null) {
            result = deploy(tmpDir, sa);
        }
        else {
            throw new DeploymentException("Not an assembly: " + saZipURL);
        }
        return result;
    }
View Full Code Here

                    // FileUtil.moveFile(artifactFile, targetDir);
                    FileUtil.unpackArchive(artifactFile, targetDir);
                    // now get the component and give it a SA
                }
                else {
                    throw new DeploymentException("artifact: " + artifact + "(" + artifactFile.getAbsolutePath()
                            + ") doesn't exist");
                }
            }
            Component component = container.getComponent(componentName);
            if (component != null) {
                ServiceUnitManager sum = component.getServiceUnitManager();
                if (sum != null) {
                    result = sum.deploy(name, targetDir.getAbsolutePath());
                    sum.init(name, targetDir.getAbsolutePath());
                    // register active endpoints
                }
                else {
                    FileUtil.deleteFile(targetDir);
                    throw new DeploymentException("Component " + componentName + " doesn't have a ServiceUnitManager");
                }
            }
            else {
                FileUtil.deleteFile(targetDir);
                throw new DeploymentException("Component " + componentName + " doesn't exist");
            }
        }
        catch (IOException e) {
            log.error("Could not deploy ServiceUnit: " + name + " to component " + componentName, e);
            throw new DeploymentException(e);
        }
        log.info("Deployed ServiceUnit " + name + " to Component: " + componentName);
        return result;
    }
View Full Code Here

            else {
                FileUtil.deleteFile(targetDir);
            }
        }
        catch (IOException e) {
            throw new DeploymentException(e);
        }
        log.info("UnDeployed ServiceUnit " + name + " from Component: " + componentName);
    }
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.