Skip to content

Rework command subsystem #380

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

Closed
jvalkeal opened this issue Feb 25, 2022 · 2 comments
Closed

Rework command subsystem #380

jvalkeal opened this issue Feb 25, 2022 · 2 comments
Milestone

Comments

@jvalkeal
Copy link
Contributor

One trouble in #379 when I started to implement it is that while it's easy to make CommandRegistry writable and register new methods based on MethodTarget this process from a user perspective is a bit cumbersome.

Essentially we still need to make custom pojo:

	public static class PojoMethods {

		@ShellMethod
		public String dynamic1() {
			return "dynamic1";
		}

		@ShellMethod
		public String dynamic2(String arg1) {
			return "dynamic2" + arg1;
		}
	}

and have those methods with dummy @ShellMethod for StandardParameterResolver to read parameters.

@jvalkeal jvalkeal added this to the 3.0.0-M1 milestone Mar 4, 2022
@jvalkeal
Copy link
Contributor Author

jvalkeal commented Mar 4, 2022

This turned out to be a relatively major work so it is unrealistic to do it with 2.1.0. Marking 3.0.x for now and can be hopefully back ported to 2.2.x.

@jvalkeal
Copy link
Contributor Author

Just wanted to give update on this as I've been doing a major refactoring and re-work so there might be a time to push this work into 2.1.x. It's definitely something what can't be added in a point release so it'd be really beneficial to get these changes in 2.1.x.

@jvalkeal jvalkeal changed the title Implement command info subsystem Rework command subsystem Apr 15, 2022
@jvalkeal jvalkeal modified the milestones: 3.0.0-M1, 2.1.0-M4 Apr 29, 2022
jvalkeal added a commit to jvalkeal/spring-shell that referenced this issue May 2, 2022
- Focus of these changes are to introduce a new command system based on
  real registrations (new way) instead of continuously (old way) resolve
  methods and its parameters via reflection.
- There's a lot of changes as this resolution via reflection had its
  hooks almost everywhere and thus most changes are just refactorings.
- Order to understand real changes I'd start to look classes under
  `org.springframework.shell.command` package as it defines new registration,
  catalog and parser classes. Also samples contain new classes to demonstrate
  new functionality.
- Fixes spring-projects#380
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 a pull request may close this issue.

1 participant