@Override public Object invoke(MethodInvocation invocation) throws Throwable { Context ctx = (isEligible(invocation.getMethod()) ? this.jndiTemplate.getContext() : null); try { return invocation.proceed(); } finally { this.jndiTemplate.releaseContext(ctx); } }
/** * Execute the given JNDI context callback implementation. * @param contextCallback the JndiCallback implementation to use * @return a result object returned by the callback, or {@code null} * @throws NamingException thrown by the callback implementation * @see #createInitialContext */ @Nullable public <T> T execute(JndiCallback<T> contextCallback) throws NamingException { Context ctx = getContext(); try { return contextCallback.doInContext(ctx); } finally { releaseContext(ctx); } }
@Override public Object invoke(MethodInvocation invocation) throws Throwable { Context ctx = (isEligible(invocation.getMethod()) ? this.jndiTemplate.getContext() : null); try { return invocation.proceed(); } finally { this.jndiTemplate.releaseContext(ctx); } }
/** * Execute the given JNDI context callback implementation. * @param contextCallback the JndiCallback implementation to use * @return a result object returned by the callback, or {@code null} * @throws NamingException thrown by the callback implementation * @see #createInitialContext */ @Nullable public <T> T execute(JndiCallback<T> contextCallback) throws NamingException { Context ctx = getContext(); try { return contextCallback.doInContext(ctx); } finally { releaseContext(ctx); } }
/** * Prepares the thread context if necessary, and delegates to * {@link #invokeInContext}. */ @Override @Nullable public Object invoke(MethodInvocation invocation) throws Throwable { Context ctx = (this.exposeAccessContext ? getJndiTemplate().getContext() : null); try { return invokeInContext(invocation); } finally { getJndiTemplate().releaseContext(ctx); } }
/** * Prepares the thread context if necessary, and delegates to * {@link #invokeInContext}. */ @Override @Nullable public Object invoke(MethodInvocation invocation) throws Throwable { Context ctx = (this.exposeAccessContext ? getJndiTemplate().getContext() : null); try { return invokeInContext(invocation); } finally { getJndiTemplate().releaseContext(ctx); } }
getJndiTemplate().releaseContext(ctx);
getJndiTemplate().releaseContext(ctx);
@Override public Object invoke(MethodInvocation invocation) throws Throwable { Context ctx = (isEligible(invocation.getMethod()) ? this.jndiTemplate.getContext() : null); try { return invocation.proceed(); } finally { this.jndiTemplate.releaseContext(ctx); } }
/** * Execute the given JNDI context callback implementation. * @param contextCallback the JndiCallback implementation to use * @return a result object returned by the callback, or {@code null} * @throws NamingException thrown by the callback implementation * @see #createInitialContext */ @Nullable public <T> T execute(JndiCallback<T> contextCallback) throws NamingException { Context ctx = getContext(); try { return contextCallback.doInContext(ctx); } finally { releaseContext(ctx); } }
/** * Prepares the thread context if necessary, and delegates to * {@link #invokeInContext}. */ @Override @Nullable public Object invoke(MethodInvocation invocation) throws Throwable { Context ctx = (this.exposeAccessContext ? getJndiTemplate().getContext() : null); try { return invokeInContext(invocation); } finally { getJndiTemplate().releaseContext(ctx); } }
getJndiTemplate().releaseContext(ctx);