Examples of WsmgConfigurationContext


Examples of org.apache.airavata.wsmg.config.WsmgConfigurationContext

        Boolean inited = (Boolean) configContext.getProperty(WsmgCommonConstants.BROKER_INITED);

        if (inited == null || inited == false) {
            log.info("Starting Message Broker...");
            Axis2Utils.overrideAddressingPhaseHander(configContext, new PublishedMessageHandler());
            WsmgConfigurationContext brokerConext = initConfigurations(configContext, axisService);
            initQueue(brokerConext);
            initDeliveryMethod(brokerConext.getConfigurationManager());

            inited = true;
            configContext.setProperty(WsmgCommonConstants.BROKER_INITED, inited);
        } else {
            log.debug("init was already done by another webservice");
View Full Code Here

Examples of org.apache.airavata.wsmg.config.WsmgConfigurationContext

        }
    }

    private WsmgConfigurationContext initConfigurations(ConfigurationContext configContext, AxisService axisService) {

        WsmgConfigurationContext wsmgConfig = new WsmgConfigurationContext();
        configContext.setProperty(WsmgCommonConstants.BROKER_WSMGCONFIG, wsmgConfig);

        ConfigurationManager configMan = new ConfigurationManager();

        wsmgConfig.setConfigurationManager(configMan);

        String type = configMan.getConfig(WsmgCommonConstants.CONFIG_STORAGE_TYPE,
                WsmgCommonConstants.STORAGE_TYPE_PERSISTANT);

        /*
         * Determine Storage
         */
        if (WsmgCommonConstants.STORAGE_TYPE_IN_MEMORY.equalsIgnoreCase(type)) {
            WsmgInMemoryStorage inmem = new WsmgInMemoryStorage();

            wsmgConfig.setStorage(inmem);
            wsmgConfig.setQueue(inmem);
            wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, inmem));

        } else {
            String jdbcUrl = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_URL);
            String jdbcDriver = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_DRIVER);
            WsmgPersistantStorage persis = new WsmgPersistantStorage(jdbcUrl, jdbcDriver);

            wsmgConfig.setStorage(persis);
            wsmgConfig.setQueue(persis);
            wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, persis));
        }

        NotificationProcessor notificatonProcessor = new NotificationProcessor(wsmgConfig);
        wsmgConfig.setNotificationProcessor(notificatonProcessor);

        return wsmgConfig;
    }
View Full Code Here

Examples of org.apache.airavata.wsmg.config.WsmgConfigurationContext

        log.debug("WS-Eventing: " + msgType);

        switch (msgType) {
        case SUBSCRIBE: {
            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);

            brokerConfigContext.getSubscriptionManager().subscribe(processingContext);
            outputMsg = createOutputMessageContext(inMsg, processingContext);
            break;
        }
        case UNSUBSCRIBE: {
            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);

            brokerConfigContext.getSubscriptionManager().unsubscribe(processingContext);
            outputMsg = createOutputMessageContext(inMsg, processingContext);
            break;
        }
        case RENEW:
        case GET_STATUS:
View Full Code Here

Examples of org.apache.airavata.wsmg.config.WsmgConfigurationContext

        ProcessingContext processingContext = builder.build(inMsgContext, WsEventingOperations.PUBLISH);

        try {

            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsgContext
                    .getConfigurationContext().getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);

            brokerConfigContext.getNotificationProcessor().processMsg(processingContext, NameSpaceConstants.WSE_NS);
        } catch (Exception e) {
            throw new AxisFault("unable to process message", e);
        }
        return createOutputMessageContext(inMsgContext, processingContext);
    }
View Full Code Here

Examples of org.apache.airavata.wsmg.config.WsmgConfigurationContext

        switch (msgType) {
        case NOTIFY: {
            try {

                WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg
                        .getConfigurationContext().getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);

                brokerConfigContext.getNotificationProcessor()
                        .processMsg(processingContext, NameSpaceConstants.WSNT_NS);
            } catch (Exception e) {
                throw new AxisFault("unable to process message", e);
            }
            outputMsg = createOutputMessageContext(inMsg, processingContext);
            break;
        }
        case SUBSCRIBE: {

            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
            brokerConfigContext.getSubscriptionManager().subscribe(processingContext);
            outputMsg = createOutputMessageContext(inMsg, processingContext);
            break;
        }
        case UNSUBSCRIBE: {

            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);

            brokerConfigContext.getSubscriptionManager().unsubscribe(processingContext);
            outputMsg = createOutputMessageContext(inMsg, processingContext);
            break;
        }
        case RESUME_SUBSCRIPTION: {

            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);

            brokerConfigContext.getSubscriptionManager().resumeSubscription(processingContext);
            outputMsg = createOutputMessageContext(inMsg, processingContext);
            break;
        }
        case PAUSE_SUBSCRIPTION: {
            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);

            brokerConfigContext.getSubscriptionManager().pauseSubscription(processingContext);
            outputMsg = createOutputMessageContext(inMsg, processingContext);
            break;
        }
        case GET_CURRENT_MSG:
        default:
View Full Code Here

