Search in sources :

Example 1 with ComponentType

use of com.alipay.sofa.runtime.model.ComponentType in project sofa-boot by alipay.

the class ComponentManagerImpl method _typeRegistry.

protected void _typeRegistry(ComponentInfo componentInfo) {
    ComponentName name = componentInfo.getName();
    if (name != null) {
        ComponentType type = name.getType();
        Map<ComponentName, ComponentInfo> typesRi = resolvedRegistry.get(type);
        if (typesRi == null) {
            resolvedRegistry.putIfAbsent(type, new HashMap<ComponentName, ComponentInfo>());
            typesRi = resolvedRegistry.get(type);
        }
        typesRi.put(name, componentInfo);
    }
}
Also used : ComponentType(com.alipay.sofa.runtime.model.ComponentType) ComponentName(com.alipay.sofa.runtime.api.component.ComponentName) ComponentInfo(com.alipay.sofa.runtime.spi.component.ComponentInfo)

Example 2 with ComponentType

use of com.alipay.sofa.runtime.model.ComponentType in project sofa-boot by alipay.

the class ComponentManagerImpl method unregister.

public void unregister(ComponentInfo componentInfo) throws ServiceRuntimeException {
    ComponentName componentName = componentInfo.getName();
    registry.remove(componentName);
    if (componentName != null) {
        ComponentType componentType = componentName.getType();
        Map<ComponentName, ComponentInfo> typesRi = resolvedRegistry.get(componentType);
        typesRi.remove(componentName);
    }
    componentInfo.unregister();
}
Also used : ComponentType(com.alipay.sofa.runtime.model.ComponentType) ComponentName(com.alipay.sofa.runtime.api.component.ComponentName) ComponentInfo(com.alipay.sofa.runtime.spi.component.ComponentInfo)

Aggregations

ComponentName (com.alipay.sofa.runtime.api.component.ComponentName)2 ComponentType (com.alipay.sofa.runtime.model.ComponentType)2 ComponentInfo (com.alipay.sofa.runtime.spi.component.ComponentInfo)2