public static void main(final String[] args) { final ParsedName name = new ParsedName("comp/env/jdbc/mydatabase"); while (name.next()) { System.out.println(name.getComponent()); } }
public static void main(final String[] args) { final ParsedName name = new ParsedName("comp/env/jdbc/mydatabase"); while (name.next()) { System.out.println(name.getComponent()); } }
public static void main(String [] args) { ParsedName name = new ParsedName("comp/env/jdbc/mydatabase"); while (name.next()) System.out.println(name.getComponent()); }
public NameNode(NameNode parent, ParsedName name, Object obj, NameNode parentTree) { atomicName = name.getComponent(); atomicHash = name.getComponentHashCode(); this.parent = parent; this.parentTree = parentTree; if (name.next()) subTree = new NameNode(this, name, obj, this); else myObject = obj; }
public NameNode(final NameNode parent, final ParsedName name, final Object obj, final NameNode parentTree) { atomicName = name.getComponent(); atomicHash = name.getComponentHashCode(); this.parent = parent; this.parentTree = parentTree; if (name.next()) { subTree = new NameNode(this, name, obj, this); } else if (obj instanceof Context) { myObject = new Federation(); ((Federation) myObject).add((Context) obj); } else { myObject = obj; } }
public NameNode(final NameNode parent, final ParsedName name, final Object obj, final NameNode parentTree) { atomicName = name.getComponent(); atomicHash = name.getComponentHashCode(); this.parent = parent; this.parentTree = parentTree; if (name.next()) { subTree = new NameNode(this, name, obj, this); } else if (obj instanceof Context) { myObject = new Federation(); ((Federation) myObject).add((Context) obj); } else { myObject = obj; } }
public void unbind(final ParsedName name) throws NameAlreadyBoundException { final int compareResult = name.compareTo(atomicHash); if (compareResult == ParsedName.IS_EQUAL && name.getComponent().equals(atomicName)) { if (name.next()) { if (subTree != null) { subTree.unbind(name); } } else { unbound = true; myObject = null; parentTree.unbind(this); } } else if (compareResult == ParsedName.IS_LESS) { if (lessTree != null) { lessTree.unbind(name); } } else {//ParsedName.IS_GREATER ... if (grtrTree != null) { grtrTree.unbind(name); } } }
public void unbind(final ParsedName name) throws NameAlreadyBoundException { final int compareResult = name.compareTo(atomicHash); if (compareResult == ParsedName.IS_EQUAL && name.getComponent().equals(atomicName)) { if (name.next()) { if (subTree != null) { subTree.unbind(name); } } else { unbound = true; myObject = null; parentTree.unbind(this); } } else if (compareResult == ParsedName.IS_LESS) { if (lessTree != null) { lessTree.unbind(name); } } else {//ParsedName.IS_GREATER ... if (grtrTree != null) { grtrTree.unbind(name); } } }
public void unbind(ParsedName name) throws javax.naming.NameAlreadyBoundException { int compareResult = name.compareTo(atomicHash); if (compareResult == ParsedName.IS_EQUAL && name.getComponent().equals(atomicName)) { if (name.next()) { if (subTree != null) { subTree.unbind(name); } } else { unbound = true; myObject = null; parentTree.unbind(this); } } else if (compareResult == ParsedName.IS_LESS) { if (lessTree != null) { lessTree.unbind(name); } } else {//ParsedName.IS_GREATER ... if (grtrTree != null) grtrTree.unbind(name); } }
public Object resolve(ParsedName name) throws javax.naming.NameNotFoundException { int compareResult = name.compareTo(atomicHash); if (compareResult == ParsedName.IS_EQUAL && name.getComponent().equals(atomicName)) {// hashcodes and String valuse are equal if (name.next()) { if (subTree == null) throw new javax.naming.NameNotFoundException("Cannot resolve " + name); return subTree.resolve(name); } else if (unbound){ throw new javax.naming.NameNotFoundException("Cannot resolve " + name); } else { return getBinding(); } } else if (compareResult == ParsedName.IS_LESS) {// parsed hash is less than if (lessTree == null) throw new javax.naming.NameNotFoundException("Cannot resolve " + name); return lessTree.resolve(name); } else {//ParsedName.IS_GREATER if (grtrTree == null) throw new javax.naming.NameNotFoundException("Cannot resolve " + name); return grtrTree.resolve(name); } }
public void bind(ParsedName name, Object obj) throws javax.naming.NameAlreadyBoundException { int compareResult = name.compareTo(atomicHash); if (compareResult == ParsedName.IS_EQUAL && name.getComponent().equals(atomicName)) { if (name.next()) { if (myObject != null) { throw new javax.naming.NameAlreadyBoundException();
if (compareResult == ParsedName.IS_EQUAL && name.getComponent().equals(atomicName)) { if (name.next()) { if (subTree != null) { try {
if (compareResult == ParsedName.IS_EQUAL && name.getComponent().equals(atomicName)) { if (name.next()) { if (subTree != null) { try {
public void bind(final ParsedName name, final Object obj) throws NameAlreadyBoundException { final int compareResult = name.compareTo(atomicHash); if (compareResult == ParsedName.IS_EQUAL && name.getComponent().equals(atomicName)) { if (name.next()) { if (myObject != null && !(myObject instanceof Federation)) { throw new NameAlreadyBoundException();
public void bind(final ParsedName name, final Object obj) throws NameAlreadyBoundException { final int compareResult = name.compareTo(atomicHash); if (compareResult == ParsedName.IS_EQUAL && name.getComponent().equals(atomicName)) { if (name.next()) { if (myObject != null && !(myObject instanceof Federation)) { throw new NameAlreadyBoundException();