Is it possible to override StanzaHandler and other Openfire classes in plugin?


For our project, we use extended protocol for user authorization. In particular, we use different stream:elementName elements.

Now this extension is done by changing sources of classes:



I’m wondering whether it is possible to override these classes from plugin, and not by changing sources and rebuilding Openfire.

It is linked to Can I intercept a stream stanza in an OpenFire Plugin? — the issue is that I need to create session before stanza is rejected as “Unknown packet”.

PacketInterceptor and org.xmpp.component.Component#processPacket only get Packets when session is already created.