Package org.apache.airavata.workflow.tracking.impl.publish

Examples of org.apache.airavata.workflow.tracking.impl.publish.NotificationPublisher


    }

    protected void sendNotification(WorkflowTrackingContext context, XmlObject xmldata,
            String[] descriptionAndAnnotation, String defaultDesc) {
        BaseNotificationType xmlMessage = XmlBeanUtils.extractBaseNotificationType(xmldata);
        NotificationPublisher publisher = publishermap.get(context.getBrokerEpr());
        try {
            if (publisher == null) {
                // if a publisher class name has been defined to override the default WSM publisher, use it
                if (context.getPublisherImpl() != null) {
                    publisher = PublisherFactory.createSomePublisher(context.getPublisherImpl(), context);
                } else {
                    if (context.getTopic() == null) {
                        publisher = new WSMPublisher(100, context.isEnableAsyncPublishing(), context.getBrokerEpr()
                                .getAddress(), false);
                    } else {
                        publisher = new WSMPublisher(100, context.isEnableAsyncPublishing(), context.getBrokerEpr()
                                .getAddress(), context.getTopic());
                    }
                }
                publishermap.put(context.getBrokerEpr(), publisher);
            }

            setIDAndTimestamp(context, xmlMessage, context.getMyself(), activityTimestamp != null ? activityTimestamp
                    : new Date());
            setDescAndAnno(context, xmlMessage, descriptionAndAnnotation, defaultDesc);
            xmlMessage.getNotificationSource().setExperimentID(context.getTopic());
            // System.out.println(xmldata);
            if (log.isDebugEnabled()) {
                log.debug(xmldata.toString());
            }
            publisher.publish(xmldata);
        } catch (RuntimeException e) {
            throw new WorkflowTrackingException(e);
        } catch (IOException e) {
            throw new WorkflowTrackingException(e);
        }
View Full Code Here


    }

    protected void sendNotification(WorkflowTrackingContext context, XmlObject xmldata,
            String[] descriptionAndAnnotation, String defaultDesc) {
        BaseNotificationType xmlMessage = XmlBeanUtils.extractBaseNotificationType(xmldata);
        NotificationPublisher publisher = publishermap.get(context.getBrokerEpr());
        try {
            if (publisher == null) {
                // if a publisher class name has been defined to override the default WSM publisher, use it
                if (context.getPublisherImpl() != null) {
                    publisher = PublisherFactory.createSomePublisher(context.getPublisherImpl(), context);
                } else {
                    if (context.getTopic() == null) {
                        publisher = new WSMPublisher(100, context.isEnableAsyncPublishing(), context.getBrokerEpr()
                                .getAddress(), false);
                    } else {
                        publisher = new WSMPublisher(100, context.isEnableAsyncPublishing(), context.getBrokerEpr()
                                .getAddress(), context.getTopic());
                    }
                }
                publishermap.put(context.getBrokerEpr(), publisher);
            }

            setIDAndTimestamp(context, xmlMessage, context.getMyself(), activityTimestamp != null ? activityTimestamp
                    : new Date());
            setDescAndAnno(context, xmlMessage, descriptionAndAnnotation, defaultDesc);
            // System.out.println(xmldata);
            if (log.isDebugEnabled()) {
                log.debug(xmldata.toString());
            }
            publisher.publish(xmldata);
        } catch (RuntimeException e) {
            throw new WorkflowTrackingException(e);
        } catch (IOException e) {
            throw new WorkflowTrackingException(e);
        }
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.tracking.impl.publish.NotificationPublisher

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.