com.alibaba.dubbo.rpc.ServiceClassHolder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dubbo-rpc-api Show documentation
Show all versions of dubbo-rpc-api Show documentation
The rpc module of dubbo project
The newest version!
package com.alibaba.dubbo.rpc;
/**
* TODO this is just a workround for rest protocol, and now we just ensure it works in the most common dubbo usages
*
* @author lishen
*/
public class ServiceClassHolder {
private static final ServiceClassHolder INSTANCE = new ServiceClassHolder();
private final ThreadLocal holder = new ThreadLocal();
public static ServiceClassHolder getInstance() {
return INSTANCE;
}
private ServiceClassHolder() {
}
public Class popServiceClass() {
Class clazz = holder.get();
holder.remove();
return clazz;
}
public void pushServiceClass(Class clazz) {
holder.set(clazz);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy