Package net.jmesnil.jmx.core

Examples of net.jmesnil.jmx.core.IConnectionWrapper


      return new FirstPage();
    }
  public boolean performFinish() {
    ConnectionWizardPage[] active = getActivePages();
      if( active != null ) {
        IConnectionWrapper wrap = null;
        for( int i = active.length-1; i >= 0 && wrap == null; i--) {
          try {
            wrap = active[i].getConnection();
          } catch( CoreException ce ) {
            // TODO LOG
          }
        }

        if( wrap != null ) {
          wrap.getProvider().addConnection(wrap);
          return true;
        }
      }

    return true;
View Full Code Here


        }
        return new Object[0];
    }

    protected synchronized Object[] loadAndGetRootChildren(final Object parent) {
    final IConnectionWrapper w = (IConnectionWrapper)parent;
   
    if( w.getRoot() != null )
      return getChildren(w.getRoot());
   
    // Must load the model
    Thread t = new Thread() {
      public void run() {
        try {
          w.loadRoot();
        } catch( RuntimeException re ) {
        }
        loading.remove(w);
        Display.getDefault().asyncExec(new Runnable() {
          public void run() {
View Full Code Here

      map.put(DefaultConnectionProvider.ID, "Test Connection");
      map.put(DefaultConnectionProvider.URL, "service:jmx:rmi:///jndi/rmi://localhost:9999" +
          "/jmxrmi");
      map.put(DefaultConnectionProvider.USERNAME, "");
      map.put(DefaultConnectionProvider.PASSWORD, "");
      IConnectionWrapper wrapper = defProvider.createConnection(map);
      assertTrue("Connection was null", wrapper != null);

      wrapper.connect();
      Root root = wrapper.getRoot();
      assertTrue("Root was not null", root == null);
     
      wrapper.loadRoot();
      root = wrapper.getRoot();
      assertTrue("Root was null", root != null);
     
      Node[] children = root.getChildren();
      assertTrue("children were null", children != null);
      assertEquals("Example had the wrong number of domains", 5, children.length);
View Full Code Here

    private MBeanInfoWrapper wrapper;

    public ObjectNameNode(Node parent, String key, String value, ObjectName on) {
        super(parent, key, value);
        Root root = getRoot(parent);
        IConnectionWrapper connectionWrapper = root.getConnection();
        this.on = on;
      final MBeanInfoWrapper[] array = new MBeanInfoWrapper[1];
      final ObjectName on2 = on;
      try {
        connectionWrapper.run(new IJMXRunnable() {
          public void run(MBeanServerConnection mbsc) throws JMXException {
          try {
            array[0] = new MBeanInfoWrapper(on2, mbsc.getMBeanInfo(on2), mbsc);
          } catch (InstanceNotFoundException e) {
            // TODO Auto-generated catch block
View Full Code Here

TOP

Related Classes of net.jmesnil.jmx.core.IConnectionWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.