Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MBeanCommand extends HystrixCommand<Map<String,Object>> {
- public MBeanCommand(ConnectionInfo info){
- super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey(info.getName())));
- }
- @Override
- protected Map<String, Object> run() throws Exception {
- return null;
- }
- }
- @PostConstruct
- public void setup(){
- for(ConnectionInfo info: config.getConnections()){
- try {
- JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(info.getUri()));
- this.connections.put(info.getName(),connector.getMBeanServerConnection());
- MBeanCommand command = new MBeanCommand(info);
- } catch (IOException e) {
- logger.error(String.format("Error trying to connect to endpoint: {}. No connection created",info.getUri()),e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement