1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 01:29:38 +02:00

SMACK-286 Made ProviderManager much more configurable.

Separated the reading of provider files from the ProviderManager.  Manager now only manages.  Added ability to add collections of providers to the manager via a ProviderLoader, of which there is one default implementation which loads from the default file format.  Now provider files can be programmatically added at any time.  Also updated the configuration abilities so that a provider file can also be set via VM arg, as well as the smack configuration itself. Introduced Java Util Logging as well.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_4_0@13861 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2014-01-16 05:14:39 +00:00
parent 7e3d4186bb
commit f155cb4d07
25 changed files with 1709 additions and 1000 deletions

View file

@ -40,6 +40,37 @@ over which features applications require:
</ul>
<p class="subheader">Configuration</p>
Smack has an initialization process that involves 2 phases.
<ul>
<li>Initializing system properties - Initializing all the system properties accessible through the class
<b>SmackConfiguration</b>. These properties are retrieve by the <i>getXXX</i> methods on that class.
<li>Initializing startup classes - Initializing any classes meant to be active at startup by instantiating
the class, and then calling the <i>initialize</i> method on that class if it extends <b>SmackInitializer</b>.
If it does not extend this interface, then initialization will have to take place in a static block of code
which is automatically executed when the class is loaded.
</ul>
<p>
Initialization is accomplished via a configuration file. By default, Smack will load the one embedded in
the Smack jar at <i>META-INF/smack-config.xml</i>. This particular configuration contains all the default
property values as well as a list of initializer classes to load. All manager type classes are contained
in this list of initializers. If your application does not use all the features provided by Smack via the
aforementioned managers, you may want to 'turn them off' by providing a custom config file that does not
include that feature.
<p>
If you want to change the configuration file used, you have two options:
<ul>
<li>Programmatically - Call the <i>setConfigFileUrl</i> method of <b>SmackConfiguration</b> with the location
of a new config file.
<pre>SmackConfiguration.setConfigFileUrl("classpath:test/smack-config.xml", null)</pre>
<li>VM Argument - Set the VM argument <i>smack.config.file</i> to the location of a new config file.
<pre>-Dsmack.config.file=file:///c:/com/myco/provider/myco_custom_config.xml</pre>
</ul>
<p>
Please note, there is a copy of the <b>smack-config.xml</b> in the <i>samples</i> directory of the deployment
archive file (zip or tar).
<p class="subheader">
Establishing a Connection
</p>