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

Robert Stryker rawblem at gmail.com
Thu Nov 9 19:26:25 EST 2006


  User: rawb    
  Date: 06/11/09 19:26:25

  Modified:    as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client   
                        NullLaunchable.java DoNothingClient.java
  Added:       as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client   
                        JBossLaunchAdapter.java
  Log:
  Rewrote Core entirley. It's clean and spiffy now. 
  
  Revision  Changes    Path
  1.3       +21 -3     jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client/NullLaunchable.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NullLaunchable.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client/NullLaunchable.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- NullLaunchable.java	10 Jul 2006 15:42:32 -0000	1.2
  +++ NullLaunchable.java	10 Nov 2006 00:26:25 -0000	1.3
  @@ -1,8 +1,26 @@
  -package org.jboss.ide.eclipse.as.core.client;
  -
   /*
  - * Used for pre-packaged jst stuff. Just as a label
  + * JBoss, Home of Professional Open Source
  + * Copyright 2006, JBoss Inc., 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.client;
  +
   public class NullLaunchable {
   
   }
  
  
  
  1.4       +0 -4      jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client/DoNothingClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DoNothingClient.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client/DoNothingClient.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- DoNothingClient.java	27 Jul 2006 06:34:03 -0000	1.3
  +++ DoNothingClient.java	10 Nov 2006 00:26:25 -0000	1.4
  @@ -28,7 +28,6 @@
   import org.eclipse.wst.server.core.model.ClientDelegate;
   import org.jboss.ide.eclipse.as.core.JBossServerCore;
   import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
  -import org.jboss.ide.eclipse.as.core.util.ASDebug;
   
   /**
    * This client will only copy to the deploy directory,
  @@ -55,9 +54,6 @@
   
   	public IStatus launch(IServer server, Object launchable, String launchMode,
   			ILaunch launch) {
  -		
  -		// Do nothing
  -		ASDebug.p("Here, I do nothing", this);
   		return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, 0, "A-OK", null);
   	}
   
  
  
  
  1.1      date: 2006/11/10 00:26:25;  author: rawb;  state: Exp;jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client/JBossLaunchAdapter.java
  
  Index: JBossLaunchAdapter.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2006, JBoss Inc., 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.client;
  
  import org.eclipse.core.runtime.CoreException;
  import org.eclipse.jst.server.core.EJBBean;
  import org.eclipse.jst.server.core.JndiObject;
  import org.eclipse.jst.server.core.Servlet;
  import org.eclipse.wst.server.core.IModuleArtifact;
  import org.eclipse.wst.server.core.IServer;
  import org.eclipse.wst.server.core.model.LaunchableAdapterDelegate;
  import org.eclipse.wst.server.core.model.ServerDelegate;
  import org.eclipse.wst.server.core.util.WebResource;
  import org.jboss.ide.eclipse.as.core.JBossServerCore;
  import org.jboss.ide.eclipse.as.core.server.JBossServer;
  
  public class JBossLaunchAdapter extends LaunchableAdapterDelegate {
  	public JBossLaunchAdapter() {
  		super();
  	}
  
  	// Can I launch onto this server? Let's find out
  	public Object getLaunchable(IServer server, IModuleArtifact moduleArtifact)
  			throws CoreException {
  		
  		// Only play to jboss servers
  		JBossServer jbServer = JBossServerCore.getServer(server);
  		if( jbServer == null ) 
  			return null;
  		
  		if( isJstArtifact(moduleArtifact))
  			return prepareJstArtifact(moduleArtifact, jbServer);
          
          return new NullLaunchable();
  	}
  	
  	private boolean isJstArtifact(IModuleArtifact moduleArtifact ) {
  		// If we have JST projects being launched......
  		if ((moduleArtifact instanceof Servlet))		return true;
  		if ((moduleArtifact instanceof WebResource))	return true;
          if ((moduleArtifact instanceof EJBBean))		return true;
          if ((moduleArtifact instanceof JndiObject)) 	return true;
  
          return false;
  	}
  	
  	private Object prepareJstArtifact(IModuleArtifact moduleObject, ServerDelegate delegate) {
  		if ((moduleObject instanceof Servlet) ||(moduleObject instanceof WebResource))
              return prepareHttpLaunchable(moduleObject, delegate);
  		
          if((moduleObject instanceof EJBBean) || (moduleObject instanceof JndiObject))
              return prepareJndiLaunchable(moduleObject,delegate);
  
          return null;
  	}
  	
  	private Object prepareHttpLaunchable(IModuleArtifact moduleObject, ServerDelegate delegate) {
  //		try {
  //			return new HttpLaunchable(new URL("http://www.google.com"));
  //		} catch( Exception e ) {
  //		}
  //		return null;
  		return new NullLaunchable();
  	}
  	private Object prepareJndiLaunchable(IModuleArtifact moduleObject, ServerDelegate delegate) {
  //        Properties props = new Properties();
  //        props.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
  //        props.put("java.naming.provider.url","");
  //        props.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
  //        return new JndiLaunchable(props, "Hello");
  		return new NullLaunchable();
  	}
  }
  
  
  



More information about the jboss-cvs-commits mailing list