nl.tudelft.simulation.naming
Class JVMContext

java.lang.Object
  extended by nl.tudelft.simulation.event.EventProducer
      extended by nl.tudelft.simulation.naming.JVMContext
All Implemented Interfaces:
Serializable, Context, EventContext, EventProducerInterface
Direct Known Subclasses:
FileContext

public class JVMContext
extends EventProducer
implements EventContext, EventProducerInterface, Serializable

The JVMContext as implementation of the Context interface. The JVM context is an in-memory context implementation

(c) copyright 2002-2005 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.2
Version:
1.5 2004-03-24
Author:
Peter Jacobs
Niels Lang
See Also:
Serialized Form

Field Summary
static EventType CHILD_ADDED_EVENT
          CHILD_ADDED_EVENT is fired whenever a child is added
static EventType CHILD_REMOVED_EVENT
          CHILD_REMOVED_EVENT is fired whenever a child is removed
protected  Map elements
          the children
protected  List eventListeners
          the eventListeners
static EventType NUMBER_CHANGED_EVENT
          NUMBER_CHANGED_EVENT is fired whenever the number of children changes
protected  Context parent
          the parent context
protected  NameParser parser
          the nameParser
 
Fields inherited from class nl.tudelft.simulation.event.EventProducer
listeners
 
Fields inherited from interface javax.naming.event.EventContext
OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPE
 
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
 
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
 
Constructor Summary
JVMContext()
          constructs a new JVMContext.
JVMContext(Context parent, String atomicName)
          constructs a new JVMContext
 
Method Summary
 void addNamingListener(Name target, int scope, NamingListener l)
           
 void addNamingListener(String target, int scope, NamingListener l)
           
 Object addToEnvironment(String arg0, Object arg1)
           
 void bind(Name name, Object value)
           
 void bind(String name, Object value)
           
 Object clone()
           
 void close()
           
 Name composeName(Name arg0, Name arg1)
           
 String composeName(String arg0, String arg1)
           
 Context createSubcontext(Name name)
           
 Context createSubcontext(String arg0)
           
 void destroySubcontext(Name name)
           
 void destroySubcontext(String name)
           
 Hashtable getEnvironment()
           
 String getNameInNamespace()
           
 NameParser getNameParser(Name name)
           
 NameParser getNameParser(String name)
           
 NamingEnumeration list(Name name)
           
 NamingEnumeration list(String name)
           
 NamingEnumeration listBindings(Name name)
           
 NamingEnumeration listBindings(String name)
           
 Object lookup(Name name)
           
 Object lookup(String arg0)
           
 Object lookupLink(Name name)
           
 Object lookupLink(String name)
           
 void rebind(Name name, Object value)
           
 void rebind(String name, Object value)
           
 Object removeFromEnvironment(String arg0)
           
 void removeNamingListener(NamingListener l)
           
 void rename(Name nameOld, Name nameNew)
           
 void rename(String nameOld, String nameNew)
           
 boolean targetMustExist()
           
 String toString()
           
 void unbind(Name name)
           
 void unbind(String name)
           
 
Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface nl.tudelft.simulation.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypes, removeListener
 

Field Detail

NUMBER_CHANGED_EVENT

public static final EventType NUMBER_CHANGED_EVENT
NUMBER_CHANGED_EVENT is fired whenever the number of children changes


CHILD_ADDED_EVENT

public static final EventType CHILD_ADDED_EVENT
CHILD_ADDED_EVENT is fired whenever a child is added


CHILD_REMOVED_EVENT

public static final EventType CHILD_REMOVED_EVENT
CHILD_REMOVED_EVENT is fired whenever a child is removed


parent

protected Context parent
the parent context


elements

protected Map elements
the children


eventListeners

protected List eventListeners
the eventListeners


parser

protected NameParser parser
the nameParser

Constructor Detail

JVMContext

public JVMContext()
constructs a new JVMContext.


JVMContext

public JVMContext(Context parent,
                  String atomicName)
constructs a new JVMContext

Parameters:
parent - the parent context
atomicName - the atomicname
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException
See Also:
Object.clone()

lookup

public Object lookup(Name name)
              throws NamingException
Specified by:
lookup in interface Context
Throws:
NamingException
See Also:
Context.lookup(Name)

lookup

public Object lookup(String arg0)
              throws NamingException
Specified by:
lookup in interface Context
Throws:
NamingException
See Also:
Context.lookup(String)

bind

public void bind(Name name,
                 Object value)
          throws NamingException
Specified by:
bind in interface Context
Throws:
NamingException
See Also:
Context.bind(Name, Object)

bind

public void bind(String name,
                 Object value)
          throws NamingException
Specified by:
bind in interface Context
Throws:
NamingException
See Also:
Context.bind(String, Object)

rebind

public void rebind(Name name,
                   Object value)
            throws NamingException
Specified by:
rebind in interface Context
Throws:
NamingException
See Also:
Context.rebind(Name, Object)

rebind

public void rebind(String name,
                   Object value)
            throws NamingException
Specified by:
rebind in interface Context
Throws:
NamingException
See Also:
Context.rebind(String, Object)

unbind

public void unbind(Name name)
            throws NamingException
Specified by:
unbind in interface Context
Throws:
NamingException
See Also:
Context.unbind(Name)

unbind

public void unbind(String name)
            throws NamingException
Specified by:
unbind in interface Context
Throws:
NamingException
See Also:
Context.unbind(String)

rename

public void rename(Name nameOld,
                   Name nameNew)
            throws NamingException
Specified by:
rename in interface Context
Throws:
NamingException
See Also:
Context.rename(Name, Name)

rename

public void rename(String nameOld,
                   String nameNew)
            throws NamingException
Specified by:
rename in interface Context
Throws:
NamingException
See Also:
Context.rename(String, String)

list

public NamingEnumeration list(Name name)
Specified by:
list in interface Context
See Also:
Context.list(Name)

list

public NamingEnumeration list(String name)
Specified by:
list in interface Context
See Also:
Context.list(String)

listBindings

public NamingEnumeration listBindings(Name name)
Specified by:
listBindings in interface Context
See Also:
Context.listBindings(Name)

listBindings

public NamingEnumeration listBindings(String name)
Specified by:
listBindings in interface Context
See Also:
Context.listBindings(String)

destroySubcontext

public void destroySubcontext(Name name)
                       throws NamingException
Specified by:
destroySubcontext in interface Context
Throws:
NamingException
See Also:
Context.destroySubcontext(Name)

destroySubcontext

public void destroySubcontext(String name)
                       throws NamingException
Specified by:
destroySubcontext in interface Context
Throws:
NamingException
See Also:
Context.destroySubcontext(String)

createSubcontext

public Context createSubcontext(Name name)
                         throws NamingException
Specified by:
createSubcontext in interface Context
Throws:
NamingException
See Also:
Context.createSubcontext(Name)

createSubcontext

public Context createSubcontext(String arg0)
                         throws NamingException
Specified by:
createSubcontext in interface Context
Throws:
NamingException
See Also:
Context.createSubcontext(String)

lookupLink

public Object lookupLink(Name name)
Specified by:
lookupLink in interface Context
See Also:
Context.lookupLink(Name)

lookupLink

public Object lookupLink(String name)
                  throws NamingException
Specified by:
lookupLink in interface Context
Throws:
NamingException
See Also:
Context.lookupLink(String)

getNameParser

public NameParser getNameParser(Name name)
Specified by:
getNameParser in interface Context
See Also:
Context.getNameParser(Name)

getNameParser

public NameParser getNameParser(String name)
Specified by:
getNameParser in interface Context
See Also:
Context.getNameParser(String)

composeName

public Name composeName(Name arg0,
                        Name arg1)
                 throws NamingException
Specified by:
composeName in interface Context
Throws:
NamingException
See Also:
Context.composeName(Name, Name)

composeName

public String composeName(String arg0,
                          String arg1)
                   throws NamingException
Specified by:
composeName in interface Context
Throws:
NamingException
See Also:
Context.composeName(String, String)

addToEnvironment

public Object addToEnvironment(String arg0,
                               Object arg1)
                        throws NamingException
Specified by:
addToEnvironment in interface Context
Throws:
NamingException
See Also:
Context.addToEnvironment(String, Object)

removeFromEnvironment

public Object removeFromEnvironment(String arg0)
                             throws NamingException
Specified by:
removeFromEnvironment in interface Context
Throws:
NamingException
See Also:
Context.removeFromEnvironment(String)

getEnvironment

public Hashtable getEnvironment()
                         throws NamingException
Specified by:
getEnvironment in interface Context
Throws:
NamingException
See Also:
Context.getEnvironment()

close

public void close()
Specified by:
close in interface Context
See Also:
Context.close()

getNameInNamespace

public String getNameInNamespace()
                          throws NamingException
Specified by:
getNameInNamespace in interface Context
Throws:
NamingException
See Also:
Context.getNameInNamespace()

addNamingListener

public void addNamingListener(Name target,
                              int scope,
                              NamingListener l)
Specified by:
addNamingListener in interface EventContext
See Also:
#addNamingListener(Name, int, NamingListener)

addNamingListener

public void addNamingListener(String target,
                              int scope,
                              NamingListener l)
                       throws NamingException
Specified by:
addNamingListener in interface EventContext
Throws:
NamingException
See Also:
#addNamingListener(String, int, NamingListener)

removeNamingListener

public void removeNamingListener(NamingListener l)
Specified by:
removeNamingListener in interface EventContext
See Also:
#removeNamingListener(NamingListener)

targetMustExist

public boolean targetMustExist()
Specified by:
targetMustExist in interface EventContext
See Also:
EventContext.targetMustExist()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.