Package org.apache.airavata.workflow.tracking.client

Examples of org.apache.airavata.workflow.tracking.client.Callback


    private boolean wait = true;

    public void testMessagePulling() throws Exception {
        Subscription subscription = null;

        Callback testCallback1 = new Callback() {
            public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
                System.out.println("Notification Received, notification of type:" + type);
                // assertEquals(type, NotificationType.WorkflowInitialized);
                wait = false;
            }
        };

        subscription = LeadNotificationManager.createMessageBoxSubscription(MESSAGEBOX_URL, BROKER_URL, TEST_TOPIC,
                null, testCallback1);

        System.out.println(subscription.getMessageBoxEPR());
        System.out.println(subscription.getSubscriptionID());

        WseMsgBrokerClient client = new WseMsgBrokerClient();
        client.init(BROKER_URL);

        OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));

        client.publish(TEST_TOPIC, msg);

        EndpointReference MSG_BOX_EPR = subscription.getMessageBoxEPR();
        System.out.println(MSG_BOX_EPR);
        String subscriptionID = subscription.getSubscriptionID();
        Callback testCallback2 = new Callback() {

            public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {

                System.out.println("Notification Received, notification of type:" + type);
                // This assertion is wrong because type and NotificationType.WorkflowInitialized are two different types
View Full Code Here


    @Override
    public void run() {
        try {
            subscription = LeadNotificationManager.createMessageBoxSubscription(messageboxUrl, brokerURL, topic, null,
                    new Callback() {

                        public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {

                            subCount++;
                            System.out.println("Subscription received " + subCount + "th notification of type:" + type);
View Full Code Here

    }

    @Override
    public void run() {
        try {
            subscription = LeadNotificationManager.createSubscription(brokerURL, topic, new Callback() {

                public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {

                    subCount++;
                    count++;
View Full Code Here

    @Override
    public void run() {
        Subscription subscription = null;
        try {
            subscription = LeadNotificationManager.createMessageBoxSubscription(this.messageboxLocation,
                    this.brokerLocation, this.topic, null, new Callback() {

                        public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {

                            throw new RuntimeException("This piece of code probably shouldnt have been called");
View Full Code Here

        String topic = thread.getTopic();
        System.out.println(epr);
        System.out.println(subscriptionID);

        subscription = LeadNotificationManager.startListeningToSavedSubscription(BROKER_URL, epr, subscriptionID,
                topic, null, new Callback() {

                    public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {

                        System.out.println("Notification Received, notification of type:" + type);
                        System.out.println("Topic[" + topic + "]");
View Full Code Here

    public LoopbackPublisher(Callback listener_, String topic_) {
        super(10, false); // capacity, async
        topic = topic_;
        listener = listener_;
        if (listener == null) {
            listener = new Callback() {
                int count = 0;

                public void deliverMessage(String topic, NotificationType notificationType, XmlObject messageObj) {

                    System.out
View Full Code Here

            };
        }
    }

    public LoopbackPublisher(final PrintStream out_, String topic_) {
        this(new Callback() {
            int count = 0;

            public void deliverMessage(String topic, NotificationType notificationType, XmlObject messageObj) {

                out_.printf(
View Full Code Here

        }
    }

    public static void main(String args[]) {

        LoopbackPublisher publisher = new LoopbackPublisher(new Callback() {
            int count = 0;

            public void deliverMessage(String topic, NotificationType notificationType, XmlObject messageObj) {

                System.out.printf("----\nReceived Message [%d] on topic [%s] of type [%s] with payload:\n[%s]\n====\n",
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.tracking.client.Callback

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.