Package org.apache.airavata.wsmg.client

Examples of org.apache.airavata.wsmg.client.WseMsgBrokerClient


        this.workflow = workflow;
        this.brokerURL = configuration.getBrokerURL();
        this.topic = configuration.getTopic();
        this.pullMode = true;
        this.messageBoxURL = configuration.getMessageBoxURL();
        this.wseClient = new WseMsgBrokerClient();
        this.wseClient.init(this.brokerURL.toString());
        this.workflowInterpreterConfiguration = WorkflowInterpreter.getWorkflowInterpreterConfiguration();
        this.workflowNodeStatusUpdater = new WorkflowNodeStatusUpdater(this.workflowInterpreterConfiguration.getRegistry());
        this.workflowStatusUpdater = new WorkflowStatusUpdater(this.workflowInterpreterConfiguration.getRegistry());
    }
View Full Code Here


            if (logger.isDebugEnabled())
                logger.info("\n\nStopping the Messagebox for topic" + this.topic);
        }

        try {
            WseMsgBrokerClient client = new WseMsgBrokerClient();
            client.init(this.brokerURL.toString());
            client.unSubscribe(this.subscriptionId);

            MsgboxHandler msgboxHandler = new MsgboxHandler();

            logger.info("Unsubscribing the messagebox that was destroyed," + " SubscriptionID:" + this.subscriptionId);
View Full Code Here

    public Subscription renewMessageboxSubscription(String epr, String subscriptionId, String topic, String xpath,
            boolean subscribePermanatly) throws MsgBrokerClientException {

        this.subscriptionId = subscriptionId;
        this.topic = topic;
        WseMsgBrokerClient wseClient = new WseMsgBrokerClient();
        EndpointReference endpointReference = null;
        try {
            endpointReference = EndpointReferenceHelper.fromString(epr);
        } catch (AxisFault f) {
            throw new MsgBrokerClientException("unable to convert end point reference", f);
View Full Code Here

    public Subscription renewMessageboxSubscription(EndpointReference endpointReference, String subscriptionId,
            String topic, String xpath, boolean subscribePermanatly) throws MsgBrokerClientException {

        this.subscriptionId = subscriptionId;
        this.topic = topic;
        WseMsgBrokerClient wseClient = new WseMsgBrokerClient();
        logger.info("\n\nCreate Subscription for topic" + topic + " [Messagebox]\n\n");

        subscriptionId = subscribeToBroker(endpointReference.getAddress(), topic, xpath, wseClient, subscribePermanatly);
        Subscription subscription = new Subscription(this, subscriptionId, topic, callback, this.brokerURL);
        subscription.setMessageBoxEpr(endpointReference);
View Full Code Here

    public Subscription startListeningToPreviousMessageBox(EndpointReference msgBoxAddr, String subscriptionId,
            String topic, String xpath, Callback callback, boolean subscribePermanatly) throws MsgBrokerClientException {
        this.callback = callback;
        this.subscriptionId = subscriptionId;
        this.topic = topic;
        WseMsgBrokerClient wseClient = new WseMsgBrokerClient();
        MsgboxHandler msgboxHandler = new MsgboxHandler();

        messagePuller = msgboxHandler.startPullingFromExistingMsgBox(msgBoxAddr, this, 500L, 1000L);
        if (logger.isDebugEnabled())
            logger.info("\n\nCreate Subscription for topic" + topic + " [Messagebox]\n\n");
View Full Code Here

    public Subscription createSubscription(String topic, String xpath, Callback callback, boolean subscribePermananly)
            throws Exception {
        this.topic = topic;
        this.callback = callback;

        WseMsgBrokerClient wseClient = new WseMsgBrokerClient();
        MsgboxHandler msgboxHandler = new MsgboxHandler();
        EndpointReference msgBoxAddr = msgboxHandler.createPullMsgBox(this.messageBoxUrl, 12000l);

        String messageBoxAddress = msgBoxAddr.getAddress();
        if (logger.isDebugEnabled())
View Full Code Here

            boolean subscribePermanatly) throws MsgBrokerClientException {

        this.topic = topic2;
        this.callback = callback2;

        WseMsgBrokerClient wseClient = new WseMsgBrokerClient();
        MsgboxHandler msgboxHandler = new MsgboxHandler();
        EndpointReference msgBoxAddr = msgboxHandler.createPullMsgBox(this.messageBoxUrl, 12000l);
        if (logger.isDebugEnabled())
            logger.info("\n\nCreated Messagebox at address :" + msgBoxAddr.getAddress());
View Full Code Here

        ConfigKeys.TOPIC_XPATH, "/c/b/a");
    String consumerLocation = configurations.getProperty(
        ConfigKeys.CONSUMER_EPR,
        "http://localhost:2222/axis2/services/ConsumerService");

    WseMsgBrokerClient client = new WseMsgBrokerClient();
    client.init(brokerLocation);
    System.out.println("subscribing with xpath expression: "
        + xpathExpression);

    // create a topic subscription.
    String subscriptionId = client.subscribe(consumerLocation, null,
        xpathExpression);

    System.out.println("xpath subscription id : " + subscriptionId);
  }
View Full Code Here

    String[] consumerEprs = null;

    String subscriptionId = null;

    WseMsgBrokerClient client = new WseMsgBrokerClient();
    client.init(brokerLocation);
    try {
      consumerEprs = client.startConsumerService(consumerPort,
          msgReciever);

    } catch (MsgBrokerClientException e) {

      e.printStackTrace();

      System.out.println("unable to start consumer service, exiting");
      return;
    }

    try {

      subscriptionId = client.subscribe(consumerEprs[0], null,
          xpathExpression);
      System.out.println(getName() + "got the subscription id :"
          + subscriptionId);

    } catch (MsgBrokerClientException e) {

      e.printStackTrace();

      System.out
          .println("unable to subscribe for the xpath consumer exiting");
      return;
    }

    try {

      do {

        SOAPEnvelope env = msgReciever.getQueue().take();

        String msg;
        try {
          msg = env.getBody().getFirstElement().toStringWithConsume();
          System.out.println(String.format(
              "consumer [%s] recieved: %s", getName(), msg));

        } catch (Exception e) {
          System.err.print("invalid msg recieved");
        }

      } while (true);

    } catch (InterruptedException ie) {

      try {
        // unsubscribe from the topic.
        client.unSubscribe(subscriptionId);
       
      } catch (MsgBrokerClientException e) {

        e.printStackTrace();
        System.out.println("unable to unsubscribe, ignoring");
      }

      // shutdown the consumer service.
      client.shutdownConsumerService();

      System.out.println("interrupted");

    }
View Full Code Here

        ConfigKeys.TOPIC_SIME, "SampleSimpleTopic");
    String consumerLocation = configurations.getProperty(
        ConfigKeys.CONSUMER_EPR,
        "http://localhost:2222/axis2/services/ConsumerService");

    WseMsgBrokerClient client = new WseMsgBrokerClient();
    client.init(brokerLocation);
    // create a topic subscription.
    String subscriptionId = client.subscribe(consumerLocation,
        topicExpression, null);

    System.out.println("subscription id : " + subscriptionId);
  }
View Full Code Here

TOP

Related Classes of org.apache.airavata.wsmg.client.WseMsgBrokerClient

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.