Class DefaultRegistry

    • Method Detail

      • registerObject

        public void registerObject​(Object value)
        Description copied from interface: Registry
        Registers an object with its key derived from the object's Resource.name() attribute or the object's class name.
        Specified by:
        registerObject in interface Registry
        Parameters:
        value - object to register
      • registerObject

        public void registerObject​(Object key,
                                   Object value)
        Description copied from interface: Registry
        Adds an object with the given key to this Registry.
        Specified by:
        registerObject in interface Registry
        Parameters:
        key - object that maps to the value to register
        value - object to register which can be retrieved by its key
      • deRegisterObject

        public void deRegisterObject​(Object key)
        Description copied from interface: Registry
        Removes a registered object from this Registry.
        Specified by:
        deRegisterObject in interface Registry
        Parameters:
        key - key of the registered object to remove
      • lookup

        public <R> R lookup​(Function<Map<Object,​Object>,​R> function)
        Description copied from interface: Registry
        Looks up a registered object by function.
        Specified by:
        lookup in interface Registry
        Type Parameters:
        R - type of object to be returned
        Parameters:
        function - function to apply for looking up an object
        Returns:
        registered object if it exists or null
      • lookup

        public <T> T lookup​(Object key)
        Description copied from interface: Registry
        Looks up a registered object by its key.
        Specified by:
        lookup in interface Registry
        Type Parameters:
        T - type of object to be returned
        Parameters:
        key - key of registered object
        Returns:
        the registered object if it exists or null
      • lookup

        public <T> T lookup​(TypedKey<T> key)
        Description copied from interface: Registry
        Looks up a registered object by its typed key.
        Specified by:
        lookup in interface Registry
        Type Parameters:
        T - type of object to be returned
        Parameters:
        key - typed key of registered object
        Returns:
        the registered object if it exists or null
      • registerResources

        public ResourceConfigSeq registerResources​(String baseURI,
                                                   InputStream inputStream)
        Register the set of resources specified in the supplied XML configuration stream.
        Specified by:
        registerResources in interface Registry
        Parameters:
        baseURI - The base URI to be associated with the configuration stream.
        inputStream - XML resource configuration stream.
        Returns:
        The ResourceConfigList created from the added resource configuration.
        See Also:
        ResourceConfig
      • addProfileSets

        protected void addProfileSets​(List<ProfileSet> profileSets)
      • registerResourceConfig

        public void registerResourceConfig​(ResourceConfig resourceConfig)
        Register a ResourceConfig on this context store.

        The config gets added to the default resource list.

        Specified by:
        registerResourceConfig in interface Registry
        Parameters:
        resourceConfig - The Content Delivery Resource definition to be registered.
      • close

        public void close()
        Description copied from interface: Registry
        Cleans up the resources of this Registry and calls the PreDestroy method of each registered object.
        Specified by:
        close in interface Registry