Examples of org.apache.airavata.wsmg.config.WsmgConfigurationContext

        Boolean inited = (Boolean) configContext.getProperty(WsmgCommonConstants.BROKER_INITED);

        if (inited == null || inited == false) {
            log.info("starting broker");
            Axis2Utils.overrideAddressingPhaseHander(configContext, new PublishedMessageHandler());
            WsmgConfigurationContext brokerConext = initConfigurations(configContext, axisService);
            initQueue(brokerConext);
            initDeliveryMethod(brokerConext.getConfigurationManager());

            inited = true;
            configContext.setProperty(WsmgCommonConstants.BROKER_INITED, inited);
        } else {
            log.info("init was already done by another webservice");
View Full Code Here

Examples of org.apache.airavata.wsmg.config.WsmgConfigurationContext

        }
    }

    private WsmgConfigurationContext initConfigurations(ConfigurationContext configContext, AxisService axisService) {

        WsmgConfigurationContext wsmgConfig = new WsmgConfigurationContext();
        configContext.setProperty(WsmgCommonConstants.BROKER_WSMGCONFIG, wsmgConfig);

        ConfigurationManager configMan = new ConfigurationManager(
                    WsmgCommonConstants.BROKER_CONFIGURATION_FILE_NAME);

        wsmgConfig.setConfigurationManager(configMan);

        String type = configMan.getConfig(WsmgCommonConstants.CONFIG_STORAGE_TYPE,
                WsmgCommonConstants.STORAGE_TYPE_PERSISTANT);

        /*
         * Determine Storage
         */
        if (WsmgCommonConstants.STORAGE_TYPE_IN_MEMORY.equalsIgnoreCase(type)) {
            WsmgInMemoryStorage inmem = new WsmgInMemoryStorage();

            wsmgConfig.setStorage(inmem);
            wsmgConfig.setQueue(inmem);
            wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, inmem));

        } else {
            String jdbcUrl = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_URL);
            String jdbcDriver = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_DRIVER);
            WsmgPersistantStorage persis = new WsmgPersistantStorage(jdbcUrl, jdbcDriver);

            wsmgConfig.setStorage(persis);
            wsmgConfig.setQueue(persis);
            wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, persis));
        }

        NotificationProcessor notificatonProcessor = new NotificationProcessor(wsmgConfig);
        wsmgConfig.setNotificationProcessor(notificatonProcessor);

        return wsmgConfig;
    }
View Full Code Here

Examples of org.apache.airavata.wsmg.config.WsmgConfigurationContext

        Boolean inited = (Boolean) configContext.getProperty(WsmgCommonConstants.BROKER_INITED);

        if (inited == null || inited == false) {
            log.info("starting broker");
            Axis2Utils.overrideAddressingPhaseHander(configContext, new PublishedMessageHandler());
            WsmgConfigurationContext brokerConext = initConfigurations(configContext, axisService);
            initQueue(brokerConext);
            initDeliveryMethod(brokerConext.getConfigurationManager());

            inited = true;
            configContext.setProperty(WsmgCommonConstants.BROKER_INITED, inited);
        } else {
            log.info("init was already done by another webservice");
View Full Code Here

Examples of org.apache.airavata.wsmg.config.WsmgConfigurationContext

    }
    }

    private WsmgConfigurationContext initConfigurations(ConfigurationContext configContext, AxisService axisService) {

        WsmgConfigurationContext wsmgConfig = new WsmgConfigurationContext();
        configContext.setProperty(WsmgCommonConstants.BROKER_WSMGCONFIG, wsmgConfig);

        ConfigurationManager configMan = new ConfigurationManager("conf" + File.separator
                + WsmgCommonConstants.BROKER_CONFIGURATION_FILE_NAME);

        wsmgConfig.setConfigurationManager(configMan);

        String type = configMan.getConfig(WsmgCommonConstants.CONFIG_STORAGE_TYPE,
                WsmgCommonConstants.STORAGE_TYPE_PERSISTANT);

        /*
         * Determine Storage
         */
        if (WsmgCommonConstants.STORAGE_TYPE_IN_MEMORY.equalsIgnoreCase(type)) {
            WsmgInMemoryStorage inmem = new WsmgInMemoryStorage();

            wsmgConfig.setStorage(inmem);
            wsmgConfig.setQueue(inmem);
            wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, inmem));

        } else {
            String jdbcUrl = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_URL);
            String jdbcDriver = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_DRIVER);
            WsmgPersistantStorage persis = new WsmgPersistantStorage(jdbcUrl, jdbcDriver);

            wsmgConfig.setStorage(persis);
            wsmgConfig.setQueue(persis);
            wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, persis));
        }

        NotificationProcessor notificatonProcessor = new NotificationProcessor(wsmgConfig);
        wsmgConfig.setNotificationProcessor(notificatonProcessor);

        return wsmgConfig;
    }
View Full Code Here

Examples of org.apache.airavata.wsmg.config.WsmgConfigurationContext

        Boolean inited = (Boolean) configContext.getProperty(WsmgCommonConstants.BROKER_INITED);

        if (inited == null || inited == false) {
            log.info("Starting Message Broker...");
            Axis2Utils.overrideAddressingPhaseHander(configContext, new PublishedMessageHandler());
            WsmgConfigurationContext brokerConext = initConfigurations(configContext, axisService);
            initQueue(brokerConext);
            initDeliveryMethod(brokerConext.getConfigurationManager());

            inited = true;
            configContext.setProperty(WsmgCommonConstants.BROKER_INITED, inited);
        } else {
            log.debug("init was already done by another webservice");
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.