|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.editor.policy.configuration.BasicConfiguration
public class BasicConfiguration
Configuration object that holds a component factory and further information specified in the configuration file.
Field Summary | |
---|---|
static String |
EDITOR_PRESENTERS
Section name as it appears in the configuration file. |
static String |
EDITOR_VIEWS
Section name as it appears in the configuration file. |
static String |
EDITORS_GROUP
Section name as it appears in the configuration file. |
static String |
GENERIC_GROUP
Section name as it appears in the configuration file. |
static String |
PLUGINS
Section name as it appears in the configuration file. |
static String |
POLICY
Section name as it appears in the configuration file. |
static String |
TOOL_PRESENTERS
Section name as it appears in the configuration file. |
static String |
TOOL_VIEWS
Section name as it appears in the configuration file. |
static String |
TOOLS_GROUP
Section name as it appears in the configuration file. |
protected static ConfigurationSectionTrader |
TRADER
Default trader used as configuration section factory by the reader. |
Constructor Summary | |
---|---|
BasicConfiguration(URL url)
Creates a new component factory for the specified configuration URL. |
Method Summary | ||
---|---|---|
void |
addFactoryAdapter(org.picocontainer.ComponentAdapter<?> componentAdapter)
Adds a component adapter to the factory container. |
|
void |
addFactoryComponent(Object implOrInstance)
Adds a component implementation or instance to the factory container. |
|
void |
addFactoryComponent(Object componentKey,
Object implOrInstance)
Adds a component implementation or instance to the factory container with a key. |
|
boolean |
canCreate(TypeKey typeKey)
Check if this factory can create components of the given type. |
|
|
create(Class<?> type,
State... context)
Creates a component. |
|
|
create(TypeKey typeKey,
State... context)
Creates a typed component. |
|
ApplicationView |
createApplicationView()
Returns a new instance of the application view configured. |
|
List<Class<?>> |
getOrder(String section)
Returns the order in which implementation classes of the specified section have been listed. |
|
Object |
getSetting(Object type,
String key)
Returns the setting value for the specified type and key. |
|
|
instances(Class<T> type)
Returns a list of all instances of a specific type stored at the factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final ConfigurationSectionTrader TRADER
public static final String GENERIC_GROUP
"generic"
public static final String POLICY
"policy"
public static final String PLUGINS
"plugins"
public static final String EDITORS_GROUP
"editors"
public static final String EDITOR_PRESENTERS
"editor-presenters"
public static final String EDITOR_VIEWS
"editor-views"
public static final String TOOLS_GROUP
"tools"
public static final String TOOL_PRESENTERS
"tool-presenters"
public static final String TOOL_VIEWS
"tool-views"
Constructor Detail |
---|
public BasicConfiguration(URL url) throws ConfigurationException
url
- the URL to read the configuration file from.
ConfigurationException
- passed on, see ConfigurationReader.configure(org.openpermis.editor.policy.configuration.ClassSettings, org.picocontainer.MutablePicoContainer)
.Method Detail |
---|
public void addFactoryComponent(Object implOrInstance)
Configuration
Implementation classes will be added without caching.
addFactoryComponent
in interface Configuration
implOrInstance
- the component implementation or instance add.public void addFactoryComponent(Object componentKey, Object implOrInstance)
Configuration
Implementation classes will be added without caching.
addFactoryComponent
in interface Configuration
componentKey
- the component key to use.implOrInstance
- the component implementation or instance add.public void addFactoryAdapter(org.picocontainer.ComponentAdapter<?> componentAdapter)
Configuration
addFactoryAdapter
in interface Configuration
componentAdapter
- the component adapter to add.public ApplicationView createApplicationView()
Configuration
createApplicationView
in interface Configuration
public List<Class<?>> getOrder(String section)
Configuration
getOrder
in interface Configuration
section
- the section as it appears in the configuration file.
null
for inexistent sections.public Object getSetting(Object type, String key)
Configuration
getSetting
in interface Configuration
type
- the class for which to retrieve the value of key.key
- the key for which to retrieve the value.
null
if undefined.public boolean canCreate(TypeKey typeKey)
ComponentFactory
canCreate
in interface ComponentFactory
typeKey
- the type key for which to check if the factory can create an instance.
true
if the factory can provide an instance, false
otherwise.public <T> T create(Class<?> type, State... context)
ComponentFactory
The context state supplied is used to fill in missing parameters that are not available as default instances or implementations at the factory.
create
in interface ComponentFactory
T
- the component type, has to correspond to the scope of the type key.type
- the class for which to create the component.context
- additional state to inject to the component created.
public <T> T create(TypeKey typeKey, State... context)
ComponentFactory
The context state supplied is used to fill in missing parameters that are not available as default instances or implementations at the factory.
create
in interface ComponentFactory
T
- the component type, has to correspond to the scope of the type key.typeKey
- the type key for which to create the component.context
- additional state to inject to the component created.
public <T> List<T> instances(Class<T> type)
ComponentFactory
Take care to use this method only to retrieve cached instances otherwise this factory will create an instance for each of the registered implementation types that are assignable to the type specified.
instances
in interface ComponentFactory
T
- the instance type to retrieve.type
- the class of the instance type to retrieve.
null
but may be empty.
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG