Skip to content
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

Another New Dispatcher #1

Draft
wants to merge 9 commits into
base: move-legacy-dispatching
Choose a base branch
from

Conversation

ajohnstonTE
Copy link
Owner

WIP

A lot of this will be removed eventually. Committing it just makes it easier to distinguish
from any new functionality and some near-future refactors while doing dev.
Object instance = matchInfo.endpoint.resource.getInstance();
Class<?> instanceClass = matchInfo.endpoint.resource.getInstanceClass();
Class<?>[] parameterTypes = method.getParameterTypes();
Annotation[][] parameterAnnotations = method.getParameterAnnotations();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that this reflection work should be done and cached at startup, rather than on a per-request dispatch.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a TODO in here somewhere for exactly that. Atm I'm just focusing on matching the spec so I have a better idea of how to structure a lot of this. It entirely possible I'll get to that caching earlier than I expect, but I'm planning on doing that once the structure is less likely to be heavily refactored (which is definitely going to happen before this dispatcher is done).

Also MediaTypeData now works much more like MediaType, except lazily in one implementation.
…but passing) tests

This should help with designing more complicated tests and work as a reference implementation for the performant version. There's also a dispatching test that is added because I was feeling optimistic, but really it's too high level. The endpoint registry test does a better job of testing the target functionality more precisely. I'll likely remove the dispatching test at some point.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants