tuacy / microservice-framework Goto Github PK
View Code? Open in Web Editor NEW微服务地址
微服务地址
分表的拦截器 invocation.getTarget(..)获取的对象 只是一个RoutingStatementHandler的代理对象,instanceof不成立的 而且强转会出错...
加这个方法就可以:
/**
* 如果一个类是被代理的对象,则获取其被代理的原始类型.
* 存在可能一个代理类代理的也是一个代理类,这里会递归的获取最终的真实对象.
* @param target 疑似被代理的对象.
* @param 真实对象的类型.
* @return 最终的真实对象.
*/
public static T safeGetRealTarget(Object target) {
if (Proxy.isProxyClass(target.getClass())) {
MetaObject metaObject = SystemMetaObject.forObject(target);
return safeGetRealTarget(metaObject.getValue("h.target"));
} else {
return (T) target;
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.