Class InMemoryNamingStore

  • All Implemented Interfaces:
    NamingStore, WritableNamingStore

    public class InMemoryNamingStore
    extends Object
    implements WritableNamingStore
    In-memory implementation of the NamingStore. The backing for the entries is a basic tree structure with either context nodes or binding nodes. The context nodes are allowed to have children and can be represented by a NamingContext. A binding node is only allowed to have a normal object binding.
    Author:
    John E. Bailey
    • Constructor Detail

      • InMemoryNamingStore

        public InMemoryNamingStore()
        Construct instance with no event support, and an empty base name.
      • InMemoryNamingStore

        public InMemoryNamingStore​(NamingEventCoordinator eventCoordinator)
        Construct instance with an event coordinator, and an empty base name.
        Parameters:
        eventCoordinator - The event coordinator
      • InMemoryNamingStore

        public InMemoryNamingStore​(Name baseName)
        Construct instance with no event support, and the specified base name.
        Parameters:
        baseName -
      • InMemoryNamingStore

        public InMemoryNamingStore​(NamingEventCoordinator eventCoordinator,
                                   Name baseName)
        Construct instance with an event coordinator, and the specified base name.
        Parameters:
        eventCoordinator -
        baseName -
    • Method Detail

      • bind

        public void bind​(Name name,
                         Object object)
                  throws NamingException
        Bind and object into the naming store, creating parent contexts if needed. All parent contexts must be created before this can be executed. The bind object type will be determined by the class of the object being passed in.
        Specified by:
        bind in interface WritableNamingStore
        Parameters:
        name - The entry name
        object - The entry object
        Throws:
        NamingException - If any problems occur
      • bind

        public void bind​(Name name,
                         Object object,
                         Class<?> bindType)
                  throws NamingException
        Bind and object into the naming store, creating parent contexts if needed. All parent contexts must be created before this can be executed.
        Specified by:
        bind in interface WritableNamingStore
        Parameters:
        name - The entry name
        object - The entry object
        bindType - The entry class
        Throws:
        NamingException - If any problems occur
      • rebind

        public void rebind​(Name name,
                           Object object)
                    throws NamingException
        Re-bind and object into the naming store. All parent contexts must be created before this can be executed. The bind object type will be determined by the class of the object being passed in.
        Specified by:
        rebind in interface WritableNamingStore
        Parameters:
        name - The entry name
        object - The entry object
        Throws:
        NamingException - If any problems occur
      • rebind

        public void rebind​(Name name,
                           Object object,
                           Class<?> bindType)
                    throws NamingException
        Re-bind and object into the naming store. All parent contexts must be created before this can be executed.
        Specified by:
        rebind in interface WritableNamingStore
        Parameters:
        name - The entry name
        object - The entry object
        bindType - The entry class
        Throws:
        NamingException - If any problems occur
      • lookup

        public Object lookup​(Name name,
                             boolean dereference)
                      throws NamingException
        Description copied from interface: NamingStore
        Look up an object from the naming store. An entry for this name must already exist.
        Specified by:
        lookup in interface NamingStore
        Parameters:
        name - The entry name
        dereference - if true indicates that managed references should retrieve the instance.
        Returns:
        The object from the store.
        Throws:
        NamingException - If any errors occur.
      • addNamingListener

        public void addNamingListener​(Name target,
                                      int scope,
                                      NamingListener listener)
        Add a NamingListener to the naming event coordinator.
        Specified by:
        addNamingListener in interface NamingStore
        Parameters:
        target - The target name to add the listener to
        scope - The listener scope
        listener - The listener
      • removeNamingListener

        public void removeNamingListener​(NamingListener listener)
        Remove a NamingListener from the naming event coordinator.
        Specified by:
        removeNamingListener in interface NamingStore
        Parameters:
        listener - The listener