/** * Get the singleton aspect instance for the supplied aspect type. An instance * is created if one cannot be found in the instance cache. */ private Object getSingletonAspectInstance(Class<?> aspectClass) { // Quick check without a lock... Object instance = aspectCache.get(aspectClass); if (instance == null) { synchronized (aspectCache) { // To be safe, check within full lock now... instance = aspectCache.get(aspectClass); if (instance == null) { instance = new SimpleAspectInstanceFactory(aspectClass).getAspectInstance(); aspectCache.put(aspectClass, instance); } } } return instance; }
/** * Get the singleton aspect instance for the supplied aspect type. An instance * is created if one cannot be found in the instance cache. */ private Object getSingletonAspectInstance(Class<?> aspectClass) { // Quick check without a lock... Object instance = aspectCache.get(aspectClass); if (instance == null) { synchronized (aspectCache) { // To be safe, check within full lock now... instance = aspectCache.get(aspectClass); if (instance == null) { instance = new SimpleAspectInstanceFactory(aspectClass).getAspectInstance(); aspectCache.put(aspectClass, instance); } } } return instance; }