Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public class MBeanCommand extends HystrixCommand<Map<String,Object>> {
  2.  
  3. public MBeanCommand(ConnectionInfo info){
  4. super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey(info.getName())));
  5. }
  6.  
  7. @Override
  8. protected Map<String, Object> run() throws Exception {
  9. return null;
  10. }
  11. }
  12.  
  13.  
  14. @PostConstruct
  15. public void setup(){
  16. for(ConnectionInfo info: config.getConnections()){
  17. try {
  18. JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(info.getUri()));
  19. this.connections.put(info.getName(),connector.getMBeanServerConnection());
  20. MBeanCommand command = new MBeanCommand(info);
  21. } catch (IOException e) {
  22. logger.error(String.format("Error trying to connect to endpoint: {}. No connection created",info.getUri()),e);
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement