org.jboss.util.naming.Util.unbind()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中org.jboss.util.naming.Util.unbind()方法的一些代码示例,展示了Util.unbind()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.unbind()方法的具体详情如下:
包路径:org.jboss.util.naming.Util
类名称:Util
方法名:unbind

Util.unbind介绍

[英]Unbinds a name from ctx, and removes parents if they are empty
[中]从ctx中取消绑定名称,如果父项为空,则删除父项

代码示例

代码示例来源:origin: org.jboss.ejb3/jboss-ejb3-core

  1. public void stop() throws Exception
  2. {
  3. Util.unbind(ctx, jndiName);
  4. }
  5. }

代码示例来源:origin: org.jboss.reloaded/jboss-reloaded-naming-deployers

  1. @Override
  2. public void stop() throws Exception
  3. {
  4. Util.unbind(parentContext, name);
  5. context = null;
  6. parentContext = null;
  7. }

代码示例来源:origin: org.jboss.ejb3/jboss-ejb3-timerservice-naming

  1. /**
  2. * Unbinds {@link TimerService} from {@link #jndiName} under {@link #context}
  3. * @throws NamingException If there is any exception during the bind operation
  4. */
  5. public void stop() throws NamingException
  6. {
  7. Util.unbind(this.context, jndiName);
  8. }
  9. }

代码示例来源:origin: org.mobicents.core/mobicents-core-jar

  1. /**
  2. * Unregister an internal slee component with jndi.
  3. *
  4. * @param Name -
  5. * the full path to the resource except the "java:" prefix.
  6. */
  7. public static void unregisterWithJndi(String name) {
  8. Context ctx;
  9. String path = JVM_ENV + name;
  10. try {
  11. ctx = new InitialContext();
  12. Util.unbind(ctx, path);
  13. } catch (NamingException ex) {
  14. logger.warn("unregisterWithJndi failed for " + path);
  15. }
  16. }

代码示例来源:origin: org.jboss.jbossas/jboss-as-profileservice

  1. public void stop()
  2. throws Exception
  3. {
  4. Dispatcher.singleton.unregisterTarget(dispatchName);
  5. String mvDispatchName = dispatchName+".ManagementView";
  6. Dispatcher.singleton.unregisterTarget(mvDispatchName);
  7. InitialContext ctx = new InitialContext();
  8. Util.unbind(ctx, jndiName);
  9. log.debug("Unbound ProfileService proxy");
  10. if(mgtViewJndiName != null && mgtViewJndiName.length() > 0)
  11. {
  12. Util.unbind(ctx, mgtViewJndiName);
  13. log.debug("Unbound ManagementView proxy");
  14. }
  15. if(deployMgrJndiName != null && deployMgrJndiName.length() > 0)
  16. {
  17. Util.unbind(ctx, deployMgrJndiName);
  18. log.debug("Unbound DeploymentManager proxy");
  19. }
  20. //
  21. if(createEjb3Links)
  22. {
  23. Util.unbind(ctx, "SecureProfileService/remote");
  24. Util.unbind(ctx, "SecureManagementView/remote");
  25. Util.unbind(ctx, "SecureDeploymentManager/remote");
  26. log.debug("Unbound links back to secure ejb names");
  27. }
  28. }
  29. }

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

  1. /**
  2. * Unbind the object from jndi
  3. *
  4. * @throws Exception for any error
  5. */
  6. protected void unbind() throws Exception
  7. {
  8. InitialContext ctx = new InitialContext();
  9. try
  10. {
  11. Util.unbind(ctx, jndiName);
  12. log.info("Unbound admin object at '" + jndiName + "'");
  13. }
  14. finally
  15. {
  16. ctx.close();
  17. }
  18. }
  19. }

代码示例来源:origin: org.mobicents.core/mobicents-core-jar

  1. public void stopRMIServer() {
  2. try {
  3. if (logger.isDebugEnabled()) {
  4. logger.debug("Stopping RMI Server for slee service");
  5. }
  6. InitialContext ctx = new InitialContext();
  7. Util.unbind(ctx, "/SleeService");
  8. rmiServer.destroy();
  9. } catch (NamingException e) {
  10. logger.error(
  11. "Failed to stop RMI Server for remote slee service", e);
  12. }
  13. }

代码示例来源:origin: org.mobicents.core/mobicents-core-jar

  1. public void stopRMIServer() {
  2. try {
  3. if (logger.isDebugEnabled()) {
  4. logger.debug("Stopping HA RMI Server for slee service");
  5. }
  6. InitialContext ctx = new InitialContext();
  7. Util.unbind(ctx, "/SleeService");
  8. rmiServer.destroy();
  9. } catch (NamingException e) {
  10. logger
  11. .error("Failed to stop HA RMI Server for remote slee service",
  12. e);
  13. }
  14. }
  15. }

代码示例来源:origin: org.mobicents.core/mobicents-core-jar

  1. private void cleanNamingContext() throws NamingException {
  2. Context ctx = new InitialContext();
  3. Util.unbind(ctx, getFactoryInterfaceJNDIName());
  4. Util.unbind(ctx, getInterfaceJNDIName());
  5. if (log.isDebugEnabled()) {
  6. log.debug("Context " + getFactoryInterfaceJNDIName() + " unbound from Naming Service");
  7. }
  8. }

代码示例来源:origin: org.jboss/jboss-common-core

  1. /** Unbinds a name from ctx, and removes parents if they are empty
  2. @param ctx the parent JNDI Context under which the name will be unbound
  3. @param name The name to unbind
  4. @throws NamingException for any error
  5. */
  6. public static void unbind(Context ctx, String name) throws NamingException
  7. {
  8. unbind(ctx, ctx.getNameParser("").parse(name));
  9. }

代码示例来源:origin: org.jboss.ejb3/jboss-ejb3-core

  1. public void stop() throws Exception
  2. {
  3. super.stop();
  4. Util.unbind(ctx, jndiName + PROXY_FACTORY_NAME);
  5. Dispatcher.singleton.unregisterTarget(jndiName + PROXY_FACTORY_NAME);
  6. }
  7. }

代码示例来源:origin: org.mobicents.servlet.sip.containers/sip-servlets-tomcat-jboss4

  1. InitialContext iniCtx = new InitialContext();
  2. Context applicationNameEnvCtx = (Context) iniCtx.lookup("java:/sip/" + applicationName);
  3. Util.unbind(applicationNameEnvCtx,SipNamingContextListener.SIP_FACTORY_JNDI_NAME);
  4. Util.unbind(applicationNameEnvCtx, SipNamingContextListener.SIP_SESSIONS_UTIL_JNDI_NAME);
  5. Util.unbind(applicationNameEnvCtx,SipNamingContextListener.TIMER_SERVICE_JNDI_NAME);
  6. Context sipEnvCtx = (Context) iniCtx.lookup("java:/sip/");
  7. Util.unbind(sipEnvCtx, applicationName);
  8. } catch (OperationNotSupportedException onse) {
  9. log.warn("Could not remove the JNDI context java:/sip/" + applicationName + ", cause " + onse.getMessage());

代码示例来源:origin: org.mobicents.core/mobicents-core-jar

  1. private void unbindFromJndi() {
  2. Context ctx;
  3. try {
  4. ctx = new InitialContext();
  5. ComponentKey key = resourceAdaptorId.getComponentKey();
  6. Util.unbind(ctx, CTX_JAVA_SLEE_RESOURCES + "/" + key.getName() + "/" + key.getVendor() + "/" + key.getVersion());
  7. } catch (NamingException e) {
  8. log.error("Failed binding RA in JNDI. RA ID: " + resourceAdaptorId, e);
  9. }
  10. }

代码示例来源:origin: org.jboss.switchboard/jboss-switchboard-mc-impl

  1. Util.unbind(ctx, relativeJndiName);

代码示例来源:origin: org.mobicents.core/mobicents-core-jar

  1. /**
  2. *
  3. * Cleanup in the reverse order of init()
  4. *
  5. * @throws NamingException
  6. *
  7. */
  8. public void close() throws NamingException {
  9. // Cleaning up the cache is not desired for failover scenarios.
  10. // Cache should be cleaned only when the last node in a SLEE cluster is
  11. // shutting down.
  12. // TODO: cleanSleeCache();
  13. unregisterWithJndi();
  14. Context ctx = new InitialContext();
  15. Util.unbind(ctx, JVM_ENV + CTX_SLEE);
  16. // closeSipResourceAdaptor();
  17. closeTckResourceAdaptor();
  18. stopRMIServer();
  19. }

代码示例来源:origin: org.jboss.ejb3/jboss-ejb3-core

  1. public static void unbind(Context ctx, String strName) throws NamingException
  2. {
  3. Name name = ctx.getNameParser("").parse(strName);
  4. int size = name.size();
  5. String atom = name.get(size - 1);
  6. Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
  7. String key = parentCtx.getNameInNamespace() + "/" + atom;
  8. wrapperMap.remove(key);
  9. Util.unbind(ctx, strName);
  10. }

相关文章