use of org.jboss.weld.exceptions.WeldException in project Payara by payara.
the class JCDIAroundConstructCallback method aroundConstruct.
@Override
public T aroundConstruct(final ConstructionHandle<T> handle, AnnotatedConstructor<T> constructor, Object[] parameters, Map<String, Object> data) {
this.handle = handle;
this.parameters = parameters;
T ejb;
try {
container.intercept(LifecycleCallbackDescriptor.CallbackType.AROUND_CONSTRUCT, ejbContext);
// all the interceptors were invoked, call the constructor now
if (target.get() == null) {
ejb = handle.proceed(parameters, new HashMap<>());
target.set(ejb);
}
} catch (RuntimeException e) {
throw e;
} catch (Throwable e) {
throw new WeldException(e);
}
return target.get();
}
use of org.jboss.weld.exceptions.WeldException in project Payara by payara.
the class WeldDeployer method createProbeExtension.
private Metadata<Extension> createProbeExtension() {
ProbeExtension probeExtension;
Class<ProbeExtension> probeExtensionClass = ProbeExtension.class;
try {
if (System.getSecurityManager() != null) {
probeExtension = AccessController.doPrivileged(NewInstanceAction.of(probeExtensionClass));
} else {
probeExtension = probeExtensionClass.newInstance();
}
} catch (Exception e) {
throw new WeldException(e.getCause());
}
return new MetadataImpl<Extension>(probeExtension, "N/A");
}
Aggregations