/** {@inheritDoc} */ public void inject(final T value) { try { field.set(target.getValue(), value); } catch (Exception e) { throw new InjectionException("Failed to inject value into field", e); } }
@Override public final InjectionException failedToInjectSecurityRealm(final UnknownHostException cause, final SecurityRealm realm) { final InjectionException result = new InjectionException(String.format(getLoggingLocale(), failedToInjectSecurityRealm$str(), realm), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String invalidEntryMergePolicy = "DGISPN0125: %s is not a valid EntryMergePolicy";
/** {@inheritDoc} */ public void inject(final T value) throws InjectionException { if (map.putIfAbsent(key, value) != null) { throw new InjectionException("Value already injected into map key " + key); } super.inject(value); }
@Override public final InjectionException failedToInjectSocketBinding(final UnknownHostException cause, final OutboundSocketBinding binding) { final InjectionException result = new InjectionException(String.format(getLoggingLocale(), failedToInjectSocketBinding$str(), binding), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String transportRequired = "DGISPN0101: Failed to add %s %s cache to non-clustered %s cache container.";
/** {@inheritDoc} */ public void inject(final T value) throws InjectionException { if (! valueUpdater.compareAndSet(this, null, new ImmediateValue<T>(value))) { throw new InjectionException("Value already set for this injector"); } }
/** {@inheritDoc} */ public void inject(final T value) { try { method.invoke(target.getValue(), value); } catch (Exception e) { throw new InjectionException("Failed to inject value into method", e); } }
/** {@inheritDoc} */ public void inject(final T value) { try { field.set(target.getValue(), value); } catch (Exception e) { throw new InjectionException("Failed to inject value into field", e); } }
/** {@inheritDoc} */ public void inject(final Object value) throws InjectionException { final T castValue; try { castValue = type.cast(value); } catch (ClassCastException e) { throw new InjectionException("Injecting the wrong type (expected " + type + ", got " + value.getClass() + ")", e); } target.inject(castValue); }
/** {@inheritDoc} */ public void inject(final Object value) throws InjectionException { final T castValue; try { castValue = type.cast(value); } catch (ClassCastException e) { throw new InjectionException("Injecting the wrong type (expected " + type + ", got " + value.getClass() + ")", e); } target.inject(castValue); }
/** {@inheritDoc} */ public void inject(final T value) throws InjectionException { if (! valueUpdater.compareAndSet(this, null, new ImmediateValue<T>(value))) { throw new InjectionException("Value already set for this injector"); } }
/** {@inheritDoc} */ public void inject(final T value) { try { method.invoke(target.getValue(), value); } catch (Exception e) { throw new InjectionException("Failed to inject value into method", e); } }
/** {@inheritDoc} */ public void inject(final T value) throws InjectionException { if (map.putIfAbsent(key, value) != null) { throw new InjectionException("Value already injected into map key " + key); } super.inject(value); }
/** {@inheritDoc} */ public void inject(final T value) { super.inject(value); try { addMethod.invoke(target.getValue(), value); } catch (Exception e) { throw new InjectionException("Failed to inject value into method", e); } }
/** {@inheritDoc} */ public void inject(final T value) { super.inject(value); try { addMethod.invoke(target.getValue(), value); } catch (Exception e) { throw new InjectionException("Failed to inject value into method", e); } }
public void inject(final NamingStore value) throws InjectionException { try { injector.inject((Context) value.lookup(new CompositeName())); } catch (NamingException e) { throw new InjectionException(e); } }
/** {@inheritDoc} */ public void inject(final T value) throws InjectionException { final ThreadLocalValue<Object> injectedValue = Values.injectedValue(); final ThreadLocalValue<Object> tlsThisValue = Values.thisValue(); final Value<?> thisValue = targetValue; final Value<?> oldInjectedValue = injectedValue.getAndSetValue((Value<?>) new ImmediateValue<T>(value)); try { final Value<?> oldThis = tlsThisValue.getAndSetValue(thisValue); try { method.invoke(thisValue.getValue(), Values.getValues(parameterList)); } catch (InvocationTargetException e) { try { throw e.getCause(); } catch (InjectionException e2) { throw e2; } catch (Throwable throwable) { throw new InjectionException("Injection failed", e); } } catch (Exception e) { throw new InjectionException("Injection failed", e); } finally { tlsThisValue.setValue(oldThis); } } finally { injectedValue.setValue(oldInjectedValue); } }
/** {@inheritDoc} */ public void inject(final T value) throws InjectionException { final ThreadLocalValue<Object> injectedValue = Values.injectedValue(); final ThreadLocalValue<Object> tlsThisValue = Values.thisValue(); final Value<?> thisValue = targetValue; final Value<?> oldInjectedValue = injectedValue.getAndSetValue((Value<?>) new ImmediateValue<T>(value)); try { final Value<?> oldThis = tlsThisValue.getAndSetValue(thisValue); try { method.invoke(thisValue.getValue(), Values.getValues(parameterList)); } catch (InvocationTargetException e) { try { throw e.getCause(); } catch (InjectionException e2) { throw e2; } catch (Throwable throwable) { throw new InjectionException("Injection failed", e); } } catch (Exception e) { throw new InjectionException("Injection failed", e); } finally { tlsThisValue.setValue(oldThis); } } finally { injectedValue.setValue(oldInjectedValue); } }