I am creating prototype beans programatically/dynamically. I want those beans after initiation to be in the jmx console. How I can distinguish between them? I am using anota
You can do this by just implementing org.springframework.jmx.export.naming.SelfNaming:
@Component("MyPrototypeScopedBeanName")
@ManagedResource
public class MyPrototypeScopedBeanName implements SelfNaming
{
@Override
public ObjectName getObjectName() throws MalformedObjectNameException {
return new ObjectName("com.foobar", "name", this.toString());
}
}