javax.naming.Binding.getClassName()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(100)

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

Binding.getClassName介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

protected List<NameClassPair> found(final ContextNode contextNode) throws NamingException {
  final List<NameClassPair> nameClassPairs = new ArrayList<NameClassPair>();
  for (TreeNode childNode : contextNode.children.values()) {
    final Binding binding = childNode.binding;
    nameClassPairs.add(new NameClassPair(binding.getName(), binding.getClassName(), true));
  }
  return nameClassPairs;
}

代码示例来源:origin: apache/geode

public static Map<String, String> getBindingNamesRecursively(Context ctx) throws Exception {
  Map<String, String> result = new HashMap<>();
  NamingEnumeration<Binding> enumeration = ctx.listBindings("");

  while (enumeration.hasMore()) {
   Binding binding = enumeration.next();
   String name = binding.getName();
   String separator = name.endsWith(":") ? "" : "/";
   Object o = binding.getObject();
   if (o instanceof Context) {
    Map<String, String> innerBindings = getBindingNamesRecursively((Context) o);
    innerBindings.forEach((k, v) -> result.put(name + separator + k, v));
   } else {
    result.put(name, binding.getClassName());
   }
  }

  return result;
 }
}

代码示例来源:origin: javamelody/javamelody

private static JndiBinding createJndiBinding(String path, Binding binding) {
  final String name = getBindingName(path, binding);
  final String className = binding.getClassName();
  final Object object = binding.getObject();
  final String contextPath;
  final String value;
  if (object instanceof Context
      // "javax.naming.Context".equals(className) nécessaire pour le path "comp" dans JBoss 6.0
      || "javax.naming.Context".equals(className)
      // pour jetty :
      || object instanceof Reference
          && "javax.naming.Context".equals(((Reference) object).getClassName())) {
    if (!path.isEmpty()) {
      contextPath = path + '/' + name;
    } else {
      // nécessaire pour jonas 5.1.0
      contextPath = name;
    }
    value = null;
  } else {
    contextPath = null;
    value = formatValue(object);
  }
  return new JndiBinding(name, className, contextPath, value);
}

代码示例来源:origin: spring-projects/spring-framework

assertTrue("Correct jdbc subcontext", SimpleNamingContext.class.getName().equals(bindingMap.get("jdbc").getClassName()));
assertTrue("Correct DataSource registered", StubDataSource.class.getName().equals(subBindingMap.get("myds").getClassName()));
assertTrue("Correct DataSource registered", ds.equals(subBindingMap.get("mydsX").getObject()));
assertTrue("Correct DataSource registered", StubDataSource.class.getName().equals(subBindingMap.get("mydsX").getClassName()));
assertTrue("Correct Integer registered", i.equals(bindingMap.get("myinteger").getObject()));
assertTrue("Correct Integer registered", Integer.class.getName().equals(bindingMap.get("myinteger").getClassName()));
assertTrue("Correct String registered", s.equals(bindingMap.get("mystring").getObject()));
assertTrue("Correct String registered", String.class.getName().equals(bindingMap.get("mystring").getClassName()));

代码示例来源:origin: crashub/crash

Utils.instanceOf(instance.getObject().getClass(), filters)) {
if (pattern == null || pattern.matcher(fullName).find()) {
 data.add(new BindingRenderer.BindingData(fullName, instance.getClassName(), instance, verbose));

代码示例来源:origin: stackoverflow.com

NamingEnumeration<Binding> list = initialContext.listBindings("java:openejb/");
while (list.hasMore()) {
  Binding item = list.next();
  System.out.println(item.getClassName() +" :: " + "java:openejb/" + item.getName());
}

代码示例来源:origin: org.gatein.naming/gatein-naming

protected List<NameClassPair> found(final ContextNode contextNode) throws NamingException {
  final List<NameClassPair> nameClassPairs = new ArrayList<NameClassPair>();
  for (TreeNode childNode : contextNode.children.values()) {
    final Binding binding = childNode.binding;
    nameClassPairs.add(new NameClassPair(binding.getName(), binding.getClassName(), true));
  }
  return nameClassPairs;
}

代码示例来源:origin: org.eclipse.jetty/jetty-jndi

@Override
public NameClassPair next()
  throws NamingException
{
  Binding b = _delegate.next();
  return new NameClassPair(b.getName(),b.getClassName(),true);
}

代码示例来源:origin: org.eclipse.jetty/jetty-jndi

@Override
  public NameClassPair nextElement()
  {
    Binding b = _delegate.next();
    return new NameClassPair(b.getName(),b.getClassName(),true);
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public NameClassPair nextElement()
  {
    Binding b = _delegate.next();
    return new NameClassPair(b.getName(),b.getClassName(),true);
  }
}

代码示例来源:origin: org.mortbay.jetty/jetty-naming

public Object next()
  throws NamingException
{
  Binding b = (Binding)_delegate.nextElement();
  return new NameClassPair (b.getName(), b.getClassName(), true);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public NameClassPair next()
  throws NamingException
{
  Binding b = _delegate.next();
  return new NameClassPair(b.getName(),b.getClassName(),true);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

public NameClassPair next()
  throws NamingException
{
  Binding b = _delegate.next();
  return new NameClassPair(b.getName(),b.getClassName(),true);
}

代码示例来源:origin: org.mortbay.jetty/jetty-naming

public Object nextElement()
  {
    Binding b = (Binding)_delegate.nextElement();
    return new NameClassPair (b.getName(), b.getClassName(), true);
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public Binding next()
  throws NamingException
{
  Binding b = (Binding)_delegate.next();
  return new Binding (b.getName(), b.getClassName(), b.getObject(), true);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public Binding nextElement()
  {
    Binding b = (Binding)_delegate.next();
    return new Binding (b.getName(), b.getClassName(), b.getObject(),true);
  }
}

代码示例来源:origin: org.eclipse.jetty/jetty-jndi

@Override
public Binding next()
  throws NamingException
{
  Binding b = (Binding)_delegate.next();
  return new Binding (b.getName(), b.getClassName(), b.getObject(), true);
}

代码示例来源:origin: org.eclipse.jetty/jetty-jndi

@Override
  public Binding nextElement()
  {
    Binding b = (Binding)_delegate.next();
    return new Binding (b.getName(), b.getClassName(), b.getObject(),true);
  }
}

代码示例来源:origin: org.mortbay.jetty/jetty-naming

public Object next()
  throws NamingException
{
  Binding b = (Binding)_delegate.nextElement();
  return new Binding (b.getName(), b.getClassName(), b.getObject(), true);
}

代码示例来源:origin: org.mortbay.jetty/jetty-naming

public Object nextElement()
  {
    Binding b = (Binding)_delegate.nextElement();
    return new Binding (b.getName(), b.getClassName(), b.getObject(),true);
  }
}

相关文章