Package javax.naming

Examples of javax.naming.InitialContext.unbind()


    */
   public void stop() throws Exception
   {
      // Standard JNDI
      Context ctx = new InitialContext();
      ctx.unbind(NAME);
      log.info("Unbound " + NAME + " from " + ctx);
      ctx.unbind(BAD_BINDING);
      log.info("Unbound " + BAD_BINDING + " from " + ctx);
     
      // For some reason creating a context for our own JNDI doesn't work
View Full Code Here


   {
      // Standard JNDI
      Context ctx = new InitialContext();
      ctx.unbind(NAME);
      log.info("Unbound " + NAME + " from " + ctx);
      ctx.unbind(BAD_BINDING);
      log.info("Unbound " + BAD_BINDING + " from " + ctx);
     
      // For some reason creating a context for our own JNDI doesn't work
      // inside the server, so as a hack we directly deal with the NamingServer
      // to bind the object
View Full Code Here

    final Hashtable usemap = EnvHelp.mapToHashtable(attributes);
   
                InitialContext ctx =
                    new InitialContext(usemap);
               
                ctx.unbind(boundJndiUrl);
               
                ctx.close();
            } catch (NamingException e) {
    if (tracing) logger.trace("stop", "failed to unbind RMI server: "+e);
    if (logger.debugOn()) logger.debug("stop",e);
View Full Code Here

    private void stop() {
        String jndiName = getJndiName();
        if (jndiName != null && jndiName.length() > 0) {
            try {
                Context context = new InitialContext();
                context.unbind(jndiName);
                log.info("JavaMail session unbound from " + jndiName);
            } catch (NamingException e) {
                // we tried... this is a common error which occurs during shutdown due to ordering
            }
        }
View Full Code Here

    private void rebind(String unbindName) throws NamingException
    {
  InitialContext ictx = new InitialContext();
  if (unbindName != null)
      ictx.unbind( unbindName );
 
  if (jndiName != null)
  {
      // Thanks to David D. Kilzer for this code to auto-create
      // subcontext paths!
View Full Code Here

    private void stop() {
        String jndiName = getJndiName();
        if (jndiName != null && jndiName.length() > 0) {
            try {
                Context context = new InitialContext();
                context.unbind(jndiName);
                log.info("JavaMail session unbound from " + jndiName);
            } catch (NamingException e) {
                // we tried... this is a common error which occurs during shutdown due to ordering
            }
        }
View Full Code Here

    builder.bind(name, o);
    // Check it affects JNDI
    Context ctx = new InitialContext();
    assertTrue(ctx.lookup(name) == o);
    // Check it returns mutable contexts
    ctx.unbind(name);
    try {
      ctx = new InitialContext();
      ctx.lookup(name);
      fail("Should have thrown NamingException");
    }
View Full Code Here

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        try {
            Context context = new InitialContext();
            context.lookup(NAME);
            context.unbind(NAME);
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }
}
View Full Code Here

    }

    public void unbind() {
        try {
            InitialContext ic = new InitialContext();
            ic.unbind(JNDI_NAME);
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }
}
View Full Code Here

         InitialContext ctx = null;
         try
         {
            ctx = new InitialContext(new Hashtable(environment));
            ctx.unbind(jndiURL);
            if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Unbound " + server + " from " + jndiURL);
         }
         catch (NamingException x)
         {
            if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Cannot unbind server " + server + " to " + jndiURL, x);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.