Class ConcurrentApplicationContextImpl

    • Constructor Detail

      • ConcurrentApplicationContextImpl

        ConcurrentApplicationContextImpl(String name, Set<Key<?>> permittedKeys)
    • Method Detail

      • addIfNotPresent

         <T extends Any> Unit addIfNotPresent(Key<T> key, T value)

        Add value for given key if not already present.

        This is semmantically same as

        if(!exists(key)) add(key, value) *

        Parameters:
        value - </T>
      • addIfNotPresent

         <T extends Any> Unit addIfNotPresent(Key<T> key, T value, Long timeout)

        Same as addIfNotPresent in ApplicationContext with additional timeout parameter for wait time in case of multiple threads blocking on this method

        Parameters:
        timeout - in millis </T>
      • addWithOverwrite

         <T extends Any> Object addWithOverwrite(Key<T> key, T value)

        Add value for given key even if already present.

        Returns:

        Previous value associated with key if any or null </T>

      • addWithOverwrite

         <T extends Any> Object addWithOverwrite(Key<T> key, T value, Long timeout)

        Same as addWithOverwrite in ApplicationContext with additional timeout parameter for wait time in case of multiple threads blocking on this method

        Parameters:
        timeout - in millis
        Returns:
        </T>
      • add

         <T extends Any> Unit add(Key<T> key, T value)

        Add value for given key.

        Parameters:
        value - </T>
      • add

         <T extends Any> Unit add(Key<T> key, T value, Long timeout)

        Same as add in ApplicationContext with additional timeout parameter for wait time in case of multiple threads blocking on this method

        Parameters:
        timeout - in millis </T>
      • exists

         <T extends Any> Boolean exists(Key<T> key)

        Check if any value or null associated with give key

        Returns:

        true if value or null associated with give key otherwise false </T>

      • exists

         <T extends Any> Boolean exists(Key<T> key, Long timeout)

        Same as exists in ApplicationContext with additional timeout parameter for wait time in case of multiple threads blocking on this method

        Parameters:
        timeout - in millis
        Returns:
        </T>
      • fetch

         <T extends Any> T fetch(Key<T> key)

        Fetch value associated with key or null

        Returns:

        value associated with key or null </T>

      • fetch

         <T extends Any> T fetch(Key<T> key, Long timeout)

        Same as fetch in ApplicationContext with additional timeout parameter for wait time in case of multiple threads blocking on this method

        Parameters:
        timeout - in millis
        Returns:
        </T>
      • erase

         <T extends Any> T erase(Key<T> key)

        Erase value associated with key if any

        Returns:

        value associate with key or null </T>

      • erase

         <T extends Any> T erase(Key<T> key, Long timeout)

        Same as erase in ApplicationContext with additional timeout parameter for wait time in case of multiple threads blocking on this method

        Parameters:
        timeout - in millis
        Returns:
        </T>
      • clear

         Unit clear()

        Clear the entire context

      • clear

         Unit clear(Long timeout)

        Same as clear in ApplicationContext with additional timeout parameter for wait time in case of multiple threads blocking on this method

        Parameters:
        timeout - in millis
      • clone

         ApplicationContext clone(String cloneName, Set<Key<?>> clonePermittedKeys)

        Creates a clone of this context with passed cloneName and clonePermittedKeys. While cloning only the permittedKeys will be added

        Parameters:
        cloneName - name of the cloned ApplicationContext
        clonePermittedKeys - permittedKeys of the cloned ApplicationContext