|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.idoox.config.Configurator
Configurator
represents the whole WSO2 SOA Enablement Server configuration
(including configuration of all services) and generates proxy access to the
config interfaces.
Method newRuntimeConfigurable()
can be used to create runtime configuration.
Configurable
Constructor Summary | |
Configurator()
Constructs new Configurator instance. |
Method Summary | |
static void |
destroy()
Flushes and destroys the configurator. |
static void |
flush()
Force flushing of the configurator. |
static Configurable |
getConfigurable(java.lang.Object configProxy)
Returns configurable for an instance of configured interface. |
static Configurable |
getConfigurable(java.lang.String id)
Deprecated. Use getConfigurable(String, String) instead. |
static Configurable |
getConfigurable(java.lang.String type,
java.lang.String name)
Returns the configuration of the given interface with type and name of the section. |
static Configurable[] |
getTopEntries(java.lang.String type)
Returns a list of known entry points with the given type. |
static java.lang.String |
getWaspLocation()
Returns the location of the system (WSO2 SOA Enablement Server) directory. |
static void |
init(java.util.Map configurationParameters)
Initializes the configurator. |
static void |
init(java.util.Map configurationParameters,
boolean loadApplications)
Initializes the configurator. |
static Configurable |
newRuntimeConfigurable()
Creates new configurable which can be used to setup runtime configuration. |
static Configurable |
setDefaultsOnConfigurable(Configurable configurable,
Configurable defaults)
Creates new configurable "above" two configurations - configurable
and defaults |
static void |
update()
Scans for new config files and imports them to the configurator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Configurator()
Configurator
instance.
This constructor should not be used
(it is provided only to preserve of backward compatibility).
Method Detail |
public static final void init(java.util.Map configurationParameters)
configurationParameters
- a Map of configuration parameters. It must
contain at least the following keys :
public static final void init(java.util.Map configurationParameters, boolean loadApplications)
configurationParameters
- a Map of configuration parameters.loadApplications
- if true
application configs are also loadedpublic static final void destroy()
public static final Configurable getConfigurable(java.lang.String id)
getConfigurable(String, String)
instead.
id
id
- the id of the demanded instance
public static final Configurable getConfigurable(java.lang.String type, java.lang.String name)
type
- the type of the section to be returnedname
- the name of the section to be returned
public static final Configurable getConfigurable(java.lang.Object configProxy)
configProxy
- the instance obtained via Configurable.narrow
public static final void flush()
public static final Configurable[] getTopEntries(java.lang.String type)
type
- the name of the type
public static final java.lang.String getWaspLocation()
public static final void update()
public static final Configurable newRuntimeConfigurable()
Creates new configurable which can be used to setup runtime configuration. You can use runtime configurable in the same way as persisten one is used. The only difference is that runtime configuration is never stored to disk (it is transient).
You can narrow
obtained configurable to interface which represents
your configuration. Then you can setup configuration.
Configurable configurable = Configurator.newRuntimeConfigurable(); MyConfiguration myConf = (MyConfiguration)configurable.narrow(MyConfiguration.class); myConf.setX(123);
Created runtime configuration can be used wherever
Configurable
is required.
Be careful if you want to reuse runtime configurable in many places, e.g. if you setup one runtime configurable many times and pass it to the system. We recommend creating a new runtime configurable each time you want to represent a different configuration with it.
It is usually necessary to create a new instance of runtime configurable because some parts of the system can register themselves as listeners on the configurable. Such listeners can control any changes made on the configurable. Because runtime configurable can represent any configuration, two different parts of the system may be registered as listeners on one configurable. This can lead to unexpected behavior.
public static final Configurable setDefaultsOnConfigurable(Configurable configurable, Configurable defaults)
Creates new configurable "above" two configurations - configurable
and defaults
.
Newly created configuration contains union of properties of both configurables.
Values of properties which are contained in the configurable
equals
to the values which are stored in the configurable
.
Values of properties which are not in the configurable
equals to the values stored in the defaults
.
Simply, value of properties from configuration represented by
defaults
are used for properties which are not set in
the configuration represented by configurable
. Therefore
values from defaults
are used only as default values.
Any changed which you do to the new configuration are performed also
on the configurable
configuration.
E.g. this function can be used to overide some properties from persistent configuration
Configurable persistent = ... Configurable mySpecialConf = Configurator.newRuntimeConfigurable(); // set up mySpecialConf // ... Configurable actualConf = Configurator.setDefaultsOnConfigurable(mySpecialConf,persistent); // now you can use actualConf
configurable
- configurationdefaults
- default configuration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |