Package javax.jbi.management

Examples of javax.jbi.management.DeploymentException


                if (endpointClass.isInstance(endpoint)) {
                    valid = true;
                }
            }
            if (!valid) {
                throw new DeploymentException("The endpoint: " + endpoint
                        + " is not an instance of any of the allowable types: " + Arrays.asList(endpointClasses));
            }
        }
    }
View Full Code Here


    }

    public void validate() throws DeploymentException {
        super.validate();
        if (uri == null && (getClientPool() == null || getClientPool().getHost() == null)) {
            throw new DeploymentException("Property uri or clientPool.host must be configured");
        }
        if (uri != null && getClientPool() != null && getClientPool().getHost() != null) {
            throw new DeploymentException("Properties uri and clientPool.host can not be configured at the same time");
        }
    }
View Full Code Here

   
    public void validate() throws DeploymentException {
        super.validate();
        if (trigger instanceof JobDetailAwareTrigger) {
            if (jobDetail != null) {
                throw new DeploymentException("jobDetail can not be set on endpoint and trigger at the same time");
            }
            jobDetail = ((JobDetailAwareTrigger) trigger).getJobDetail();
        }
        if (jobDetail == null) {
            JobDetailBean j = new JobDetailBean();
            j.setName(EndpointSupport.getKey(this));
            jobDetail = j;
        }
        if (triggers == null) {
            triggers = new ArrayList<Trigger>();
        }
        if (trigger != null && triggers != null && triggers.size() > 0) {
            throw new DeploymentException("trigger and triggers can not be set at the same time");
        }
        if (trigger != null) {
            triggers.add(trigger);
        }
        if (calendars == null) {
            calendars = new HashMap<String, Calendar>();
        }
        for (Trigger t : triggers) {
            if (t.getCalendarName() != null && calendars.get(t.getCalendarName()) == null) {
                throw new DeploymentException("Trigger references an unknown calendar " + t.getCalendarName());
            }
            t.setJobName(jobDetail.getName());
            t.setJobGroup(jobDetail.getGroup());
        }
    }
View Full Code Here

    }

    public void addEndpoint(Endpoint endpoint) throws DeploymentException {
        String key = EndpointSupport.getKey(endpoint);
        if (this.endpoints.put(key, endpoint) != null) {
            throw new DeploymentException(
                    "More than one endpoint found in the SU for key: " + key);
        }
        if (this.status == LifeCycleMBean.STARTED) {
            try {
                endpoint.activate();
            } catch (Exception e) {
                throw new DeploymentException(e);
            }
        }
    }
View Full Code Here

        }
    }

    public void removeEndpoint(Endpoint endpoint) throws DeploymentException {
        if (this.endpoints.remove(endpoint) != null) {
            throw new DeploymentException("Endpoint not found in the SU for key: " + EndpointSupport.getKey(endpoint));
        }
        if (this.status == LifeCycleMBean.STARTED) {
            try {
                endpoint.deactivate();
            } catch (Exception e) {
                throw new DeploymentException(e);
            }
        }
    }
View Full Code Here

        if (isAutoCreateDirectory() && !file.exists()) {
            file.mkdirs();
        }
        if (archive != null) {
            if (!deleteFile) {
                throw new DeploymentException("Archive shouldn't be specified unless deleteFile='true'");
            }
            if (isAutoCreateDirectory() && !archive.exists()) {
                archive.mkdirs();
            }
            if (!archive.isDirectory()) {
                throw new DeploymentException("Archive should refer to a directory");
            }
        }
        super.init();
    }
View Full Code Here

        // There is no initialized state, so after deployment, the SU
        // is shutdown but may need a cleanup.
        try {
            su.shutDown();
        } catch (JBIException e) {
            throw new DeploymentException("Unable to shutDown service unit", e);
        }
    }
View Full Code Here

            if (endpointClasses[i].isInstance(endpoint)) {
                super.validate(endpoint);
                return;
            }
        }
        throw new DeploymentException("Endpoint is not of type: " + Arrays.asList(endpointClasses) + " but is of type: " + endpoint.getClass());
    }
View Full Code Here


    @Override
    public void validate() throws DeploymentException {
        if (wsdl == null) {
            throw new DeploymentException("wsdl property must be set");
        }
        HttpSoapProviderMarshaler marshaler = new HttpSoapProviderMarshaler();
        try {
            description = DomUtil.parse(wsdl.getInputStream());
            Element elem = description.getDocumentElement();
            if (WSDLUtils.WSDL1_NAMESPACE.equals(elem.getNamespaceURI())) {
                validateWsdl1(marshaler);
            } else if (WSDLUtils.WSDL2_NAMESPACE.equals(elem.getNamespaceURI())) {
                validateWsdl2(marshaler);
            } else {
                throw new DeploymentException("Unrecognized wsdl namespace: " + elem.getNamespaceURI());
            }
            marshaler.setUseJbiWrapper(useJbiWrapper);
            marshaler.setPolicies(policies);
            setMarshaler(marshaler);
        } catch (DeploymentException e) {
            throw e;
        } catch (Exception e) {
            throw new DeploymentException("Unable to read WSDL from: " + wsdl, e);
        }
        super.validate();
    }
View Full Code Here

    protected void validateWsdl1(HttpSoapProviderMarshaler marshaler) throws WSDLException, IOException, DeploymentException {
        Definition def = WSDLUtils.createWSDL11Reader().readWSDL(wsdl.getURL().toString());
        if (validateWsdl) {
            WSIBPValidator validator = new WSIBPValidator(def);
            if (!validator.isValid()) {
                throw new DeploymentException("WSDL is not WS-I BP compliant: " + validator.getErrors());
            }
        }
        Service svc;
        if (getService() != null) {
            svc = def.getService(getService());
            if (svc == null) {
                throw new DeploymentException("Could not find service '" + getService() + "' in wsdl");
            }
        } else if (def.getServices().size() == 1) {
            svc = (Service) def.getServices().values().iterator().next();
            setService(svc.getQName());
        } else {
            throw new DeploymentException("If service is not set, the WSDL must contain a single service definition");
        }
        Port port;
        if (getEndpoint() != null) {
            port = svc.getPort(getEndpoint());
            if (port == null) {
                throw new DeploymentException("Cound not find port '" + getEndpoint() + "' "
                        + "in wsdl for service '" + getService() + "'");
            }
        } else if (svc.getPorts().size() == 1) {
            port = (Port) svc.getPorts().values().iterator().next();
            setEndpoint(port.getName());
        } else {
            throw new DeploymentException("If endpoint is not set, the WSDL service '" + getService() + "' "
                                             + "must contain a single port definition");
        }
        SOAPAddress sa11 = WSDLUtils.getExtension(port, SOAPAddress.class);
        SOAP12Address sa12 = WSDLUtils.getExtension(port, SOAP12Address.class);
        if (sa11 != null) {
            marshaler.setBaseUrl(sa11.getLocationURI());
        } else if (sa12 != null) {
            marshaler.setBaseUrl(sa12.getLocationURI());
        } else {
            throw new DeploymentException("No SOAP address defined on port '" + port.getName() + "'");
        }
        description = WSDLUtils.getWSDL11Factory().newWSDLWriter().getDocument(def);
        marshaler.setBinding(BindingFactory.createBinding(port));
    }
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.