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

Refactoring to improve cohesion #17

Merged
merged 4 commits into from Jul 13, 2023
Merged

Conversation

timothyjward
Copy link
Contributor

There are several portions of the codebase that share responsibility for registering the custom types that we need for the whiteboard to work correctly. This series of commits centralises these registrations in the JerseyApplication, simplifying the JerseyServiceRuntime and the WhiteboardServletContainer. The commit also makes the JerseyApplication immutable once created, dramatically simplifying the lifecycle of the objects.

The JerseyApplication contains a lot of lifecycle code that could be eliminated if the application is made immutable. This commit delays the creation of the JerseyApplication until first access, but then marks the provider as locked. This fits with the new usage pattern where providers are cloned rather than modified.

Signed-off-by: Tim Ward <timothyjward@apache.org>
The JerseyApplication dynamic subclassing should live alongside our other ASM usage in the proxy package.

Signed-off-by: Tim Ward <timothyjward@apache.org>
The JerseyServiceRuntime was responsible for adding the feature which tracked the lifecycle of the container. This is better located in the JerseyApplication which is already responsible for registering custom callbacks.

Signed-off-by: Tim Ward <timothyjward@apache.org>
The WhiteboardServletContainer was responsible for adding the components which supplied Promise handling and SSE handling to the container. This is better located in the JerseyApplication so that all containers gain the benefit.

Signed-off-by: Tim Ward <timothyjward@apache.org>
Copy link
Contributor

@maho7791 maho7791 left a comment

Choose a reason for hiding this comment

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

deleting code is good, as long as the tests are still green

@maho7791 maho7791 merged commit 56e5c73 into osgi:main Jul 13, 2023
6 checks passed
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.

None yet

2 participants