Package net.jmesnil.jmx.core

Examples of net.jmesnil.jmx.core.IConnectionProvider


    return MBeanExplorerLabelProvider.getText2(obj);
  }
 
  public static String getText2(Object obj) {
    if( obj instanceof IConnectionWrapper ) {
      IConnectionProvider provider = ((IConnectionWrapper)obj).getProvider();
      return provider.getName((IConnectionWrapper)obj);
    }

    if( obj instanceof DelayProxy ) {
      return "Loading...";
    }
View Full Code Here


  }

  @Override
  public Image getImage(Object obj) {
    if( obj instanceof IConnectionWrapper ) {
      IConnectionProvider provider = ((IConnectionWrapper)obj).getProvider();
      ConnectionProviderUI ui = UIExtensionManager.getConnectionProviderUI(provider.getId());
      if( ui != null ) {
        if(!images.containsKey(ui.getId()) || images.get(ui.getId()).isDisposed())
          images.put(ui.getId(),
              ui.getImageDescriptor().createImage());
        return images.get(ui.getId());
View Full Code Here

      });
    }

    private void viewerSelectionChanged() {
      IStructuredSelection ssel = (IStructuredSelection)viewer.getSelection();
      IConnectionProvider cp = (IConnectionProvider)ssel.getFirstElement();
      selected = cp;
      getContainer().updateButtons();
    }
View Full Code Here

    setErrorMessage("There's an error somewhere");
    getContainer().updateMessage();
  }

  protected boolean nameTaken(String s) {
    IConnectionProvider provider = ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
    IConnectionWrapper[] connections = provider.getConnections();
    for( int i = 0; i < connections.length; i++ ) {
      if( provider.getName(connections[i]).equals(s)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

    HashMap<String,String> map = new HashMap<String,String>();
    map.put(DefaultConnectionProvider.ID, name);
    map.put(DefaultConnectionProvider.URL, url);
    map.put(DefaultConnectionProvider.USERNAME, userName);
    map.put(DefaultConnectionProvider.PASSWORD, password);
    IConnectionProvider provider = ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);

    return provider.createConnection(map);
  }
View Full Code Here

    }
    fail("Default Provider extension not found");
  }

  public void testProviderExists() throws Exception {
    IConnectionProvider defProvider = null;
    IConnectionProvider[] providers = ExtensionManager.getProviders();
    for( int i = 0; i < providers.length; i++ ) {
      if( providers[i].getId().equals(DefaultConnectionProvider.PROVIDER_ID))
        defProvider = providers[i];
    }
View Full Code Here

    ILaunch launch = wc.launch("run", new NullProgressMonitor());
   
    Thread.sleep(10000);
   
    try {
      IConnectionProvider defProvider =
        ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
      HashMap map = new HashMap();
      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);
View Full Code Here

TOP

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

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.