Package org.wso2.carbon.brokermanager.core.exception

Examples of org.wso2.carbon.brokermanager.core.exception.BMConfigurationException


    }

    public byte[] getProcessImage(String processId) {

        QName qName = decode(processId);
        SVGInterface svg = createSVG(qName);
        return svg.toPNGBytes();
    }
View Full Code Here


    private SVGInterface createSVG(QName qName) {

        // generate new
        InputStream in = getBpelDescriptor(qName);

        SVGInterface svg = null;

        try {
            svg = BPEL2SVGUtil.generate(in);

            if (svg == null)
View Full Code Here

   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

        // get registry object
        try {
             registry = RegistryHolder.getInstance().getRegistry(tenantId);
        } catch (RegistryException e) {
           log.error("Error in getting registry for the super tenant");
           throw new BMConfigurationException("Error in getting registry for the super tenant", e);
        }
        try {
            // create broker base if not exists
            if (!registry.resourceExists(BROKER_BASE)) {
                registry.put(BROKER_BASE, registry.newCollection());
            }
        } catch (RegistryException e) {
            if (log.isErrorEnabled()) {
                log.error("Failed to create new collection in registry", e);
            }
            throw new BMConfigurationException("Failed to create new collection in registry", e);
        }
    }
View Full Code Here

        Registry registry = null;
        try {
            registry = RegistryHolder.getInstance().getRegistry(tenantId);
        } catch (RegistryException e) {
           log.error("Error in getting registry for the tenant :" + tenantId ,e);
            throw new BMConfigurationException("Error in getting registry for the tenant :"+tenantId ,e);
        }
        try {
            brokerResource = registry.newResource();
            Map<String, String> propertyMap = brokerConfiguration.getProperties();
            brokerResource.addProperty("name", brokerConfiguration.getName());
            brokerResource.addProperty("type", brokerConfiguration.getType());
            for (Map.Entry<String, String> entry : propertyMap.entrySet()) {
                brokerResource.addProperty(entry.getKey(), entry.getValue());
            }
        } catch (RegistryException e) {
            if (log.isErrorEnabled()) {
                log.error("Failed to create new resource in registry", e);
            }
            throw new BMConfigurationException("Failed to create new resource in registry", e);
        }
        try {
            registry.put(pathToBroker, brokerResource);
        } catch (RegistryException e) {
            if (log.isErrorEnabled()) {
                log.error("Failed to saveConfigurationToRegistry new resource in registry", e);
            }
            throw new BMConfigurationException("Failed to saveConfigurationToRegistry new resource in registry", e);
        }
    }
View Full Code Here

            }
        } catch (RegistryException e) {
            if (log.isErrorEnabled()) {
                log.error("Failed to removeConfigurationFromRegistry " + name + " from registry.");
            }
            throw new BMConfigurationException("Failed to removeConfigurationFromRegistry " + name + " from registry.", e);
        }
    }
View Full Code Here

            }
        } catch (RegistryException e) {
            if (log.isErrorEnabled()) {
                log.error("Failed to get resource with path " + BROKER_BASE);
            }
            throw new BMConfigurationException("Failed to get resource with path " + BROKER_BASE , e);
        }
        return brokerConfigurationMap;
    }
View Full Code Here

        OMElement brokerManagerConfig = loadConfigXML();

        if (brokerManagerConfig != null) {
            if (!brokerManagerConfig.getQName().equals(new QName(BMConstants.BM_CONF_NS,
                    BMConstants.BM_ELE_ROOT_ELEMENT))) {
                throw new BMConfigurationException("Invalid root element "
                        + brokerManagerConfig.getQName());
            }
            Iterator brokersIter = brokerManagerConfig.getChildrenWithName(
                    new QName(BMConstants.BM_CONF_NS, BMConstants.BM_ELE_BROKER_CONFIGURATION));
            for (; brokersIter.hasNext();) {
View Full Code Here

TOP

Related Classes of org.wso2.carbon.brokermanager.core.exception.BMConfigurationException

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.