* @param builder The builder.
*/
private XmppSessionConfiguration(Builder builder) {
this.xmppDebugger = builder.xmppDebugger;
this.defaultResponseTimeout = builder.defaultResponseTimeout;
CoreContext context = builder.context;
if (context == null) {
try {
Class<?> extensionContext = Class.forName(CoreContext.class.getPackage().getName() + ".extensions.ExtensionContext");
context = (CoreContext) extensionContext.newInstance();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
context = new CoreContext();
}
}
// These are the manager classes which are loaded immediately, when the XmppSession is initialized,
// Typically the add listeners to the session, e.g. to automatically reply.
initialExtensionManagers.addAll(context.getExtensionManagers());
Class<?>[] classesToBeBound = new Class<?>[context.getExtensions().size()];
context.getExtensions().toArray(classesToBeBound);
try {
jaxbContext = JAXBContext.newInstance(classesToBeBound);
} catch (JAXBException e) {
throw new RuntimeException(e);