Example usage for javax.naming CompositeName getPrefix

List of usage examples for javax.naming CompositeName getPrefix

Introduction

In this page you can find the example usage for javax.naming CompositeName getPrefix.

Prototype

public Name getPrefix(int posn) 

Source Link

Document

Creates a composite name whose components consist of a prefix of the components in this composite name.

Usage

From source file:org.eclipse.ecr.runtime.jtajca.NuxeoContainer.java

protected static void addDeepBinding(Context dir, CompositeName comp, Object obj) throws NamingException {
    Name name = comp.getPrefix(1);
    if (comp.size() == 1) {
        addBinding(dir, name, obj);//from  w  w w .  ja  va  2  s. co  m
        return;
    }
    Context subdir;
    try {
        subdir = (Context) dir.lookup(name);
    } catch (NamingException e) {
        subdir = dir.createSubcontext(name);
    }
    addDeepBinding(subdir, (CompositeName) comp.getSuffix(1), obj);
}