Currently, MessageFactory is static and messages are created via MessageFactory.create().
However, if users create custom messages, then they may need to associate a MessageFactory with a given transport, e.g. for using different marshallers.
The code (e.g. in TP.handleSingleMessage() would be changed to look like this:
short type=in.readShort(); Message msg = null; if(this.msg_factory != null) msg=msg_factory.create(type) if(msg == null) msg=MessageFactory.create(type); msg.readFrom(in);
If a message factory is defined in this transpport, we'll use it. Otherwise, the static message factory is used as fallback.