Package org.wso2.carbon.event.core

Examples of org.wso2.carbon.event.core.Message


    }

    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

//            ActivityEvent<MessageContext> event = null;
//            event = new ActivityThresholdEvent<MessageContext>(eventMsgCtx);
//            ((ActivityThresholdEvent<MessageContext>) event).setResourcePath(ActivityPublisherConstants.BAM_REG_PATH);
//            EventBrokerService<MessageContext> ebs = PublisherUtils.getEventBrokerService();
            EventBroker eb = PublisherUtils.getEventBroker();
            Message message = new Message();
            message.setMessage(eventBody);

            try {
                SuperTenantCarbonContext.startTenantFlow();
                int tenantId = SuperTenantCarbonContext.getCurrentContext(PublisherUtils.getConfigurationContext()).getTenantId();
                SuperTenantCarbonContext.getCurrentContext().setTenantId(tenantId);
View Full Code Here

//        // Create a new event and publish to the event broker service
//        ActivityThresholdEvent<MessageContext> event = new ActivityThresholdEvent<MessageContext>(eventMsgCtx);
//        event.setResourcePath(ActivityPublisherConstants.BAM_REG_PATH);

        EventBroker eb = ActivityPublisherUtils.getEventBroker();
        Message message = new Message();
        message.setMessage(eventElement);

        try {
            SuperTenantCarbonContext.startTenantFlow();
            int tenantId = SuperTenantCarbonContext.getCurrentContext(ActivityPublisherUtils.getConfigurationContextService().getServerConfigContext()).getTenantId();
            SuperTenantCarbonContext.getCurrentContext().setTenantId(tenantId);
View Full Code Here

    private static Log log = LogFactory.getLog(EventPublisher.class);

    public void process(StatisticData[] statisticData) {
        EventBroker broker = StatisticsServiceComponent.getEventBroker();
        Message message = new Message();

        OMElement eventPayLoad = null;
        for (StatisticData statistic : statisticData) {
            eventPayLoad = constructEventPayLoad(statistic);
            message.setMessage(eventPayLoad);
            try {
                SuperTenantCarbonContext.startTenantFlow();
                int tenantId = SuperTenantCarbonContext.getCurrentContext(StatisticsServiceComponent.getConfigurationContext()).getTenantId();
                SuperTenantCarbonContext.getCurrentContext().setTenantId(tenantId);
                SuperTenantCarbonContext.getCurrentContext().getTenantDomain(true);
View Full Code Here

     * @throws UsageException
     */
    public static void publish(BandwidthUsage usage) throws UsageException {

        OMElement statMessage;
        Message message;

        // get the event payload
        try {
            statMessage = PublisherUtils.getEventPayload(usage);
            message = new Message();
            message.setMessage(statMessage);
        } catch (Exception e) {
            log.error("Failed to get usage event payload", e);
            return;
        }

View Full Code Here

    }

    private void fireEvent(OMElement statMessage) {
        try {

            Message message = new Message();
            message.setMessage(statMessage);

            int tenantId = NO_TENANT_MODE;
            EventBroker broker = PublisherUtils.getEventBroker();
            try {
                SuperTenantCarbonContext.startTenantFlow();
View Full Code Here

TOP

Related Classes of org.wso2.carbon.event.core.Message

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.