Skip to content
This repository was archived by the owner on Jan 8, 2023. It is now read-only.
This repository was archived by the owner on Jan 8, 2023. It is now read-only.

Remove setClusterContext #2

@mattwelke

Description

@mattwelke

In https://github.com/ow-extended-runtimes/java-17/blob/main/src/main/java/com/owextendedruntimes/actiontest/Action.java, the method setClusterContext is problematic. It's weird that users would see that function because they shouldn't call it. It's only there so that the Proxy can inject the cluster context during setup for the action to reference during any invocation it wants to. Right now, the method is public because it exists in a different package from the Proxy class.

Solutions:

  • Move into the same package as the Proxy class, so that the visibility can be changed to package-private. That way, users won't see it.
  • Refactor the Action class and Proxy class. In the Action class, add a constructor that allows the context to be injected. In the Proxy class, use reflection to call the new constructor instead of calling the default constructor like right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions