FileDocCategorySizeDatePackage
ContextHolder.javaAPI DocExample1752Thu Nov 08 00:22:56 GMT 2001com.ora.rmibook.chapter15.impl

ContextHolder

public class ContextHolder extends Object

Fields Summary
private HashMap
_namesToContexts
Constructors Summary
public ContextHolder()

        _namesToContexts = new HashMap();
    
Methods Summary
public synchronized voidbind(java.lang.String name, Context context)

        if ((null == name) || (null == context)) {
            return;
        }
        Object priorValue = _namesToContexts.get(name);

        if (null != priorValue) {
            throw new BindingException("Attempt to bind context to an already bound name.");
        }
        _namesToContexts.put(name, context);
        return;
    
public synchronized ContextListlist()

        return new ContextList(_namesToContexts.values());
    
public synchronized Contextlookup(java.lang.String name)

        if (null == name) {
            return null;
        }
        return (Context) _namesToContexts.get(name);
    
public synchronized voidrebind(java.lang.String name, Context context)

        if (null == name) {
            return;
        }
        if (null == context) {
            _namesToContexts.remove(name);
            return;
        }
        _namesToContexts.put(name, context);
        return;
    
public synchronized voidunbind(java.lang.String name)

        if (null == name) {
            return;
        }
        _namesToContexts.remove(name);
        return;