
woko.ioc.WokoIocContainer Maven / Gradle / Ivy
The newest version!
package woko.ioc;
import net.sourceforge.jfacets.IFacetDescriptorManager;
import woko.persistence.ObjectStore;
import woko.users.UserManager;
import woko.users.UsernameResolutionStrategy;
import java.util.Map;
/**
* Interface for the Woko IOC container. The Woko
instance references an IOC container
* for accessing the various mandatory components (ObjectStore
, UserManager
etc.).
* The IOC container can also be used for optional, application-specific components.
*/
public interface WokoIocContainer<
OsType extends ObjectStore,
UmType extends UserManager,
UnsType extends UsernameResolutionStrategy,
FdmType extends IFacetDescriptorManager
> {
static final String ObjectStore = "ObjectStore";
static final String UserManager = "UserManager";
static final String FacetDescriptorManager = "FacetDescriptorManager";
static final String UsernameResolutionStrategy = "UsernameResolutionStrategy";
/**
* Return the component for passed key
if any (null if no such component)
* @param key the component key
* @param the component type
* @return the component for passed key
*/
T getComponent(Object key);
/**
* Return the ObjectStore
for the app
* @return the ObjectStore
for the app
*/
OsType getObjectStore();
/**
* Return the UserManager
for the app
* @return the UserManager
for the app
*/
UmType getUserManager();
/**
* Return the UsernameResolutionStrategy
for the app
* @return the UsernameResolutionStrategy
for the app
*/
UnsType getUsernameResolutionStrategy();
/**
* Return the IFacetDescriptorManager
for the app
* @return the IFacetDescriptorManager
for the app
*/
FdmType getFacetDescriptorManager();
/**
* Return a map of all keys/components in the ioc. This map
* should be immutable, and should never be modified. It is
* meant to be used read-only.
* @return a map of all keys/components
*/
Map,?> getComponents();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy