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

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

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

Util.bind介绍

[英]Bind val to name in ctx, and make sure that all intermediate contexts exist
[中]将val绑定到ctx中的name,并确保所有中间上下文都存在

代码示例

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

  1. /**
  2. * Binds the {@link TimerService} to {@link #jndiName} under {@link #context}
  3. *
  4. * @throws NamingException If there is any exception during the bind operation
  5. */
  6. public void start() throws NamingException
  7. {
  8. Reference ref = new Reference(TimerService.class.getName(), TimerServiceObjectFactory.class.getName(), null);
  9. Util.bind(this.context, jndiName, ref);
  10. }

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

  1. @SuppressWarnings({"deprecation"})
  2. protected void bind(Context ctx, String name, Object obj) throws NamingException
  3. {
  4. if(log.isDebugEnabled())
  5. log.debug("Binding " + obj + " at " + name + " under " + ctx);
  6. Util.bind(ctx, name, obj);
  7. }

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

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

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

  1. /** Bind val to name in ctx, and make sure that all intermediate contexts exist
  2. @param ctx the parent JNDI Context under which value will be bound
  3. @param name the name relative to ctx where value will be bound
  4. @param value the value to bind.
  5. @throws NamingException for any error
  6. */
  7. public static void bind(Context ctx, String name, Object value) throws NamingException
  8. {
  9. Name n = ctx.getNameParser("").parse(name);
  10. bind(ctx, n, value);
  11. }

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

  1. if (type == String.class)
  2. Util.bind(ctx, entry.getName(), entry.getValue());
  3. Util.bind(ctx, entry.getName(), new Integer(entry.getValue()));
  4. Util.bind(ctx, entry.getName(), new Long(entry.getValue()));
  5. Util.bind(ctx, entry.getName(), new Double(entry.getValue()));
  6. Util.bind(ctx, entry.getName(), new Float(entry.getValue()));
  7. Util.bind(ctx, entry.getName(), new Byte(entry.getValue()));
  8. Util.bind(ctx, entry.getName(), value);
  9. Util.bind(ctx, entry.getName(), new Short(entry.getValue()));
  10. Util.bind(ctx, entry.getName(), new Boolean(entry.getValue()));
  11. Util.bind(ctx, entry.getName(), entry.getValue());

代码示例来源:origin: org.jboss.ws/jbossws-jboss510-metadata

  1. public void bindServiceRef(Context encCtx, String encName, UnifiedVirtualFile vfsRoot, ClassLoader loader, ServiceReferenceMetaData sref) throws NamingException
  2. {
  3. if (!sref.isProcessed())
  4. {
  5. final UnifiedServiceRefMetaData spiRef = getUnifiedServiceRefMetaData(vfsRoot, sref);
  6. final Referenceable jndiReferenceable = delegate.createReferenceable(spiRef);
  7. final String jndiFullName = encCtx.getNameInNamespace() + "/" + encName;
  8. log.info("Binding service reference to [jndi=" + jndiFullName + "]");
  9. Util.bind(encCtx, encName, jndiReferenceable);
  10. sref.setProcessed(true);
  11. }
  12. }

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

  1. Util.bind(ctx, jndiName, psProxy);
  2. log.debug("Bound ProfileService proxy under: "+jndiName);
  3. if(mgtViewJndiName != null && mgtViewJndiName.length() > 0)
  4. Util.bind(ctx, mgtViewJndiName, mgtViewProxy);
  5. log.debug("Bound ManagementView proxy under: "+mgtViewJndiName);
  6. if(deployMgrJndiName != null && deployMgrJndiName.length() > 0)
  7. Util.bind(ctx, deployMgrJndiName, deployMgrProxy);
  8. log.debug("Bound DeploymentManager proxy under: "+deployMgrJndiName);

相关文章