Examples of EventBrokerException


Examples of org.wso2.carbon.event.core.exception.EventBrokerException

            // we persists a subscription only if it has a event dispatcher
            // name. the subscriptions with only an event dispatcher is not persisted.
            this.subscriptionManager.addSubscription(subscription);
        } else {
            if (subscription.getEventDispatcher() == null){
                throw new EventBrokerException(" subscription url, event " +
                        "dispatcher name and event dispatcher is null");
            }
        }
        return subscription.getId();
    }
View Full Code Here

Examples of org.wso2.carbon.event.core.exception.EventBrokerException

            this.topicSubscriber.close();
            this.topicSession.close();
            this.topicConnection.stop();
            this.topicConnection.close();
        } catch (JMSException e) {
            throw new EventBrokerException("Can not close connections ", e);
        }

    }
View Full Code Here

Examples of org.wso2.carbon.event.core.exception.EventBrokerException

            subscription.getEventDispatcher().notify(message, subscription);
        } else if (subscription.getEventDispatcherName() != null){
            EventDispatcher eventDispatcher =
                    this.eventDispatchMap.get(subscription.getEventDispatcherName());
            if (eventDispatcher == null){
                throw new EventBrokerException("Event dispatcher with name "
                        + subscription.getEventDispatcherName() + " is not exists");
            }
            eventDispatcher.notify(message, subscription);
        } else {
            throw new EventBrokerException("Can not send the notification ");
        }

    }
View Full Code Here

Examples of org.wso2.carbon.event.ws.internal.exception.EventBrokerException

        }
        try {
            mc.setEnvelope(envelope);
        } catch (Exception e) {

            throw new EventBrokerException("Unable to generate event.", e);
        }
        return mc;
    }
View Full Code Here

Examples of org.wso2.carbon.eventing.broker.exceptions.EventBrokerException

    public static boolean generateEvent(OMElement payload, OMElement topic,
                                        EventBrokerService brokerService, int tenantId)
            throws EventBrokerException {
        if (payload == null) {
            throw new EventBrokerException("Unable to generate event. No payload was given.");
        }
        CarbonEventingMessageReceiver dummyReceiver = new CarbonEventingMessageReceiver();
        if (brokerService != null) {
            dummyReceiver.setBrokerService(brokerService);
        }
        MessageContext mc = new MessageContext();
        SuperTenantCarbonContext.getCurrentContext(mc).setTenantId(tenantId);
        SOAPFactory soapFactory = new SOAP12Factory();
        SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
        envelope.getBody().addChild(payload);
        if (topic != null) {
            envelope.getHeader().addChild(topic);
        }
        try {
            mc.setEnvelope(envelope);
            dummyReceiver.processMessage(mc);
        } catch (Exception e) {
            if (e instanceof EventBrokerException) {
                throw (EventBrokerException)e;
            }
            throw new EventBrokerException("Unable to generate event.", e);
        }
        return true;
    }
View Full Code Here

Examples of org.wso2.carbon.eventing.broker.exceptions.EventBrokerException

        } catch (EventException e) {
            if (e instanceof EventBrokerException) {
                throw (EventBrokerException)e;
            } else {
                log.error("Unable to publish event.", e);
                throw new EventBrokerException("Unable to publish event.", e);
            }
        }
    }
View Full Code Here

Examples of org.wso2.carbon.eventing.broker.exceptions.EventBrokerException

        } catch (EventException e) {
            if (e instanceof EventBrokerException) {
                throw (EventBrokerException)e;
            } else {
                log.error("Unable to register event dispatcher.", e);
                throw new EventBrokerException("Unable to register event dispatcher.", e);
            }
        }
    }
View Full Code Here

Examples of org.wso2.carbon.eventing.broker.exceptions.EventBrokerException

     * @return subscription ID
     * @throws EventBrokerException if the operation fails
     */
    public String subscribe(Subscription subscription) throws EventBrokerException {
        if (subManager == null) {
            throw new EventBrokerException("Subscription Manager not Registered");
        }
        try {
            return subManager.subscribe(subscription);
        } catch (EventException e) {
            if (e instanceof EventBrokerException) {
                throw (EventBrokerException)e;
            } else {
                log.error("Subscribe operation failed.", e);
                throw new EventBrokerException("Subscribe operation failed.", e);
            }
        }
    }
View Full Code Here

Examples of org.wso2.carbon.eventing.broker.exceptions.EventBrokerException

     * @return true|false based on the transaction
     * @throws EventBrokerException if the operation fails
     */
    public boolean unsubscribe(String subscriptionID) throws EventException {
        if (subManager == null) {
            throw new EventBrokerException("Subscription Manager not Registered");
        }
        try {
            return subManager.unsubscribe(subscriptionID);
        } catch (EventException e) {
            if (e instanceof EventBrokerException) {
                throw (EventBrokerException)e;
            } else {
                log.error("Unsubscribe operation failed.", e);
                throw new EventBrokerException("Unsubscribe operation failed.", e);
            }
        }
    }
View Full Code Here

Examples of org.wso2.carbon.eventing.broker.exceptions.EventBrokerException

     * @return subscription if found.
     * @throws EventBrokerException if the operation fails
     */
    public Subscription getStatus(String subscriptionID) throws EventException {
        if (subManager == null) {
            throw new EventBrokerException("Subscription Manager not Registered");
        }
        try {
            return subManager.getStatus(subscriptionID);
        } catch (EventException e) {
            if (e instanceof EventBrokerException) {
                throw (EventBrokerException)e;
            } else {
                log.error("Get Status operation failed.", e);
                throw new EventBrokerException("Get Status operation failed.", e);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.