Package org.apache.stratos.messaging.event.tenant

Examples of org.apache.stratos.messaging.event.tenant.CompleteTenantEvent


            if(TenantManager.getInstance().isInitialized()) {
                return false;
            }

            // Parse complete message and build event
            CompleteTenantEvent event = (CompleteTenantEvent) Util.jsonToObject(message, CompleteTenantEvent.class);

            try {
                TenantManager.acquireWriteLock();
                TenantManager.getInstance().addTenants(event.getTenants());
                if(log.isInfoEnabled()) {
                    log.info("Tenant initialized");
                }
                TenantManager.getInstance().setInitialized(true);
View Full Code Here


                        tenant.addServiceSubscription(subscription.getType());
                    }
                }
                tenants.add(tenant);
            }
            CompleteTenantEvent event = new CompleteTenantEvent(tenants);
            EventPublisher eventPublisher = EventPublisherPool.getPublisher(Constants.TENANT_TOPIC);
            eventPublisher.publish(event);
        } catch (Exception e) {
            if (log.isErrorEnabled()) {
                log.error("Could not publish complete tenant event", e);
View Full Code Here

    private void addEventListeners() {
        tenantEventReceiver.addEventListener(new CompleteTenantEventListener() {
            @Override
            protected void onEvent(Event event) {
                CompleteTenantEvent completeTenantEvent = (CompleteTenantEvent) event;
                for (Tenant tenant : completeTenantEvent.getTenants()) {
                    for (String serviceName : tenant.getServiceSubscriptions()) {
                        if(isMultiTenantService(serviceName)) {
                            addTenantSubscriptionToLbContext(serviceName, tenant.getTenantId());
                        }
                    }
View Full Code Here

TOP

Related Classes of org.apache.stratos.messaging.event.tenant.CompleteTenantEvent

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.