Examples of unbind()


Examples of javax.naming.Context.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

Examples of javax.naming.Context.unbind()

    ResolveResult r = findContextFor(name);
    Context ctx = (Context) r.getResolvedObj();
    String rname = r.getRemainingName().toString();

    // Unbind the name in its proper context
    ctx.unbind(rname);
  }

  /**
   * Binds a new name to the object bound to an old name, and unbinds
   * the old name. This operation is not supported (read only env.)
View Full Code Here

Examples of javax.naming.Context.unbind()

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

Examples of javax.naming.Context.unbind()

        // Unbind UserTransaction context if it is not a BMT bean
        // as specified in chapter 16.12 of EJB 3 spec.
        if (easyBeansFactory.getBeanInfo().getTransactionManagementType() == CONTAINER) {
            logger.debug("Bean is container managed so remove availability of java:comp/UserTransaction object");
            try {
                compCtx.unbind("UserTransaction");
            } catch (NamingException e) {
                throwException(cne, new IllegalStateException("Cannot remove java:comp/UserTransaction object", e));
            }
        }
View Full Code Here

Examples of javax.naming.Context.unbind()

        } else {
            // sub context in the env tree
            String suffix = n.getSuffix(1).toString();
            // should throw exception if sub context not found!
            Context subctx = lookupCtx(n.get(0));
            subctx.unbind(suffix);
        }
    }

    /**
     * Binds a new name to the object bound to an old name, and unbinds the old
View Full Code Here

Examples of javax.naming.Context.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

Examples of javax.naming.Context.unbind()

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

Examples of javax.naming.Context.unbind()

         {
            if (hasJndiBoundBeanManager(unit))
            {
               String path = JndiUtils.getJndiSubcontexPathForBeanManager(moduleInformer, unit);
               Context subcontext = (Context) rootContext.lookup(path);
               subcontext.unbind("BeanManager");
               rootContext.destroySubcontext(path);
            }
         }
         catch (NamingException e)
         {
View Full Code Here

Examples of javax.naming.Context.unbind()

   public void unbind(DeploymentUnit unit)
   {
      try
      {
         Context context = (Context)getBeanManagerContext().lookup(unit.getSimpleName());
         context.unbind("bootstrap");

         getBeanManagerContext().destroySubcontext(unit.getSimpleName());
      }
      catch (NamingException e)
      {
View Full Code Here

Examples of javax.naming.Context.unbind()

    * @throws Exception for any error
    */
   public void stopService() throws Exception
   {
      Context initialContext = new InitialContext();
      initialContext.unbind(jndiName);
   }

   /**
    * Bind object to jndi.
    *
 
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.