getRuleLoader().loadRulesAndEquipRouter(rules, routerToUse, getFunctionsMap());
if (isEnableCache()) {
ProxyFactory proxyFactory = new ProxyFactory(routerToUse);
proxyFactory.setInterfaces(new Class[] { ICobarRouter.class });
RoutingResultCacheAspect advice = new RoutingResultCacheAspect();
if (cacheSize > 0) {
advice.setInternalCache(new LRUMap(cacheSize));
}
proxyFactory.addAdvice(advice);
this.router = (ICobarRouter<IBatisRoutingFact>) proxyFactory.getProxy();
} else {
this.router = routerToUse;