class ExtensionFactoryBean extends AbstractExtFactoryBean {

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

    /* extension bean */
    private String              bean;

    /* extension point name */
    private String              point;

    /* content need to be parsed with XMap */
    private Element             content;

    private String[]            require;

    private ClassLoader         classLoader;

    @Override
    public void afterPropertiesSet() throws Exception {
        super.afterPropertiesSet();
        Assert.notNull(applicationContext,
            "required property 'applicationContext' has not been set");
        Assert.notNull(getPoint(), "required property 'point' has not been set for extension");
        // checked
        if (!StringUtils.hasText(getPoint())) {
            throw new IllegalArgumentException("'point' have to be specified");
        }

        if (getBeanClassLoaderWrapper() == null
            || getBeanClassLoaderWrapper().getInnerClassLoader() == null) {
            classLoader = Thread.currentThread().getContextClassLoader();
        } else {
            classLoader = getBeanClassLoaderWrapper().getInnerClassLoader();
        }

        try {
            publishAsNuxeoExtension();
        } catch (Exception e) {
            LOGGER.error("failed to publish extension", e);
            throw e;
        }
    }

    private void publishAsNuxeoExtension() throws Exception {<FILL_FUNCTION_BODY>}

    private ComponentName getExtensionPointComponentName() {
        return ComponentNameFactory.createComponentName(
            ExtensionPointComponent.EXTENSION_POINT_COMPONENT_TYPE, this.getBean() + LINK_SYMBOL
                                                                    + this.getPoint());
    }

    public void setContribution(String[] contribution) throws Exception {
        if (contribution != null && contribution.length != 0) {
            Class<?>[] contrClass = new Class[contribution.length];
            int i = 0;
            for (String cntr : contribution) {
                contrClass[i] = classLoader.loadClass(cntr);
                i++;
            }
        }
    }

    public void setRequire(String[] require) {
        this.require = require;
    }

    public String[] getRequire() {
        return require;
    }

    public void setBean(String bean) {
        this.bean = bean;
    }

    public String getBean() {
        return bean;
    }

    public void setContent(Element content) {
        this.content = content;
    }

    public Element getContent() {
        return content;
    }

    public void setPoint(String point) {
        this.point = point;
    }

    public String getPoint() {
        return point;
    }

    @Override
    public String toString() {
        return "ExtensionPointTarget: " + bean;
    }
}

        ExtensionBuilder extensionBuilder = ExtensionBuilder.genericExtension(this.getPoint(),
            this.getContent(), applicationContext, classLoader);
        extensionBuilder.setExtensionPoint(getExtensionPointComponentName());

        ComponentInfo componentInfo = new ExtensionComponent(extensionBuilder.getExtension(),
            sofaRuntimeContext);
        ComponentDefinitionInfo extensionDefinitionInfo = new ComponentDefinitionInfo();
        extensionDefinitionInfo.setInterfaceMode(InterfaceMode.spring);
        extensionDefinitionInfo.putInfo(BEAN_ID, bean);
        extensionDefinitionInfo.putInfo(EXTENSION_POINT_NAME, point);
        Property property = new Property();
        property.setName(SOURCE);
        property.setValue(extensionDefinitionInfo);
        componentInfo.getProperties().put(SOURCE, property);
        componentInfo.setApplicationContext(applicationContext);
        sofaRuntimeContext.getComponentManager().register(componentInfo);
    
<methods>public non-sealed void <init>() ,public void afterPropertiesSet() throws java.lang.Exception,public com.alipay.sofa.runtime.ext.spring.ClassLoaderWrapper getBeanClassLoaderWrapper() ,public java.lang.Object getObject() throws java.lang.Exception,public Class<?> getObjectType() ,public int getOrder() ,public boolean isSingleton() ,public void setApplicationContext(org.springframework.context.ApplicationContext) throws org.springframework.beans.BeansException,public void setBeanClassLoaderWrapper(com.alipay.sofa.runtime.ext.spring.ClassLoaderWrapper) ,public void setBeanFactory(org.springframework.beans.factory.BeanFactory) throws org.springframework.beans.BeansException,public void setBeanName(java.lang.String) ,public void setTarget(java.lang.Object) ,public void setTargetBeanName(java.lang.String) <variables>public static final java.lang.String LINK_SYMBOL,protected org.springframework.context.ApplicationContext applicationContext,protected com.alipay.sofa.runtime.ext.spring.ClassLoaderWrapper beanClassLoaderWrapper,protected org.springframework.beans.factory.BeanFactory beanFactory,protected java.lang.String beanName,protected com.alipay.sofa.runtime.spi.component.SofaRuntimeContext sofaRuntimeContext,protected java.lang.Object target,protected java.lang.String targetBeanName