class ExtensionComponent extends AbstractComponent {

    private static final Logger       LOGGER                   = SofaBootLoggerFactory
                                                                   .getLogger(ExtensionComponent.class);

    public static final String        LINK_SYMBOL              = "$";

    public static final ComponentType EXTENSION_COMPONENT_TYPE = new ComponentType("extension");

    private final Extension           extension;

    public ExtensionComponent(Extension extension, SofaRuntimeContext sofaRuntimeContext) {
        this.extension = extension;
        this.sofaRuntimeContext = sofaRuntimeContext;
        this.componentName = ComponentNameFactory.createComponentName(
            EXTENSION_COMPONENT_TYPE,
            extension.getTargetComponentName().getName() + LINK_SYMBOL
                    + ObjectUtils.getIdentityHexString(extension));
    }

    @Override
    public ComponentType getType() {
        return EXTENSION_COMPONENT_TYPE;
    }

    @Override
    public boolean resolve() {
        if (componentStatus != ComponentStatus.REGISTERED) {
            return false;
        }

        ComponentManager componentManager = sofaRuntimeContext.getComponentManager();
        ComponentName extensionPointComponentName = extension.getTargetComponentName();

        ComponentInfo extensionPointComponentInfo = componentManager
            .getComponentInfo(extensionPointComponentName);

        if (extensionPointComponentInfo != null && extensionPointComponentInfo.isActivated()) {
            componentStatus = ComponentStatus.RESOLVED;
            return true;
        }

        return false;
    }

    @Override
    public void activate() throws ServiceRuntimeException {
        if (componentStatus != ComponentStatus.RESOLVED) {
            return;
        }

        ComponentManager componentManager = sofaRuntimeContext.getComponentManager();
        ComponentName extensionPointComponentName = extension.getTargetComponentName();
        ComponentInfo extensionPointComponentInfo = componentManager
            .getComponentInfo(extensionPointComponentName);

        if (extensionPointComponentInfo == null || !extensionPointComponentInfo.isActivated()) {
            return;
        }

        loadContributions(
            ((ExtensionPointComponent) extensionPointComponentInfo).getExtensionPoint(), extension);

        Object target = extensionPointComponentInfo.getImplementation().getTarget();
        try {
            if (target instanceof Extensible) {
                ((Extensible) target).registerExtension(extension);
            } else {
                Method method = ReflectionUtils.findMethod(target.getClass(), "registerExtension",
                    Extension.class);
                if (method == null) {
                    throw new RuntimeException(ErrorCode.convert("01-01001", target.getClass()
                        .getCanonicalName()));
                }
                ReflectionUtils.invokeMethod(method, target, extension);
            }
        } catch (Throwable t) {
            throw new ServiceRuntimeException(ErrorCode.convert("01-01000",
                extensionPointComponentInfo.getName()), t);
        }

        componentStatus = ComponentStatus.ACTIVATED;
    }

    @Override
    public HealthResult isHealthy() {
        if (sofaRuntimeContext.getProperties().isSkipExtensionHealthCheck()) {
            HealthResult healthResult = new HealthResult(componentName.getRawName());
            healthResult.setHealthy(true);
            return healthResult;
        }

        HealthResult healthResult = new HealthResult(componentName.getRawName());
        //表示 loadContributions 异常的 Extension
        if (e != null) {
            healthResult.setHealthy(false);
            healthResult.setHealthReport("Extension loadContributions error: " + e.getMessage());
            return healthResult;
        }
        //表示注册成功的 Extension
        if (isActivated()) {
            healthResult.setHealthy(true);
            return healthResult;
        }
        //表示对应的 ExtensionPoint 未注册
        if (!isResolved()) {
            healthResult.setHealthy(false);
            healthResult.setHealthReport("Can not find corresponding ExtensionPoint: "
                                         + extension.getTargetComponentName().getName());
            return healthResult;
        } else {
            // 表示 registerExtension 异常的 Extension
            healthResult.setHealthy(false);
            healthResult.setHealthReport("Extension registerExtension error");
            return healthResult;
        }
    }

    public Extension getExtension() {
        return extension;
    }

    private void loadContributions(ExtensionPoint extensionPoint, Extension extension) {<FILL_FUNCTION_BODY>}
}

        if (extensionPoint != null && extensionPoint.hasContribution()) {
            try {
                Object[] contribs = ((ExtensionPointInternal) extensionPoint)
                    .loadContributions((ExtensionInternal) extension);
                ((ExtensionInternal) extension).setContributions(contribs);
            } catch (Exception e) {
                if (sofaRuntimeContext.getProperties().isExtensionFailureInsulating()) {
                    this.e = e;
                }
                LOGGER.error(
                    ErrorCode.convert("01-01002", extensionPoint.getName(),
                        extension.getComponentName()), e);
            }
        }
    
<methods>public non-sealed void <init>() ,public void activate() throws com.alipay.sofa.runtime.api.ServiceRuntimeException,public boolean canBeDuplicate() ,public void deactivate() throws com.alipay.sofa.runtime.api.ServiceRuntimeException,public java.lang.String dump() ,public void exception(java.lang.Exception) throws com.alipay.sofa.runtime.api.ServiceRuntimeException,public org.springframework.context.ApplicationContext getApplicationContext() ,public com.alipay.sofa.runtime.spi.component.SofaRuntimeContext getContext() ,public com.alipay.sofa.runtime.spi.component.Implementation getImplementation() ,public com.alipay.sofa.runtime.api.component.ComponentName getName() ,public Map<java.lang.String,com.alipay.sofa.runtime.api.component.Property> getProperties() ,public com.alipay.sofa.runtime.model.ComponentStatus getState() ,public boolean isActivated() ,public com.alipay.sofa.runtime.spi.health.HealthResult isHealthy() ,public boolean isResolved() ,public void register() ,public boolean resolve() ,public void setApplicationContext(org.springframework.context.ApplicationContext) ,public void unregister() throws com.alipay.sofa.runtime.api.ServiceRuntimeException,public void unresolve() throws com.alipay.sofa.runtime.api.ServiceRuntimeException<variables>protected org.springframework.context.ApplicationContext applicationContext,protected com.alipay.sofa.runtime.api.component.ComponentName componentName,protected com.alipay.sofa.runtime.model.ComponentStatus componentStatus,protected java.lang.Exception e,protected com.alipay.sofa.runtime.spi.component.Implementation implementation,protected Map<java.lang.String,com.alipay.sofa.runtime.api.component.Property> properties,protected com.alipay.sofa.runtime.spi.component.SofaRuntimeContext sofaRuntimeContext