Package javax.naming

Examples of javax.naming.Context.unbind()


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

        }

        // Attempt to delete an existing binding
        try {
            if (ok) {
                envContext.unbind("byteEntry");
                sb.append("  Allowed unbind().");
                value = envContext.lookup("byteEntry");
                if (value == null)
                    sb.append("  Allowed unbind of deleted entry.");
            }
View Full Code Here

            throw new JDOFatalException("Caught NamingException trying to bind " +
                    e.getMessage(), e);
        } finally {
            if (context != null) {
                try {
                    context.unbind(jndiName);
                    context.close();
                } catch (NamingException e) {
                    fail("Caught NamingException trying to unbind or close." +
                            e.getMessage());
                    // stay quiet
View Full Code Here

        } catch (NamingException e) {
            throw new JDOFatalException("", e);
        } finally {
            if (context != null) {
                try {
                    context.unbind(jndiName);
                    context.close();
                } catch (NamingException e) {
                    // stay quiet
                }
            }
View Full Code Here

        String unit = persistenceUnitGBean.getPersistenceUnitName();
        String rootUrl = persistenceUnitGBean.getPersistenceUnitRoot();
        String id = unit + " " + rootUrl.hashCode();
        Context context = SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext();
        try {
            context.unbind("java:openejb/PersistenceUnit/" + id);
        } catch (Exception e) {
            throw new IllegalStateException(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

        try
        {
            InitialContext ic = new InitialContext();
            Context env = (Context)ic.lookup("java:comp/env");
            Log.debug("Unbinding java:comp/env/"+getJndiName());
            env.unbind(getJndiName());
        }
        catch (NamingException e)
        {
            Log.warn(e);
        }
View Full Code Here

        String unit = persistenceUnitGBean.getPersistenceUnitName();
        String rootUrl = persistenceUnitGBean.getPersistenceUnitRoot();
        String id = unit + " " + rootUrl.hashCode();
        Context context = SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext();
        try {
            context.unbind("java:openejb/PersistenceUnit/" + id);
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
    }
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.