-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WICKET-7080] 1) make default events delivery machinery pluggable 2) … #682
Conversation
reiern70
commented
Oct 16, 2023
•
edited
Loading
edited
- make default events delivery machinery plug-gable
- allow to disabled sending events
- defines a reflection based machinery to deliver events
6fd7ce9
to
e0066f2
Compare
/** | ||
* IEventDispatcher that uses reflection in order to locate events methods. | ||
*/ | ||
public class ReflectionEventDispatcher implements IEventDispatcher { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add here a class to method map cache. As a similar project on wicket stuff have. One main difference is we don't have a component instantiation listener=> this will only happen at runtime when event is delivered.
* Probably, this should be set to true in most applications and enforce the use of either @{@link EventAwareObject} | ||
* annotation or the marker interface @{@link IEventAwareObject} | ||
*/ | ||
private final boolean restrictToEventAware; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag should make event's processing faster and only marked classes will be scanned.
This PR still needs some more work and care |
44d559e
to
3f2fb29
Compare
I have added more tests and allow to use more that one eventType |
Any volunteers to review this PR? |
@martin-g I'm aware of that work. This PR is 2 things
This allows to still work with event and programmatically cancel it. or
will both work. No restrictions on XXX are imposed. IMHO, 1. would be nice to have in wicket. As for 2. I can understand can be implemented in many different ways.
|
@martin-g My last commits adds caching |
eadd46b
to
756ff28
Compare
Ok, I have reverted the part related to adding a reflection based machinery. What remains is:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test case with disabled default event dispatcher.
@@ -45,8 +45,28 @@ | |||
*/ | |||
public class FrameworkSettings implements IEventDispatcher | |||
{ | |||
/** | |||
* Does the standard delivery of events. Override and do nothing if you want to disable it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is private
it is not possible to override
it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -68,7 +88,7 @@ public FrameworkSettings(final Application application) | |||
* Gets the Wicket version. The Wicket version is in the same format as the version element in | |||
* the pom.xml file (project descriptor). The version is generated by maven in the build/release | |||
* cycle and put in the /META-INF/MANIFEST.MF file located in the root folder of the Wicket jar. | |||
* | |||
* <p></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most probably you want the closing </p>
to be at the end of the paragraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or. create an empty paragraph to separate from next IJ complains here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
/** | ||
* @return Returns <code>true</code> if there is at least one event dispatcher | ||
*/ | ||
public final boolean hasAnyAnyEventDispatchers() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one too many any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
a1d0228
to
d55432f
Compare
…allow to disabled sending events
d55432f
to
7d40ce7
Compare