Author: rob.stryker(a)jboss.com
Date: 2007-09-14 18:12:48 -0400 (Fri, 14 Sep 2007)
New Revision: 3640
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
Log:
Moved xpath initialization to a class that listens in to server lifecycle events so that
the automatic creation of the EAP server does not miss out on it.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2007-09-14
20:14:34 UTC (rev 3639)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2007-09-14
22:12:48 UTC (rev 3640)
@@ -29,6 +29,7 @@
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
import org.jboss.ide.eclipse.as.core.modules.ArchivesBuildListener;
import org.osgi.framework.BundleContext;
@@ -70,6 +71,7 @@
public void start(BundleContext context) throws Exception {
super.start(context);
ArchivesBuildListener.getInstance();
+ XPathModel.getDefault();
}
/**
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2007-09-14
20:14:34 UTC (rev 3639)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2007-09-14
22:12:48 UTC (rev 3640)
@@ -13,9 +13,12 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerLifecycleListener;
+import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.internal.AbstractJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class XPathModel {
public static final String EMPTY_STRING =
"org.jboss.ide.eclipse.as.core.model.descriptor.EmptyString";
@@ -28,7 +31,7 @@
private static final String QUERY =
"org.jboss.ide.eclipse.as.core.model.descriptor.Query";
- public static XPathModel instance;
+ private static XPathModel instance;
public static XPathModel getDefault() {
if( instance == null )
instance = new XPathModel();
@@ -38,6 +41,20 @@
protected HashMap<String, ArrayList<XPathCategory>> serverToCategories;
public XPathModel() {
serverToCategories = new HashMap<String, ArrayList<XPathCategory>>();
+ ServerCore.addServerLifecycleListener(new IServerLifecycleListener() {
+ public void serverAdded(IServer server) {
+ AbstractJBossServerRuntime ajbsr = (AbstractJBossServerRuntime)
+ server.getRuntime().loadAdapter(AbstractJBossServerRuntime.class, null);
+ IPath loc = server.getRuntime().getLocation();
+ IPath configFolder =
loc.append("server").append(ajbsr.getJBossConfiguration());
+ loadDefaults(server, configFolder.toOSString());
+ save(server);
+ }
+ public void serverChanged(IServer server) {
+ }
+ public void serverRemoved(IServer server) {
+ }
+ });
}
public XPathQuery getQuery(IServer server, IPath path) {
Show replies by date