Examples of EventBrokerException


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

        this.notifyManager = notifyManager;
        if (notifyManager != null && notifyManager instanceof CarbonNotificationManager) {
            ((CarbonNotificationManager)notifyManager).setEventBroker(this);
            return true;
        } else{
            throw new EventBrokerException("Only support CarbonNotificationManager");
        }
    }
View Full Code Here

Examples of org.wso2.carbon.event.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.event.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.event.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.event.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

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

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

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

    public boolean registerSubscriptionManager(SubscriptionManager subManager)
            throws EventBrokerException {
        if (subManager == null) {
            return false;
        } else if (this.subManager != null) {
            throw new EventBrokerException("Subscription Manager already Registered");
        }
        log.debug("Successfully registered Subscription Manager");
        this.subManager = subManager;
        return true;
    }
View Full Code Here

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

    public boolean registerNotificationManager(NotificationManager notifyManager)
            throws EventBrokerException {
        if (notifyManager == null) {
            return false;
        } else if (this.notifyManager != null) {
            throw new EventBrokerException("Notification Manager already Registered");
        }
        log.debug("Successfully registered Notification Manager");
        this.notifyManager = notifyManager;
        return true;
    }
View Full Code Here

Examples of org.wso2.carbon.event.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 = createMessageContext(payload, topic, tenantId);
        try {
            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.event.broker.exceptions.EventBrokerException

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

            throw new EventBrokerException("Unable to generate event.", e);
        }
        return mc;
    }
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.