当前位置: 首页>>代码示例>>Java>>正文


Java Binding.getName方法代码示例

本文整理汇总了Java中javax.naming.Binding.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Binding.getName方法的具体用法?Java Binding.getName怎么用?Java Binding.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.naming.Binding的用法示例。


在下文中一共展示了Binding.getName方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listCollectionPaths

import javax.naming.Binding; //导入方法依赖的package包/类
/**
 * List resource paths (recursively), and store all of them in the given
 * Set.
 */
private static void listCollectionPaths(Set<String> set,
        DirContext resources, String path) throws NamingException {

    Enumeration<Binding> childPaths = resources.listBindings(path);
    while (childPaths.hasMoreElements()) {
        Binding binding = childPaths.nextElement();
        String name = binding.getName();
        StringBuilder childPath = new StringBuilder(path);
        if (!"/".equals(path) && !path.endsWith("/"))
            childPath.append("/");
        childPath.append(name);
        Object object = binding.getObject();
        if (object instanceof DirContext) {
            childPath.append("/");
        }
        set.add(childPath.toString());
    }

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:24,代码来源:ApplicationContext.java

示例2: while

import javax.naming.Binding; //导入方法依赖的package包/类
/**
 * List resource paths (recursively), and store all of them in the given
 * Set.
 */
private static void listCollectionPaths
    (Set set, DirContext resources, String path)
    throws NamingException {

    Enumeration childPaths = resources.listBindings(path);
    while (childPaths.hasMoreElements()) {
        Binding binding = (Binding) childPaths.nextElement();
        String name = binding.getName();
        StringBuffer childPath = new StringBuffer(path);
        if (!"/".equals(path) && !path.endsWith("/"))
            childPath.append("/");
        childPath.append(name);
        Object object = binding.getObject();
        if (object instanceof DirContext) {
            childPath.append("/");
        }
        set.add(childPath.toString());
    }

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:ApplicationContext.java

示例3: listPaths

import javax.naming.Binding; //导入方法依赖的package包/类
/**
 * List resource paths (recursively), and store all of them in the given
 * Set.
 */
private static void listPaths(Set set, DirContext resources, String path)
    throws NamingException {

    Enumeration childPaths = resources.listBindings(path);
    while (childPaths.hasMoreElements()) {
        Binding binding = (Binding) childPaths.nextElement();
        String name = binding.getName();
        String childPath = path + "/" + name;
        set.add(childPath);
        Object object = binding.getObject();
        if (object instanceof DirContext) {
            listPaths(set, resources, childPath);
        }
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:21,代码来源:ApplicationContext.java

示例4: listCollectionPaths

import javax.naming.Binding; //导入方法依赖的package包/类
/**
 * List resource paths (recursively), and store all of them in the given
 * Set.
 */
private static void listCollectionPaths(Set<String> set, DirContext resources, String path) throws NamingException {

	Enumeration<Binding> childPaths = resources.listBindings(path);
	while (childPaths.hasMoreElements()) {
		Binding binding = childPaths.nextElement();
		String name = binding.getName();
		StringBuilder childPath = new StringBuilder(path);
		if (!"/".equals(path) && !path.endsWith("/"))
			childPath.append("/");
		childPath.append(name);
		Object object = binding.getObject();
		if (object instanceof DirContext) {
			childPath.append("/");
		}
		set.add(childPath.toString());
	}

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:23,代码来源:ApplicationContext.java

示例5: listContext

import javax.naming.Binding; //导入方法依赖的package包/类
/**
 * Recursively exhaust the JNDI tree
 */
private static final void listContext(javax.naming.Context ctx, String indent) {
   try {
      NamingEnumeration<Binding> list = ctx.listBindings("");
      while (list.hasMore()) {
         Binding item = (Binding) list.next();
         String className = item.getClassName();
         String name = item.getName();
         log.info(indent + className + " | " + name);
         Object o = item.getObject();
         if (o instanceof javax.naming.Context) {
            listContext((javax.naming.Context) o, indent + "   ");
         }
      }
   } catch (NamingException ex) {
      log.warn("JNDI failure: ", ex);
   }
}
 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:21,代码来源:EESchedulerTask.java

示例6: getNameInNamespace

import javax.naming.Binding; //导入方法依赖的package包/类
public String getNameInNamespace(long companyId, Binding binding)
		throws Exception {

	String baseDN = PrefsPropsUtil.getString(companyId,
			PropsKeys.LDAP_BASE_DN);

	if (Validator.isNull(baseDN)) {
		return binding.getName();
	} else {
		StringBuilder sb = new StringBuilder();

		sb.append(binding.getName());
		sb.append(StringPool.COMMA);
		sb.append(baseDN);

		return sb.toString();
	}
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:19,代码来源:ManagerLdap.java

示例7: createMBeans

import javax.naming.Binding; //导入方法依赖的package包/类
/**
 * Create the MBeans for the interesting global JNDI resources in
 * the specified naming context.
 *
 * @param prefix Prefix for complete object name paths
 * @param context Context to be scanned
 *
 * @exception NamingException if a JNDI exception occurs
 */
protected void createMBeans(String prefix, Context context)
    throws NamingException {

    if (debug >= 1) {
        log("Creating MBeans for Global JNDI Resources in Context '" +
            prefix + "'");
    }

    NamingEnumeration bindings = context.listBindings("");
    while (bindings.hasMore()) {
        Binding binding = (Binding) bindings.next();
        String name = prefix + binding.getName();
        Object value = context.lookup(binding.getName());
        if (debug >= 2) {
            log("Checking resource " + name);
        }
        if (value instanceof Context) {
            createMBeans(name + "/", (Context) value);
        } else if (value instanceof UserDatabase) {
            try {
                createMBeans(name, (UserDatabase) value);
            } catch (Exception e) {
                log("Exception creating UserDatabase MBeans for " + name,
                    e);
            }
        }
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:39,代码来源:GlobalResourcesLifecycleListener.java

示例8: getBindingName

import javax.naming.Binding; //导入方法依赖的package包/类
private static String getBindingName(String path, Binding binding) {
	// nécessaire pour glassfish 3.0.1
	String result = binding.getName();
	if (result.startsWith(JNDI_PREFIX)) {
		result = result.substring(JNDI_PREFIX.length());
	}
	if (result.startsWith(path)) {
		result = result.substring(path.length());
	}
	if (!result.isEmpty() && result.charAt(0) == '/') {
		result = result.substring(1);
	}
	return result;
}
 
开发者ID:javamelody,项目名称:javamelody,代码行数:15,代码来源:JndiBinding.java

示例9: tearDownRecursively

import javax.naming.Binding; //导入方法依赖的package包/类
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);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:12,代码来源:JNDIUtil.java

示例10: toString

import javax.naming.Binding; //导入方法依赖的package包/类
private static String toString(StringBuffer buf, int i, Context ctx)
		throws NamingException {

	int j = i + 4;
	space(buf, i);
	buf.append(ctx + " {").append("\n");

	NamingEnumeration<Binding> enumeration = ctx.listBindings("");
	while (enumeration.hasMoreElements()) {
		Binding r = enumeration.nextElement();
		space(buf, j);
		if (r.getName() != null) {
			buf.append(r.getName());
			if (ctx instanceof DirContext) {
				buf.append(" ");
				buf.append(toString(((DirContext) ctx).getAttributes(r
						.getName())));
			}
		}
		buf.append(" = ");
		if (r.getObject() instanceof Context) {
			toString(buf, j, (Context) r.getObject());
		} else {
			buf.append(r.getObject() == null ? "" : r.getObject());
		}
		buf.append("\n");
	}

	space(buf, i);
	buf.append("}");
	return buf.toString();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:33,代码来源:Util.java

示例11: dumpContext

import javax.naming.Binding; //导入方法依赖的package包/类
private static void dumpContext(String contextName) throws IOException {

        try {

            InitialContext ic = new InitialContext();

            Context c = (Context)ic.lookup(contextName);

            NamingEnumeration<Binding>  be = c.listBindings("/");

            String s = "\n\n" + contextName + ":\n";

            while(be.hasMore()) {

                Binding b = be.next();
                s += "        " + b.getName() + " -> " + b.getObject() + " (" + b.getClassName() + ")\n";
            }

            log.info(s);

            ic.close();
        }
        catch (Exception e) {

            throw new IOException(e);
        }
    }
 
开发者ID:NovaOrdis,项目名称:playground,代码行数:28,代码来源:ServletA.java


注:本文中的javax.naming.Binding.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。