@Test public void rebindSessionManagerActuallyBindsItToJndi() throws Exception { JndiUtil.rebindSessionManager(sessionManager, JNDI_NAME); verify(initialCtx).rebind(JNDI_NAME, sessionManager); }
public static void rebindSessionManager(final SessionManager sessionManager, final String jndiName) { LOG.info("Binding Hibersap SessionManager '" + sessionManager.getConfig().getName() + "' to JNDI name '" + jndiName + "'"); try { Context ctx = new InitialContext(); ctx.rebind(jndiName, sessionManager); } catch (NamingException e) { throw new HibersapException("Failed binding Hibersap SessionManager to JNDI name [" + jndiName + "]", e); } }
JndiUtil { public static void rebindSessionManager(final SessionManager sessionManager, final String jndiName) { LOG.info("Binding Hibersap SessionManager '" + sessionManager.getConfig().getName() + "' to JNDI name '" + jndiName + "'"); try { Context ctx = new InitialContext(); ctx.rebind(jndiName, sessionManager); } catch (NamingException e) { throw new HibersapException("Failed binding Hibersap SessionManager to JNDI name [" + jndiName + "]", e); } } }
JndiUtil { public static void rebindSessionManager(final SessionManager sessionManager, final String jndiName) { LOG.info("Binding Hibersap SessionManager '" + sessionManager.getConfig().getName() + "' to JNDI name '" + jndiName + "'"); try { Context ctx = new InitialContext(); ctx.rebind(jndiName, sessionManager); } catch (NamingException e) { throw new HibersapException("Failed binding Hibersap SessionManager to JNDI name [" + jndiName + "]", e); } } private  JndiUtil(); }
JndiUtil { public static void rebindSessionManager(final SessionManager sessionManager, final String jndiName) { LOG.info("Binding Hibersap SessionManager '" + sessionManager.getConfig().getName() + "' to JNDI name '" + jndiName + "'"); try { Context ctx = new InitialContext(); ctx.rebind(jndiName, sessionManager); } catch (NamingException e) { throw new HibersapException("Failed binding Hibersap SessionManager to JNDI name [" + jndiName + "]", e); } } private  JndiUtil(); static void rebindSessionManager(final SessionManager sessionManager, final String jndiName); static void unbindSessionManager(final String jndiName); }
JndiUtil { public static void rebindSessionManager(final SessionManager sessionManager, final String jndiName) { LOG.info("Binding Hibersap SessionManager '" + sessionManager.getConfig().getName() + "' to JNDI name '" + jndiName + "'"); try { Context ctx = new InitialContext(); ctx.rebind(jndiName, sessionManager); } catch (NamingException e) { throw new HibersapException("Failed binding Hibersap SessionManager to JNDI name [" + jndiName + "]", e); } } private  JndiUtil(); static void rebindSessionManager(final SessionManager sessionManager, final String jndiName); static void unbindSessionManager(final String jndiName);  }