Skip to content
This repository was archived by the owner on Jan 27, 2021. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.sun.jersey.core.spi.component.ioc.IoCComponentProcessorFactory;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.ManagedBean;
import javax.annotation.PostConstruct;
import javax.interceptor.InvocationContext;
Expand All @@ -60,13 +61,19 @@ public void setFactory(IoCComponentProcessorFactory cpf) {
this.cpf = cpf;
}

private final AtomicBoolean initializing = new AtomicBoolean(false);

@PostConstruct
private void init(final InvocationContext context) throws Exception {
if (cpf == null) {
// Not initialized
return;
}

boolean setInitializing = initializing.compareAndSet(false, true);
if (!setInitializing) {
return;
}
final Object beanInstance = context.getTarget();
final IoCComponentProcessor icp = get(beanInstance.getClass());
if (icp != null)
Expand Down