Package javax.naming

Examples of javax.naming.InitialContext.unbind()


            InitialContext ctx = null;
            try
            {
               // the following statement fails when the server is being shut down (07/19/2007)
               ctx = new InitialContext();
               ctx.unbind(jndiName);
            }
            catch (Exception e) {
               log.error("partition unbind operation failed", e);
            }
            finally
View Full Code Here


  @Override
  public void unbind(String jndiName) {
    final InitialContext initialContext = buildInitialContext();
    final Name name = parseName( jndiName, initialContext );
    try {
      initialContext.unbind( name );
    }
    catch (Exception e) {
      throw new JndiException( "Error performing unbind [" + name + "]", e );
    }
    finally {
View Full Code Here

   @AfterMethod(alwaysRun = true)
   public void tearDown() throws Exception
   {
      Context ctx = new InitialContext();
      ctx.unbind(JNDI_NAME);
      /*
      if (old_factory != null)
      {
         System.setProperty(Context.INITIAL_CONTEXT_FACTORY, old_factory);
      }
View Full Code Here

         Thread.dumpStack();
        
         Properties p = new Properties();
         p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
         Context ctx = new InitialContext(p);
         ctx.unbind("java:/TransactionManager");
         ctx.unbind("UserTransaction");
      }
      catch (NamingException e)
      {
         log.error("unbinding of DummyTransactionManager failed", e);
View Full Code Here

        
         Properties p = new Properties();
         p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
         Context ctx = new InitialContext(p);
         ctx.unbind("java:/TransactionManager");
         ctx.unbind("UserTransaction");
      }
      catch (NamingException e)
      {
         log.error("unbinding of DummyTransactionManager failed", e);
      }
View Full Code Here

    */
   public void stop() throws Throwable
   {
      Context context = new InitialContext();

      context.unbind(JNDI_NAME);

      context.close();
   }
}
View Full Code Here

    */
   public void stop() throws Throwable
   {
      Context context = new InitialContext();

      context.unbind(JNDI_NAME);

      context.close();
   }
}
View Full Code Here

    */
   public void stop() throws Throwable
   {
      Context context = new InitialContext();

      context.unbind(JNDI_NAME);

      context.close();
   }

   /**
 
View Full Code Here

   {
      super.tearDown();
      Properties icProps = new Properties();
      icProps.setProperty(Context.INITIAL_CONTEXT_FACTORY, FACTORY);
      Context ctx = new InitialContext(icProps);
      ctx.unbind(JNDI_NAME);
      /*
      if (old_factory != null)
      {
         System.setProperty(Context.INITIAL_CONTEXT_FACTORY, old_factory);
      }
View Full Code Here

            JNDIDataSourceFactory factory = new JNDIDataSourceFactory();
            assertSame(dataSource, factory.getDataSource(descriptor));
        }
        finally {
            // since the context is shared, must clear it after the test
            context.unbind(descriptor.getParameters());
        }
    }

    public void testGetDataSource_NameBoundWithPrefix() throws Exception {
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.