/** * A {@link BeanFactory} only needs to be available in conjunction with * {@link #setContainerFactoryBeanName}. */ @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; if (beanFactory instanceof ConfigurableBeanFactory) { this.mutex = ((ConfigurableBeanFactory) beanFactory).getSingletonMutex(); } }
private void resetAdviceMonitor() { if (this.beanFactory instanceof ConfigurableBeanFactory) { this.adviceMonitor = ((ConfigurableBeanFactory) this.beanFactory).getSingletonMutex(); } else { this.adviceMonitor = new Object(); } }
@Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; if (beanFactory instanceof ConfigurableBeanFactory) { ConfigurableBeanFactory cbf = (ConfigurableBeanFactory) beanFactory; if (this.beanClassLoader == null) { this.beanClassLoader = cbf.getBeanClassLoader(); } this.retrievalMutex = cbf.getSingletonMutex(); } }
@Override @Nullable public Object getAspectCreationMutex() { if (this.beanFactory.isSingleton(this.name)) { // Rely on singleton semantics provided by the factory -> no local lock. return null; } else if (this.beanFactory instanceof ConfigurableBeanFactory) { // No singleton guarantees from the factory -> let's lock locally but // reuse the factory's singleton lock, just in case a lazy dependency // of our advice bean happens to trigger the singleton lock implicitly... return ((ConfigurableBeanFactory) this.beanFactory).getSingletonMutex(); } else { return this; } }
@Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; if (beanFactory instanceof ConfigurableBeanFactory) { ConfigurableBeanFactory cbf = (ConfigurableBeanFactory) beanFactory; if (this.beanClassLoader == null) { this.beanClassLoader = cbf.getBeanClassLoader(); } this.retrievalMutex = cbf.getSingletonMutex(); } }
/** * A {@link BeanFactory} only needs to be available in conjunction with * {@link #setContainerFactoryBeanName}. */ @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; if (beanFactory instanceof ConfigurableBeanFactory) { this.mutex = ((ConfigurableBeanFactory) beanFactory).getSingletonMutex(); } }
/** * A {@link BeanFactory} only needs to be available in conjunction with * {@link #setContainerFactoryBeanName}. */ @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; if (beanFactory instanceof ConfigurableBeanFactory) { this.mutex = ((ConfigurableBeanFactory) beanFactory).getSingletonMutex(); } }
/** * A {@link BeanFactory} only needs to be available in conjunction with * {@link #setContainerFactoryBeanName}. */ @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; if (beanFactory instanceof ConfigurableBeanFactory) { this.mutex = ((ConfigurableBeanFactory) beanFactory).getSingletonMutex(); } }
/** * A {@link BeanFactory} only needs to be available in conjunction with * {@link #setContainerFactoryBeanName}. */ @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; if (beanFactory instanceof ConfigurableBeanFactory) { this.mutex = ((ConfigurableBeanFactory) beanFactory).getSingletonMutex(); } }
private void resetAdviceMonitor() { if (this.beanFactory instanceof ConfigurableBeanFactory) { this.adviceMonitor = ((ConfigurableBeanFactory) this.beanFactory).getSingletonMutex(); } else { this.adviceMonitor = new Object(); } }
private void resetAdviceMonitor() { if (this.beanFactory instanceof ConfigurableBeanFactory) { this.adviceMonitor = ((ConfigurableBeanFactory) this.beanFactory).getSingletonMutex(); } else { this.adviceMonitor = new Object(); } }
@Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; if (beanFactory instanceof ConfigurableBeanFactory) { ConfigurableBeanFactory cbf = (ConfigurableBeanFactory) beanFactory; if (this.beanClassLoader == null) { this.beanClassLoader = cbf.getBeanClassLoader(); } this.retrievalMutex = cbf.getSingletonMutex(); } }
@Override public Object getAspectCreationMutex() { if (this.beanFactory != null) { if (this.beanFactory.isSingleton(name)) { // Rely on singleton semantics provided by the factory -> no local lock. return null; } else if (this.beanFactory instanceof ConfigurableBeanFactory) { // No singleton guarantees from the factory -> let's lock locally but // reuse the factory's singleton lock, just in case a lazy dependency // of our advice bean happens to trigger the singleton lock implicitly... return ((ConfigurableBeanFactory) this.beanFactory).getSingletonMutex(); } } return this; }
@Override @Nullable public Object getAspectCreationMutex() { if (this.beanFactory.isSingleton(this.name)) { // Rely on singleton semantics provided by the factory -> no local lock. return null; } else if (this.beanFactory instanceof ConfigurableBeanFactory) { // No singleton guarantees from the factory -> let's lock locally but // reuse the factory's singleton lock, just in case a lazy dependency // of our advice bean happens to trigger the singleton lock implicitly... return ((ConfigurableBeanFactory) this.beanFactory).getSingletonMutex(); } else { return this; } }