Example usage for org.wso2.carbon.kernel.startupresolver StartupServiceUtils updateServiceCache

List of usage examples for org.wso2.carbon.kernel.startupresolver StartupServiceUtils updateServiceCache

Introduction

In this page you can find the example usage for org.wso2.carbon.kernel.startupresolver StartupServiceUtils updateServiceCache.

Prototype

public static void updateServiceCache(String componentName, Class interfaceName) 

Source Link

Document

All the components that are using startup order resolver functionality should call this method once those components receive a reference to a dependent OSGi service.

Usage

From source file:org.wso2.msf4j.deployer.internal.MSF4JDeployerSC.java

License:Open Source License

/**
 * To deploy micro services, we need to have at least one micro service registry in the system.
 * Since microservice registry is added when microservice server is active, added the reference to wait till
 * microservices server is active.// ww  w  .  j a  v  a2  s.co  m
 * Otherwise if deployer registered before at least one registry is added, Deployer will start to deploy services
 * and will fail deployment.
 */
@Reference(name = "microservices-regitry", service = MicroservicesRegistry.class, cardinality = ReferenceCardinality.AT_LEAST_ONE, policy = ReferencePolicy.DYNAMIC, unbind = "removeMicroservicesRegistry")
protected void addMicroservicesRegitry(MicroservicesRegistry registry, Map properties) {
    log.debug("MicroservicesRegistry get registered successfully.");
    DataHolder.getInstance().addMicroserviceRegistry(properties.get(CHANNEL_ID).toString(), registry);
    StartupServiceUtils.updateServiceCache("wso2-microservices-deployer", MicroservicesRegistry.class);
}