[jboss-cvs] jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime ...
Robert Stryker
rawblem at gmail.com
Wed Sep 6 15:31:36 EDT 2006
User: rawb
Date: 06/09/06 15:31:36
Modified: as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime
WebtoolsProjectJBossClasspathContainerInitializer.java
Log:
Moved more data from 'server' object to 'runtime' object to more closely follow the WTP assumptions.
Revision Changes Path
1.3 +10 -26 jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: WebtoolsProjectJBossClasspathContainerInitializer.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- WebtoolsProjectJBossClasspathContainerInitializer.java 29 Aug 2006 16:49:08 -0000 1.2
+++ WebtoolsProjectJBossClasspathContainerInitializer.java 6 Sep 2006 19:31:36 -0000 1.3
@@ -25,7 +25,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.ClasspathContainerInitializer;
import org.eclipse.jdt.core.IClasspathContainer;
@@ -37,12 +36,8 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
-import org.jboss.ide.eclipse.as.core.server.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.runtime.JBossProjectRuntime;
import org.jboss.ide.eclipse.as.core.server.runtime.JBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.util.ASDebug;
public class WebtoolsProjectJBossClasspathContainerInitializer extends
ClasspathContainerInitializer {
@@ -115,30 +110,19 @@
if( runtimeId == null ) return;
IRuntime runtime = ServerCore.findRuntime(runtimeId);
- Object projectRuntime = runtime.loadAdapter(JBossProjectRuntime.class, null);
+ if( runtime == null ) return;
- if( projectRuntime == null ) return;
- JBossProjectRuntime projRun = (JBossProjectRuntime)projectRuntime;
- String serverId = projRun.getServerId();
+ Object serverRuntime = runtime.loadAdapter(JBossServerRuntime.class, null);
- if( serverId == null ) return;
+ if( serverRuntime == null ) return;
+ JBossServerRuntime jbRuntime = (JBossServerRuntime)serverRuntime;
- IServer server = ServerCore.findServer(serverId);
- if( server == null ) return;
- JBossServer jbServer = server.loadAdapter(JBossServer.class, null) == null ? null : (JBossServer)server.getAdapter(JBossServer.class);
- if( jbServer == null ) return;
+ String serverHome = runtime.getLocation().toOSString();
+ String configName = jbRuntime.getConfigName();
+ String jbossVersion = jbRuntime.getVersionDelegate().getId();
- String serverHome = server.getRuntime().getLocation().toOSString();
- String configName = jbServer.getAttributeHelper().getJbossConfiguration();
-
- ASDebug.p("runtime,config,version", this);
- JBossServerRuntime jbsRuntime = server.getRuntime().loadAdapter(JBossServerRuntime.class,new NullProgressMonitor()) == null ? null : (JBossServerRuntime)server.getRuntime().getAdapter(JBossServerRuntime.class);
-
- if( jbsRuntime == null ) return;
- String jbossVersion = jbsRuntime.getVersionDelegate().getId();
-
- entries = loadClasspathEntries2(runtimeId, facetId, facetVersion, serverHome, configName, jbossVersion, jbsRuntime);
+ entries = loadClasspathEntries2(runtimeId, facetId, facetVersion, serverHome, configName, jbossVersion, jbRuntime);
}
protected IClasspathEntry[] loadClasspathEntries2(String runtimeId, String facetId,
More information about the jboss-cvs-commits
mailing list