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

When using @ManagedOperation on a method, allow overriding methods in that subclass,to be exposed as an operation. [SPR-5813] #10483

Closed
spring-projects-issues opened this issue Jun 8, 2009 · 0 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 8, 2009

Kaz Chehresa opened SPR-5813 and commented

When I use @ManagedOperation on a method, and then a subclass overrides that method, the method is not exposed as an operation anymore.

Here is an example:
<code>
@ManagedResource
class A implements SelfNaming {
@ManagedOperation
public void doSomething() {System.out.println("Doesn't do anything");}
public ObjectName getName() {return new ObjectName("someName-that is derived dynamically, for eg via BeanNameAware or smth");}
}

@ManagedResource
class B {
public void doSomething() {System.out.println("Does something useful!");}
}
</code>

When I expose an instance of B, the method doSomething is not exposed as an operation.
To solve the issue, I have to do this:

<code>
@ManagedResource
class B {
@ManagedOperation
public void doSomething() {System.out.println("Does something useful!");}
}
</code>

which is a bit redundant, given I already mentioned that I want to expose that method as an operation in the main class.

I think this is especially important for people who extend classes from infrastructure libraries, because they will likely not see that this method was being exposed, and will forget to put the annotation again in their own subclass.


Referenced from: commits 8f6a42b

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 RC1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant