Package javax.naming

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


      redeployNaming();
     
      Context ctx2 = new InitialContext(env);
      try
      {
         ctx2.unbind(ObjectBinder.NAME);
      }
      catch (NamingException e)
      {
         log.error("Caught NamingException", e);
         fail(e.getMessage());
View Full Code Here

     
      // Unbind so we can rebind if restarted
      try
      {
         Context ctx = new InitialContext();
         ctx.unbind(this._sessionStateName);
         org.jboss.util.naming.NonSerializableFactory.unbind(this._sessionStateName);
      }
      catch (NamingException e)
      {
         // Ignore
View Full Code Here

    * @exception Exception if an error occurs
    */
   private void teardownEnvironment() throws Exception
   {
      Context ctx = (Context)new InitialContext().lookup("java:comp");
      ctx.unbind("env");
      log.debug("Removed bindings from java:comp/env for EJB: " + getBeanMetaData().getEjbName());
      ctx.unbind("TransactionSynchronizationRegistry");
      log.debug("Unbound java:comp/TransactionSynchronizationRegistry for EJB: " + getBeanMetaData().getEjbName());
      try
      {
View Full Code Here

   private void teardownEnvironment() throws Exception
   {
      Context ctx = (Context)new InitialContext().lookup("java:comp");
      ctx.unbind("env");
      log.debug("Removed bindings from java:comp/env for EJB: " + getBeanMetaData().getEjbName());
      ctx.unbind("TransactionSynchronizationRegistry");
      log.debug("Unbound java:comp/TransactionSynchronizationRegistry for EJB: " + getBeanMetaData().getEjbName());
      try
      {
         NonSerializableFactory.unbind("ORB");
         log.debug("Unbound java:comp/ORB for EJB: " + getBeanMetaData().getEjbName());
View Full Code Here

      // lookup binding - should return new value
      value = (String)lookup(naming, JNDI_KEY, true);
      assertEquals("lookup after HA-JNDI rebind operation", JNDI_VALUE2, value);
     
      // unbind it
      naming.unbind(JNDI_KEY)
     
      // lookup binding - should fail with NamingException
      value = (String)lookup(naming, JNDI_KEY, false);
      assertNull("lookup after HA-JNDI unbind operation", value);
     
View Full Code Here

         Context initialContext = new InitialContext();

         if (useJNPContext) {
            // Unbind bean home from the JNDI initial context
            try {
               initialContext.unbind(jnpName);
            }
            catch (NamingException namingException) {
               logger.error("Cannot unbind EJBHome from JNDI", namingException);
            }
         }
View Full Code Here

    }
    Context ctx = getContext();
    try {
      Any param = parameters[0];
      if (param instanceof AnyName) {
        ctx.unbind((Name)param.toObject());
      } else {
        ctx.unbind(param.toString());
      }
    } catch (NamingException e) {
      throw context.exception(e);
View Full Code Here

    try {
      Any param = parameters[0];
      if (param instanceof AnyName) {
        ctx.unbind((Name)param.toObject());
      } else {
        ctx.unbind(param.toString());
      }
    } catch (NamingException e) {
      throw context.exception(e);
    }
    return this;
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

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.