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

Reworked Smack initialization

Move extension relevant configuration options from SmackConfiguration to
the extension. Introduced disabledSmackClasses that can be configured
via a system property or configuration file.
This commit is contained in:
Florian Schmaus 2014-02-23 17:48:07 +01:00
parent 4121ec2c0e
commit 3093333533
11 changed files with 193 additions and 338 deletions

View file

@ -29,12 +29,25 @@ to be as small as possible. The library ships as several JAR files to provide mo
over which features applications require:
<ul>
<li><tt>smack.jar</tt> -- provides core XMPP functionality and is the only <b>required</b>
<li><tt>smack-core.jar</tt> -- provides core XMPP functionality and is the only <b>required</b>
library. All XMPP features that are part of the XMPP RFCs are included.</li>
<li><tt>smackx.jar</tt> -- support for many of the the extensions (XEPs) defined
<li><tt>smack-extensions.jar</tt> -- support for many of the extensions (XEPs) defined
by the XMPP Standards Foundation, including multi-user chat, file transfer, user search, etc.
The extensions are documented in the <a href="extensions/index.html">extensions manual</a>.</li>
<li><tt>smackx-debug.jar</tt> -- an enhanced GUI debugger for protocol traffic. It will
<li><tt>smack-experimental.jar</tt> -- support for experimental extensions (XEPs) defined
by the XMPP Standards Foundation. The API and functionality of those extensions should be
considered as unstable.</li>
<li><tt>smack-legacy.jar</tt> -- support for legacy extensions (XEPs) defined
by the XMPP Standards Foundation.</li>
<li><tt>smack-bosh.jar</tt> -- support for BOSH (XEP-0124). This code should be considered
as beta.</li>
<li><tt>smack-jingle.jar</tt> -- support for Jingle. This code is old and currenlty
unmaintained.</li>
<li><tt>smack-resolver-dnsjava.jar</tt> -- support for resolving DNS SRV records with the
help of dnsjava. Ideal for platforms that do not support the javax.naming API.</li>
<li><tt>smack-resolver-javax.jar</tt> -- support for resolving DNS SRV records with the
javax namespace API.</li>
<li><tt>smack-debug.jar</tt> -- an enhanced GUI debugger for protocol traffic. It will
automatically be used when found in the classpath and when <a href="debugging.html">debugging</a>
is enabled.</li>
</ul>
@ -51,25 +64,13 @@ If it does not extend this interface, then initialization will have to take plac
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).
Initialization is accomplished via a configuration file. By default,
Smack will load the one embedded in the Smack jar
at <i>org.jivesoftware.smack/smack-config.xml</i>. This particular
configuration contains a list of initializer classes to load. All
manager type classes that need to be initialized are contained in this
list of initializers.
</p>
<p class="subheader">
Establishing a Connection
@ -150,4 +151,4 @@ Copyright &copy; Jive Software 2002-2008
</div>
</body>
</html>
</html>