Example usage for javax.naming NotContextException NotContextException

List of usage examples for javax.naming NotContextException NotContextException

Introduction

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

Prototype

public NotContextException() 

Source Link

Document

Constructs a new instance of NotContextException.

Usage

From source file:com.dattack.naming.AbstractContext.java

@Override
public NameParser getNameParser(final Name name) throws NamingException {

    if (name == null || name.isEmpty() || (name.size() == 1 && name.toString().equals(getNameInNamespace()))) {
        return nameParser;
    }//from  w  w w.  j  a  v  a  2 s .  c o m

    final Name subName = name.getPrefix(1);
    if (subContexts.containsKey(subName)) {
        return subContexts.get(subName).getNameParser(name.getSuffix(1));
    }

    throw new NotContextException();
}