@Override protected Object doOperation(HttpServerExchange exchange, String name) throws NamingException { localContext.unbind(name); return null; } }
public Object doInContext(Context ctx) throws NamingException { ctx.unbind(name); return null; } });
@Override public void unbind(String name) throws NamingException { context.unbind(name); }
@Override public void unbind(Name name) throws NamingException { context.unbind(name); }
/** * Remove the binding for the given name from the current JNDI context. * @param name the JNDI name of the object * @throws NamingException thrown by JNDI, mostly name not found */ public void unbind(final String name) throws NamingException { if (logger.isDebugEnabled()) { logger.debug("Unbinding JNDI object with name [" + name + "]"); } execute(ctx -> { ctx.unbind(name); return null; }); }
/** * Remove the binding for the given name from the current JNDI context. * @param name the JNDI name of the object * @throws NamingException thrown by JNDI, mostly name not found */ public void unbind(final String name) throws NamingException { if (logger.isDebugEnabled()) { logger.debug("Unbinding JNDI object with name [" + name + "]"); } execute(ctx -> { ctx.unbind(name); return null; }); }
@Override public void unbind(final Name name) throws NamingException { CNCtxFactory.INSTANCE.getInitialContext(environment).unbind(name); }
public static void unMapDatasource(String jndiName) throws NamingException { ctx.unbind("java:/" + jndiName); Object removedDataSource = dataSourceMap.remove(jndiName); closeDataSource(removedDataSource); }
@Override public void unbind(final String name) throws NamingException { CNCtxFactory.INSTANCE.getInitialContext(environment).unbind(name); }
public static CompoundName unbindObjectName(final Context context, final ObjectName on) throws NullPointerException, NamingException { CompoundName key = getCompoundName(on); context.unbind(key); return key; }
private static void cleanup() { if (transactionManager instanceof TransactionManagerImpl) { TransactionManagerImpl.refresh(); // unbind and set TransactionManager to null, so as to // initialize TXManager correctly if the cache is being restarted transactionManager = null; try { if (ctx != null) { ctx.unbind("java:/TransactionManager"); } } catch (NamingException e) { // ok to ignore, rebind will be tried later } } dataSourceMap.values().stream().forEach(JNDIInvoker::closeDataSource); dataSourceMap.clear(); IGNORE_JTA = Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "ignoreJTA"); }
@Override public void unbind(final Name name) throws NamingException { Assert.checkNotNullParam("name", name); final ReparsedName reparsedName = reparse(name); ContextResult result = getProviderContext(reparsedName.getUrlScheme()); if(result.oldStyle) { result.context.unbind(name); } else { result.context.unbind(reparsedName.getName()); } }
public static void tearDownRecursively(final Context c) throws Exception { for (NamingEnumeration<Binding> ne = c.listBindings(""); ne.hasMore(); ) { Binding b = ne.next(); String name = b.getName(); Object object = b.getObject(); if (object instanceof Context) { JNDIUtil.tearDownRecursively((Context) object); } c.unbind(name); } }
@Override public void unbind(final String name) throws NamingException { Assert.checkNotNullParam("name", name); final ReparsedName reparsedName = reparse(getNameParser().parse(name)); ContextResult result = getProviderContext(reparsedName.getUrlScheme()); if(result.oldStyle) { result.context.unbind(name); } else { result.context.unbind(reparsedName.getName()); } }
public void unbind(Name name) throws NamingException { final ParsedName parsedName = parse(name); final Context namespaceContext = findContext(name, parsedName); if (namespaceContext == null) super.unbind(parsedName.remaining()); else namespaceContext.unbind(parsedName.remaining()); }
@Test public void testUnbind() throws Exception { String name = "something"; final Context context = mock(Context.class); JndiTemplate jt = new JndiTemplate() { @Override protected Context createInitialContext() { return context; } }; jt.unbind(name); verify(context).unbind(name); verify(context).close(); }
assertTrue(ctx.lookup(name) == o); ctx.unbind(name); try { ctx = new InitialContext();
/** * Converts the "Name" name into a NameComponent[] object and * performs the unbind operation. Uses callUnbind. Throws an * invalid name exception if the name is empty. * * @param name string * @throws NamingException See callUnbind */ public void unbind(Name name) throws NamingException { if (name.size() == 0) throw IIOPLogger.ROOT_LOGGER.invalidEmptyName(); NameComponent[] path = org.wildfly.iiop.openjdk.naming.jndi.CNNameParser.nameToCosName(name); try { callUnbind(path); } catch (CannotProceedException e) { javax.naming.Context cctx = getContinuationContext(e); cctx.unbind(e.getRemainingName()); } }
context3.unbind("myobject");
/** * Removes all entries from the specified context, including subcontexts. * * @param context context to clear */ private void clearContext(Context context) throws NamingException { for (NamingEnumeration e = context.listBindings(""); e.hasMoreElements();) { Binding binding = (Binding) e.nextElement(); if (binding.getObject() instanceof Context) { clearContext((Context) binding.getObject()); } context.unbind(binding.getName()); } }