All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alanpoi.etactivity.agent.ActivityFactoryBean Maven / Gradle / Ivy

package com.alanpoi.etactivity.agent;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

import java.lang.reflect.Proxy;

/**
 * FactoryBean proxy
 *
 * @author pengzhuoxun
 * @since 1.3.0
 */

@Component
public class ActivityFactoryBean implements FactoryBean {
    private Class cls;

    @Override
    public T getObject() throws Exception {
        return (T) Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[]{cls}, new ActivityInvocationHandler());
    }

    @Override
    public Class getObjectType() {
        return cls;
    }

    public Class getCls() {
        return cls;
    }

    public void setCls(Class cls) {
        this.cls = cls;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy