Examples of CarbonBrokerService


Examples of org.wso2.carbon.broker.core.internal.CarbonBrokerService

     * @return
     * @throws BrokerConfigException
     */
    public static BrokerService createBrokerService() throws BrokerConfigException {

        CarbonBrokerService brokerService = new CarbonBrokerService();
        OMElement brokerConfig = loadConfigXML();
        if (brokerConfig != null) {
            if (!brokerConfig.getQName().equals(
                    new QName(BrokerConstants.BROKER_CONF_NS, BrokerConstants.BROKER_CONF_ELE_ROOT))) {
                throw new BrokerConfigException("Broker config exception");
            }
            Iterator brokerTypesIter = brokerConfig.getChildrenWithName(
                    new QName(BrokerConstants.BROKER_CONF_NS,
                            BrokerConstants.BROKER_CONF_ELE_BROKER_TYPE));
            for (; brokerTypesIter.hasNext();) {
                OMElement brokerTypeOMElement = (OMElement) brokerTypesIter.next();
                String className = brokerTypeOMElement.getAttributeValue(
                        new QName("", BrokerConstants.BROKER_CONF_ATTR_CLASS));
                registerBrokerType(brokerService, className);
            }
        } else {
            log.info("No broker types are given");
        }

        //by default we add the already existing broker types if they are not added
        List<String> existingBrokerNames = brokerService.getBrokerTypeNames();

        if (!existingBrokerNames.contains(BrokerConstants.BROKER_TYPE_LOCAL)){
            registerBrokerType(brokerService, LocalBrokerTypeFactory.class.getName());
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.