List of usage examples for org.springframework.jndi JndiCallback doInContext
@Nullable
T doInContext(Context ctx) throws NamingException;
From source file:org.springframework.jndi.JndiTemplate.java
/** * Execute the given JNDI context callback implementation. * @param contextCallback JndiCallback implementation * @return a result object returned by the callback, or {@code null} * @throws NamingException thrown by the callback implementation * @see #createInitialContext/*from w w w . j av a 2 s.c o m*/ */ @Nullable public <T> T execute(JndiCallback<T> contextCallback) throws NamingException { Context ctx = getContext(); try { return contextCallback.doInContext(ctx); } finally { releaseContext(ctx); } }