All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.osgl.inject.ScopeCache Maven / Gradle / Ivy

There is a newer version: 1.13.2
Show newest version
package org.osgl.inject;

/**
 * Provide function to retrieve bean from scoped cache
 */
public interface ScopeCache {
    /**
     * Get a bean from the cache defined in the scope
     *
     * @param clazz the key to retrieve the bean
     * @param    generic type of the bean
     * @return the bean instance
     */
     T get(Class clazz);

    /**
     * Put a bean instance into the cache associated with the class key
     * specified
     *
     * @param clazz the key to store the bean instance
     * @param bean  the bean instance to be stored
     * @param    generic type of the bean
     */
     void put(Class clazz, T bean);

    /**
     * Implementation of `ScopeCache.SingletonScope` provide access
     * to bean instances stored in a singleton registry
     */
    interface SingletonScope extends ScopeCache {
    }

    /**
     * Implementation of `ScopeCache.RequestScope` shall provide access
     * to bean instance stored in a request scope
     */
    interface RequestScope extends ScopeCache {
    }

    /**
     * Implementation of `ScopeCache.RequestScope` shall provide access
     * to bean instance stored in a session scope
     */
    interface SessionScope extends ScopeCache {
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy