new QFactory method to instantiate from Element#669
Merged
Conversation
Contributor
|
I was ruminating about this these days, triggered by #668 in fact. |
Member
|
I like the PR but we don't need the auto-config version. Let's enforce some opinion and make it the default on the regular newInstance method. |
4bfa268 to
60263d5
Compare
Contributor
Author
|
I used the So I just I rebased against most recent I also did some clean up along the way, such as removing old unneeded type casts and replacing a couple of iterator loops with a more moden enhanced-for. |
ar
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A previous PR (#668) fixed the fact that
QServerwasn't honoring theenabledattribute of some of its children elements, such asrequest-listener.This omission was later discovered also
QMUXtogether with the usage pattern (in many other places) when creating a helper child class. Normally theclassattribute is used to create an instance usingQFactoryfrom the class name, thensetLogger()andsetConfigurationare called . In some of this places it was forgotten to check if the component wasenabledin the XML.A new version of
QFactory#newinstanceis provided to create from the dom Element.public <T> T newInstance(Element e, boolean autoConf)It automatically checks the
enabledattribute and does the autoconfiguration calls ifboolean autoConfis true.The returned instance can then be further configured in custom code if needed.
This util method may be useful in many other places where a jPOS class creates its own helper configurable objects that may honor the
enabledattribute.This PR includes the refactoring in
QServer,QMUX,ChannelAdaptorto start using the new facility.