[jboss-cvs] jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server ...

Robert Stryker rawblem at gmail.com
Wed Nov 15 17:26:56 EST 2006


  User: rawb    
  Date: 06/11/15 17:26:56

  Modified:    as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server  
                        ServerLaunchDefaults.java
  Added:       as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server  
                        IServerStatePoller.java
  Log:
  Rebuilt the event log API and fixed some UI bugs preventing an efficient refresh of the tree. 
  
  Revision  Changes    Path
  1.2       +21 -1     jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/ServerLaunchDefaults.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ServerLaunchDefaults.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/ServerLaunchDefaults.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- ServerLaunchDefaults.java	10 Nov 2006 00:26:26 -0000	1.1
  +++ ServerLaunchDefaults.java	15 Nov 2006 22:26:56 -0000	1.2
  @@ -37,8 +37,11 @@
   import org.eclipse.jdt.launching.IVMInstall;
   import org.eclipse.jdt.launching.JavaRuntime;
   import org.eclipse.wst.server.core.IServer;
  +import org.jboss.ide.eclipse.as.core.model.DescriptorModel;
  +import org.jboss.ide.eclipse.as.core.model.DescriptorModel.ServerDescriptorModel;
   import org.jboss.ide.eclipse.as.core.runtime.IJBossServerLaunchDefaults;
   import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
  +import org.jboss.ide.eclipse.as.core.server.JBossServer;
   import org.jboss.ide.eclipse.as.core.server.JBossServerLaunchConfiguration;
   
   public class ServerLaunchDefaults implements IJBossServerLaunchDefaults {
  @@ -56,11 +59,21 @@
   
   	protected IServer server;
   	protected IJBossServerRuntime runtime;
  +	protected JBossServer jbServer;
   	
   	public ServerLaunchDefaults(IServer server) {
   		this.server = server;
   	}
   	
  +	protected JBossServer getJBServer() {
  +		if( jbServer == null ) {
  +			try {
  +				jbServer = (JBossServer)server.loadAdapter(JBossServer.class, new NullProgressMonitor());
  +			} catch( Exception e) {
  +			}
  +		}
  +		return jbServer;
  +	}
   	protected IJBossServerRuntime getRuntime() {
   		if( runtime == null ) {
   			try {
  @@ -93,7 +106,14 @@
   
   
   		// TODO FIX!
  - 		int jndiPort = 1099; //server.getDescriptorModel().getJNDIPort();
  +		int jndiPort;
  +		try {
  +			String serverConfDir = getJBServer().getConfigDirectory(false);
  +			ServerDescriptorModel descriptorModel = DescriptorModel.getDefault().getServerModel(new Path(serverConfDir));
  +			jndiPort = descriptorModel.getJNDIPort();
  +		} catch( Exception e ) {
  +			jndiPort = 1099;
  +		}
   		String host = server.getHost();
   		String twiddleArgs = "-s " + host + ":" + jndiPort +  " -a jmx/rmi/RMIAdaptor ";
   
  
  
  
  1.1      date: 2006/11/15 22:26:56;  author: rawb;  state: Exp;jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/IServerStatePoller.java
  
  Index: IServerStatePoller.java
  ===================================================================
  /**
   * JBoss, a Division of Red Hat
   * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
  * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  package org.jboss.ide.eclipse.as.core.runtime.server;
  
  import org.eclipse.wst.server.core.IServer;
  import org.jboss.ide.eclipse.as.core.runtime.server.polling.PollThread;
  import org.jboss.ide.eclipse.as.core.server.attributes.IServerPollingAttributes;
  
  public interface IServerStatePoller extends IServerPollingAttributes {
  	
  	public static final boolean SERVER_UP = true;
  	public static final boolean SERVER_DOWN = false;
  	
  	public static final int CANCEL = 0;
  	public static final int TIMEOUT_REACHED = 1;
  	
  	public void beginPolling(IServer server, boolean expectedState, PollThread pt); // expected to launch own thread
  	public boolean isComplete();
  	public boolean getState(); 
  	public void cancel(int type);    // cancel the polling
  	public void cleanup();   // clean up any resources / processes. Will ALWAYS be called
  }
  
  
  



More information about the jboss-cvs-commits mailing list