Package javax.naming

Examples of javax.naming.InitialContext.unbind()


   @AfterMethod(alwaysRun = true)
   public void tearDown() throws Exception
   {
      Context ctx = new InitialContext();
      ctx.unbind(JNDI_NAME);
      if (cache != null)
      {
         TestingUtil.killCaches(cache);
         UnitTestDatabaseManager.shutdownInMemoryDatabase(props);
         cache = null;
View Full Code Here


   protected void destroyDbAfterTest() throws Exception
   {
      Properties icProps = new Properties();
      icProps.setProperty(Context.INITIAL_CONTEXT_FACTORY, FACTORY);
      Context ctx = new InitialContext(icProps);
      ctx.unbind(JNDI_NAME);
      UnitTestDatabaseManager.shutdownInMemoryDatabase(prop);
   }

   public void testLargeObject() throws Exception
   {
View Full Code Here

  /** Unbinds an object from the JNDI context. */
  void unbind(String name) {
    try {
      Context ctx = new InitialContext();
      ctx.unbind(name);
      boundNames.remove(name);
    } catch (Exception exc) {}
  }

  /**
 
View Full Code Here

   }

   protected void tearDown() {
      try {
         InitialContext ctx = new InitialContext(this.env);
         ctx.unbind(CONNECTION_FACTORY);
         ctx.unbind(TOPIC);
      }
      catch (NamingException ex) {
         ex.printStackTrace();
         assertTrue("exception when unbinding", false);
View Full Code Here

   protected void tearDown() {
      try {
         InitialContext ctx = new InitialContext(this.env);
         ctx.unbind(CONNECTION_FACTORY);
         ctx.unbind(TOPIC);
      }
      catch (NamingException ex) {
         ex.printStackTrace();
         assertTrue("exception when unbinding", false);
      }
View Full Code Here

   protected void tearDown() {
      try {
         this.connection.close();
         InitialContext ctx = new InitialContext();
         ctx.unbind(CONNECTION_FACTORY);
         ctx.unbind(TOPIC);
         this.connection = null;
      }
      catch (JMSException ex) {
         ex.printStackTrace();
View Full Code Here

   protected void tearDown() {
      try {
         this.connection.close();
         InitialContext ctx = new InitialContext();
         ctx.unbind(CONNECTION_FACTORY);
         ctx.unbind(TOPIC);
         this.connection = null;
      }
      catch (JMSException ex) {
         ex.printStackTrace();
         assertTrue(false);
View Full Code Here

            InitialContext ic = new InitialContext();
            for (Iterator i = this.objectsToCreate.keySet().iterator(); i
                    .hasNext();) {
                String name = (String) i.next();
                try {
                    ic.unbind(name);
                } catch (NamingException err) {
                    Logger.log(Logger.ERROR, JNDI_RESOURCES,
                            "ContainerJNDIManager.ErrorUnbindingResource", name,
                            err);
                }
View Full Code Here

      InitialContext ic = new InitialContext();

      for(Iterator i = toUnbindAtExit.iterator(); i.hasNext(); )
      {
         String name = (String)i.next();
         ic.unbind(name);
      }
      ic.close();
   }
  
   private void executeStatement(TransactionManager mgr, DataSource ds, String statement) throws Exception
View Full Code Here

    */
   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

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.