-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed as not planned
Labels
for: stackoverflowA question that's better suited to stackoverflow.comA question that's better suited to stackoverflow.comstatus: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
I have defined an interface A,I want to implement dynamic A-class bean management through FactoryBean+JDK proxy
pubic interface A<T>{
Class<T> getType();
default void deleteAll(){
Query.from(getType()).deleteAll();
}
}
public AFactoryBean<T,A<T>> implements FactoryBean<A<T>>{
public AFactoryBean(Class<A<T>> mapperInterface) {
this.mapperInterface = mapperInterface;
}
public Class<?> getObjectType(){
return A.class;
}
public A<T> getObject(){
Class<T> type ;//How can I get the T class;
InvocationHandler handler =new AInvocationHandler(type,.....);
return (A) Proxy.newProxyInstance(
mapperInterface.getClassLoader(),
new Class[]{mapperInterface},
handler
);
}
}
How can I get the T class? I have no class implements A,I just want to use JDK proxy. Is there any other way to achieve it ?
Metadata
Metadata
Assignees
Labels
for: stackoverflowA question that's better suited to stackoverflow.comA question that's better suited to stackoverflow.comstatus: invalidAn issue that we don't feel is validAn issue that we don't feel is valid