Search in sources :

Example 1 with BrokerRestServer

use of org.wso2.broker.rest.BrokerRestServer in project carbon-apimgt by wso2.

the class BrokerManager method start.

/**
 * Starting the broker
 */
public static void start() {
    try {
        StartupContext startupContext = new StartupContext();
        initConfigProvider(startupContext);
        BrokerConfigProvider service = startupContext.getService(BrokerConfigProvider.class);
        BrokerConfiguration brokerConfiguration = service.getConfigurationObject(BrokerConfiguration.NAMESPACE, BrokerConfiguration.class);
        DataSource dataSource = getDataSource(brokerConfiguration.getDataSource());
        startupContext.registerService(DataSource.class, dataSource);
        restServer = new BrokerRestServer(startupContext);
        broker = new Broker(startupContext);
        broker.startMessageDelivery();
        amqpServer = new Server(startupContext);
        amqpServer.start();
        restServer.start();
        loadUsers();
    } catch (Exception e) {
        log.error("Error while starting broker", e);
    }
}
Also used : StartupContext(org.wso2.broker.common.StartupContext) BrokerRestServer(org.wso2.broker.rest.BrokerRestServer) Broker(org.wso2.broker.core.Broker) Server(org.wso2.broker.amqp.Server) BrokerRestServer(org.wso2.broker.rest.BrokerRestServer) BrokerConfiguration(org.wso2.broker.core.configuration.BrokerConfiguration) BrokerConfigProvider(org.wso2.broker.common.BrokerConfigProvider) ConfigurationException(org.wso2.carbon.config.ConfigurationException) HikariDataSource(com.zaxxer.hikari.HikariDataSource) DataSource(javax.sql.DataSource)

Aggregations

HikariDataSource (com.zaxxer.hikari.HikariDataSource)1 DataSource (javax.sql.DataSource)1 Server (org.wso2.broker.amqp.Server)1 BrokerConfigProvider (org.wso2.broker.common.BrokerConfigProvider)1 StartupContext (org.wso2.broker.common.StartupContext)1 Broker (org.wso2.broker.core.Broker)1 BrokerConfiguration (org.wso2.broker.core.configuration.BrokerConfiguration)1 BrokerRestServer (org.wso2.broker.rest.BrokerRestServer)1 ConfigurationException (org.wso2.carbon.config.ConfigurationException)1