public class MockCompMgr extends Object implements ComponentManager
| Modifier and Type | Field and Description |
|---|---|
ConcurrentHashMap<String,Object> |
components
Not really needed but this allows us to at least put fake ones into this CM for tests if we like
|
SAKAI_COMPONENTS_ROOT_SYS_PROP| Constructor and Description |
|---|
MockCompMgr(boolean loadMocks)
Startup the CM as a mock system for unit tests
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the component manager, shutting down any created singletons.
|
boolean |
contains(Class iface)
Check if this interface Class has a registered component.
|
boolean |
contains(String ifaceName)
Check if this interface Class name has a registered component.
|
<T> T |
get(Class<T> iface)
Find a component that is registered to provide this interface.
|
Object |
get(String ifaceName)
Find a component that is registered to provide this interface.
|
Properties |
getConfig()
Access the configuration properties used when configuring components.
|
Set<String> |
getRegisteredInterfaces()
Get all interfaces registered in the component manager.
|
boolean |
hasBeenClosed()
Check if the ComponentManager has already been or is in the processing of being closed.
|
void |
loadComponent(Class iface,
Object component)
Load a singleton already created component for this interface class as a singleton.
|
void |
loadComponent(String ifaceName,
Object component)
Load a singleton already created component for this interface class as a singleton.
|
void |
waitTillConfigured()
Wait right here till the component manager is fully configured.
|
public ConcurrentHashMap<String,Object> components
public MockCompMgr(boolean loadMocks)
public void close()
ComponentManagerclose in interface ComponentManagerpublic boolean hasBeenClosed()
ComponentManagerhasBeenClosed in interface ComponentManagerpublic boolean contains(Class iface)
ComponentManagercontains in interface ComponentManageriface - The interface Class.public boolean contains(String ifaceName)
ComponentManagercontains in interface ComponentManagerifaceName - The fully qualified interface Class name.public <T> T get(Class<T> iface)
ComponentManagerget in interface ComponentManageriface - The interface Class.public Object get(String ifaceName)
ComponentManagerget in interface ComponentManagerifaceName - The fully qualified interface Class name.public Properties getConfig()
ComponentManagergetConfig in interface ComponentManagerpublic Set<String> getRegisteredInterfaces()
ComponentManagergetRegisteredInterfaces in interface ComponentManagerpublic void loadComponent(Class iface, Object component)
ComponentManagerloadComponent in interface ComponentManageriface - The interface class.component - The alread created component.public void loadComponent(String ifaceName, Object component)
ComponentManagerloadComponent in interface ComponentManagerifaceName - The fully qualified interface Class name.component - The alread created component.public void waitTillConfigured()
ComponentManagerwaitTillConfigured in interface ComponentManagerCopyright © 2003–2021 Sakai Project. All rights reserved.