Skip to content

Commit c2701b6

Browse files
committed
WELD-2823 Implement BeanContainer#unwrapClientProxy
1 parent ad42373 commit c2701b6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
import org.jboss.weld.module.EjbSupport;
156156
import org.jboss.weld.module.ExpressionLanguageSupport;
157157
import org.jboss.weld.module.ObserverNotifierFactory;
158+
import org.jboss.weld.proxy.WeldClientProxy;
158159
import org.jboss.weld.resolution.BeanTypeAssignabilityRules;
159160
import org.jboss.weld.resolution.DecoratorResolvableBuilder;
160161
import org.jboss.weld.resolution.EventTypeAssignabilityRules;
@@ -1628,8 +1629,13 @@ public boolean isMatchingEvent(Type eventType, Set<Annotation> eventQualifiers,
16281629
}
16291630

16301631
@Override
1632+
@SuppressWarnings("unchecked")
16311633
public <T> T unwrapClientProxy(T reference) {
1632-
throw new UnsupportedOperationException("Not yet implemented");
1634+
if (reference instanceof WeldClientProxy) {
1635+
return (T) ((WeldClientProxy) reference).getMetadata().getContextualInstance();
1636+
} else {
1637+
return reference;
1638+
}
16331639
}
16341640

16351641
private void validateQualifiers(Set<Annotation> qualifiers, String methodName) {

0 commit comments

Comments
 (0)