Package javax.jbi.management

Examples of javax.jbi.management.DeploymentException


                                sum.init(name, targetDir.getAbsolutePath());
                                sum.start(name);
                            }
                            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) {
                        throw new DeploymentException(e);
                    }
                    log.info("Deployed ServiceUnit " + name + " to Component: " + componentName);
                }
            }
        }
View Full Code Here


                        if (lcc != null) {
                            lcc.getActivationSpec().setDestinationEndpoint(provider.getEndpointName());
                            lcc.getActivationSpec().setDestinationService(provider.getServiceName());
                        }
                        else {
                            throw new DeploymentException("Unable to build connections, can't find consumer interface "
                                    + suName);
                        }
                    }
                    else {
                        // We didn't have the interface so we will go after
                        // the service name and endpoint
                        InternalEndpoint endPoint = (InternalEndpoint) container.getRegistry().getEndpoint(
                                consumer.getServiceName(), consumer.getEndpointName());
                        if (endPoint != null) {
                            LocalComponentConnector lcc = (LocalComponentConnector) container.getRegistry()
                                    .getComponentConnector(endPoint.getComponentNameSpace());
                            if (lcc != null) {
                                lcc.getActivationSpec().setDestinationEndpoint(provider.getEndpointName());
                                lcc.getActivationSpec().setDestinationService(provider.getServiceName());
                            }
                            else {
                                throw new DeploymentException(
                                        "Unable to build connections, can't find consumer based on component name space "
                                                + endPoint.getComponentNameSpace());
                            }
                        }
                        else {
                            throw new DeploymentException(
                                    "Unable to build connections, can't find consumer with servicename "
                                            + consumer.getServiceName() + " and endpoint " + consumer.getEndpointName());
                        }
                    }
                }
View Full Code Here

                        }
                    }
                    catch (Exception e) {
                        String errStr = "Failed to update Service Assembly: " + name;
                        log.error(errStr, e);
                        throw new DeploymentException(errStr, e);
                    }
                }
            }
            finally {
                container.getBroker().resume();
View Full Code Here

                        }
                    }
                    catch (Exception e) {
                        String errStr = "Failed to update Service Assembly: " + name;
                        log.error(errStr, e);
                        throw new DeploymentException(errStr, e);
                    }
                }
            }
            finally {
                container.getBroker().resume();
            }
        }
        else {
            throw new DeploymentException("remove archive  cannot find descriptor for " + location);
        }
    }
View Full Code Here

                // assume it's a URL
                try {
                    URL url = new URL(location);
                    String fileName = url.getFile();
                    if (fileName == null || (!fileName.endsWith(".zip") && !fileName.endsWith(".jar"))) {
                        throw new DeploymentException("Location: " + location + " is not an archive");
                    }
                    file = FileUtil.unpackArchive(url, tmpRoot);
                }
                catch (MalformedURLException e) {
                    throw new DeploymentException(e);
                }
            }
            if (FileUtil.archiveContainsEntry(file, AutoDeploymentService.DESCRIPTOR_FILE)) {
                tmpDir = FileUtil.createUniqueDirectory(tmpRoot, file.getName());
                FileUtil.unpackArchive(file, tmpDir);
                log.info("Unpacked archive " + location + " to " + tmpDir);
            }
        }
        catch (IOException e) {
            log.error("I/O error installing archive", e);
            throw new DeploymentException(e);
        }
        return tmpDir;
    }
View Full Code Here

    public void start(String serviceUnitName) throws DeploymentException {
        System.out.println("ServiceMixComponent: start: " + serviceUnitName);
        ServiceMixServiceUnit unit = (ServiceMixServiceUnit) serviceUnitRegistry.get(serviceUnitName);
        if( unit == null )
            throw new DeploymentException("Service Unit not registered: "+serviceUnitName);
        try {
            unit.start();
        } catch (Exception e) {
            throw new DeploymentException(e.getMessage(), e);
        }
    }
View Full Code Here

    public void stop(String serviceUnitName) throws DeploymentException {
        System.out.println("ServiceMixComponent: stop: " + serviceUnitName);
        ServiceMixServiceUnit unit = (ServiceMixServiceUnit) serviceUnitRegistry.get(serviceUnitName);
        if( unit == null )
            throw new DeploymentException("Service Unit not registered: "+serviceUnitName);
        try {
            unit.stop();
        } catch (JBIException e) {
            throw new DeploymentException(e.getMessage(), e);
        }
    }
View Full Code Here

    public void shutDown(String serviceUnitName) throws DeploymentException {
        System.out.println("ServiceMixComponent: shutDown: " + serviceUnitName);
        ServiceMixServiceUnit unit = (ServiceMixServiceUnit) serviceUnitRegistry.remove(serviceUnitName);
        if( unit == null )
            throw new DeploymentException("Service Unit not registered: "+serviceUnitName);
        unit.shutdown();
    }
View Full Code Here

    public String undeploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException {
        System.out.println("ServiceMixComponent: undeploy: " + serviceUnitName);
        ServiceMixServiceUnit unit = (ServiceMixServiceUnit) serviceUnitRegistry.remove(serviceUnitName);
        if( unit == null )
            throw new DeploymentException("Service Unit not registered: "+serviceUnitName);
        unit.undeploy();
        return null;
    }
View Full Code Here

  public void start(String serviceUnitName) throws DeploymentException {
    try {
      component.getEndPointRegistry().activeServiceUnitEndpoints(
          serviceUnitName);
    } catch (JBIException e) {
      throw new DeploymentException(
          "Unable to activate service unit endpoints for "
              + serviceUnitName, 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.