class ReferenceFactoryBean extends AbstractContractFactoryBean {

    protected Object  proxy;
    /**
     * jvm first or not
     */
    protected boolean jvmFirst = true;
    /**
     * load balance
     **/
    protected String  loadBalance;

    protected boolean required = true;

    public ReferenceFactoryBean() {
    }

    public ReferenceFactoryBean(String interfaceType) {
        this.interfaceType = interfaceType;
    }

    @Override
    public void afterPropertiesSet() throws Exception {<FILL_FUNCTION_BODY>}

    @Override
    protected void setProperties(BindingConverterContext bindingConverterContext) {
        bindingConverterContext.setLoadBalance(loadBalance);
    }

    protected Reference buildReference() {
        Reference reference = new ReferenceImpl(uniqueId, getInterfaceClass(),
            InterfaceMode.spring, jvmFirst);
        reference.setRequired(required);
        return reference;
    }

    @Override
    public Object getObject() throws Exception {
        return proxy;
    }

    @Override
    public Class<?> getObjectType() {
        try {
            Class<?> type = getInterfaceClass();
            return type != null ? type : ReferenceFactoryBean.class;
        } catch (Throwable t) {
            // Class not found
            return ReferenceFactoryBean.class;
        }
    }

    @Override
    protected boolean isInBinding() {
        return true;
    }

    public void setJvmFirst(boolean jvmFirst) {
        this.jvmFirst = jvmFirst;
    }

    public String getLoadBalance() {
        return loadBalance;
    }

    public void setLoadBalance(String loadBalance) {
        this.loadBalance = loadBalance;
    }

    public void setRequired(boolean required) {
        this.required = required;
    }

    public boolean getRequired() {
        return required;
    }
}

        super.afterPropertiesSet();
        Reference reference = buildReference();
        Assert
            .isTrue(bindings.size() <= 1,
                "Found more than one binding in <sofa:reference/>, <sofa:reference/> can only have one binding.");

        // default add jvm binding and reference jvm binding should set serialize as false
        if (bindings.size() == 0) {
            // default reference prefer to ignore serialize
            JvmBindingParam jvmBindingParam = new JvmBindingParam();
            jvmBindingParam.setSerialize(false);
            bindings.add(new JvmBinding().setJvmBindingParam(jvmBindingParam));
        }

        reference.addBinding(bindings.get(0));
        ComponentDefinitionInfo definitionInfo = new ComponentDefinitionInfo();
        definitionInfo.setInterfaceMode(apiType ? InterfaceMode.api : InterfaceMode.spring);
        definitionInfo.putInfo(BEAN_ID, beanId);
        proxy = ReferenceRegisterHelper.registerReference(reference, bindingAdapterFactory,
            sofaRuntimeContext, applicationContext, definitionInfo);
    
<methods>public non-sealed void <init>() ,public void afterPropertiesSet() throws java.lang.Exception,public java.lang.String getBeanId() ,public List<com.alipay.sofa.runtime.spi.binding.Binding> getBindings() ,public Class<?> getInterfaceClass() ,public java.lang.String getInterfaceType() ,public java.lang.String getUniqueId() ,public boolean isApiType() ,public boolean isSingleton() ,public void setApiType(boolean) ,public void setApplicationContext(org.springframework.context.ApplicationContext) throws org.springframework.beans.BeansException,public void setBeanId(java.lang.String) ,public void setBindingAdapterFactory(com.alipay.sofa.runtime.spi.binding.BindingAdapterFactory) ,public void setBindingConverterFactory(com.alipay.sofa.runtime.spi.service.BindingConverterFactory) ,public void setBindings(List<com.alipay.sofa.runtime.spi.binding.Binding>) ,public void setDocumentEncoding(java.lang.String) ,public void setElements(List<org.springframework.beans.factory.config.TypedStringValue>) ,public void setInterfaceClass(Class#RAW) ,public void setInterfaceType(java.lang.String) ,public void setRepeatReferLimit(java.lang.String) ,public void setSofaRuntimeContext(com.alipay.sofa.runtime.spi.component.SofaRuntimeContext) ,public void setUniqueId(java.lang.String) <variables>protected boolean apiType,protected org.springframework.context.ApplicationContext applicationContext,protected java.lang.String beanId,protected com.alipay.sofa.runtime.spi.binding.BindingAdapterFactory bindingAdapterFactory,protected com.alipay.sofa.runtime.spi.service.BindingConverterFactory bindingConverterFactory,protected List<com.alipay.sofa.runtime.spi.binding.Binding> bindings,protected java.lang.String documentEncoding,protected List<org.springframework.beans.factory.config.TypedStringValue> elements,protected Class<?> interfaceClass,protected java.lang.String interfaceType,protected java.lang.String repeatReferLimit,protected com.alipay.sofa.runtime.spi.component.SofaRuntimeContext sofaRuntimeContext,protected java.lang.String uniqueId