Examples of IConnectionWrapper


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

Examples of net.jmesnil.jmx.core.IConnectionWrapper

        }
        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

Examples of net.jmesnil.jmx.core.IConnectionWrapper

      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

Examples of net.jmesnil.jmx.core.IConnectionWrapper

    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

Examples of org.jboss.tools.jmx.core.IConnectionWrapper

  }

  @Override
  public Object[] getChildren(Object parentElement) {
    if( parentElement instanceof IConnectionWrapper ) {
      IConnectionWrapper w = (IConnectionWrapper)parentElement;
      Root r = w.getRoot();
      if( r != null ) {
        if (r.containsDomain("org.apache.servicemix")) {
          ServiceMixFacade facade = new JmxTemplateServiceMixFacade(new JmxPluginJmxTemplate(r.getConnection()));
          ServiceMixNode smx = new ServiceMixNode(r, facade);
          return new Object[]{smx};
View Full Code Here

Examples of org.jboss.tools.jmx.core.IConnectionWrapper

  }

  @Override
  public Object[] getChildren(Object parentElement) {
    if( parentElement instanceof IConnectionWrapper ) {
      IConnectionWrapper w = (IConnectionWrapper)parentElement;
      Root r = w.getRoot();
      if( r != null ) {
        if (r.containsDomain("org.apache.camel")) {
          CamelFacade facade = new JmxTemplateCamelFacade(new JmxPluginJmxTemplate(r.getConnection()));
          CamelContextsNode camel = new CamelContextsNode(r, facade);
          return new Object[]{camel};
View Full Code Here

Examples of org.jboss.tools.jmx.core.IConnectionWrapper

  }

  @Override
  public Object[] getChildren(Object parentElement) {
    if( parentElement instanceof IConnectionWrapper ) {
      IConnectionWrapper w = (IConnectionWrapper)parentElement;
      Root r = w.getRoot();
      if( r != null ) {
        if (r.containsDomain("osgi.core")) {
          try {
            JmxPluginJmxTemplate jmxTemplate = new JmxPluginJmxTemplate(r.getConnection());
            OsgiFacade facade = new OsgiFacade(jmxTemplate);
View Full Code Here

Examples of org.jboss.tools.jmx.core.IConnectionWrapper

          return true;
        return false;
      }

      public void serverChanged(ServerEvent event) {
        IConnectionWrapper con = idToConnection.get(event.getServer().getId());
        if( con != null ) {
          if( serverSwitchesToState(event, IServer.STATE_STARTED)) {
            fireAdded(con);
          } else if( serverSwitchesToState(event, IServer.STATE_STOPPED)) {
            fireRemoved(con);
          }
        }
      }

      public void serverAdded(IServer server) {
        if( belongsHere(server)) {
          getConnections();
          if( !idToConnection.containsKey(server.getId())) {
            IConnectionWrapper connection = createConnection(server);
            idToConnection.put(server.getId(), connection);
            if( connection != null && server.getServerState() == IServer.STATE_STARTED )
              fireAdded(idToConnection.get(server.getId()));
          }
        }
      }

      public void serverChanged(IServer server) {
        if( belongsHere(server)) {
          getConnections();
          Object o = idToConnection.get(server.getId());
          if( o == null ) {
            IConnectionWrapper connection = createConnection(server);
            idToConnection.put(server.getId(), connection);
            if( connection != null && server.getServerState() == IServer.STATE_STARTED )
              fireAdded(idToConnection.get(server.getId()));
          }
        }
      }

      public void serverRemoved(IServer server) {
        if( belongsHere(server)) {
          IConnectionWrapper connection;
          if( idToConnection != null ) {
            connection = idToConnection.get(server.getId());
            if( connection != null ) {
              idToConnection.remove(server.getId());
              fireRemoved(connection);
            }
          } else {
            // hasn't been initialized yet
            getConnections();
           
            // but now its missing from the collection, so make one up
            IConnectionWrapper dummy = createConnection(server);
           
            // Make sure we don't fire a removal for a connection that doesn't exist
            if( dummy != null )
              fireRemoved(dummy);
          }
View Full Code Here

Examples of org.jboss.tools.jmx.core.IConnectionWrapper

    // do it all on demand right now
    if( idToConnection == null ) {
      // load them all
      idToConnection = new HashMap<String, IConnectionWrapper>();
      IServer[] allServers = ServerCore.getServers();
      IConnectionWrapper c;
      for( int i = 0; i < allServers.length; i++ ) {
        if( belongsHere(allServers[i])) {
          c = createConnection(allServers[i]);
          if( c != null )
            idToConnection.put(allServers[i].getId(), c);
View Full Code Here

Examples of org.jboss.tools.jmx.core.IConnectionWrapper

  protected KarafJMXModel() {
    dummies = new HashMap<IServer, IConnectionWrapper>();
  }
 
  public IConnectionWrapper findConnectionWrapper(IServer server) {
    IConnectionWrapper found = findJVMConnectionWrapper(server);
    if( found == null ) {
      IConnectionWrapper dummy = dummies.get(server);
      if( dummy == null ) {
        dummy = new DummyConnectionWrapper();
        dummies.put(server, dummy);
      }
      return dummy;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.