Author: rob.stryker(a)jboss.com
Date: 2011-10-05 07:53:53 -0400 (Wed, 05 Oct 2011)
New Revision: 35364
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/schema/behaviourExtension.exsd
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchSetupParticipant.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
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/publishers/AbstractPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerPublishMethodType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.properties
trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.xml
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java
Log:
JBIDE-9845 - unify the APIs
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -11,7 +11,6 @@
package org.jboss.ide.eclipse.as.core;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
@@ -30,21 +29,11 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerType;
-import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.server.IPollerFailureHandler;
import org.jboss.ide.eclipse.as.core.server.IServerAlreadyStartedHandler;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchSetupParticipant;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7Server;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7StartLaunchDelegate;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.core.util.ServerUtil;
/**
* Manages the extensions for this plugin
@@ -68,8 +57,6 @@
/** The map of pollerID -> PollerObject */
private HashMap<String, IPollerFailureHandler> pollerFailureHandlers;
- private ArrayList<PublisherWrapper> publishers;
-
/** The method used to load / instantiate the pollers */
public void loadPollers() {
pollers = new HashMap<String, ServerStatePollerType>();
@@ -169,7 +156,7 @@
return null;
}
-
+ private ArrayList<PublisherWrapper> publishers;
public IJBossServerPublisher getPublisher(IServer server, IModule[] module, String
deployMethod) {
if( publishers == null )
loadPublishers();
@@ -183,21 +170,7 @@
}
return null;
}
-
- public IJBossServerPublisher[] getZippedPublishers() {
- if( publishers == null )
- loadPublishers();
- ArrayList<IJBossServerPublisher> list = new
ArrayList<IJBossServerPublisher>();
- Iterator<PublisherWrapper> i = publishers.iterator();
- PublisherWrapper wrapper;
- while(i.hasNext()) {
- wrapper = i.next();
- if( wrapper.isZipDelegate )
- list.add( wrapper.getNewInstance() );
- }
- return list.toArray(new IJBossServerPublisher[list.size()]);
- }
-
+
private void loadPublishers() {
ArrayList<PublisherWrapper> publishers = new
ArrayList<PublisherWrapper>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
@@ -254,44 +227,61 @@
}
}
- private ServerPublishMethodType[] publishMethodTypes;
- public ServerPublishMethodType[] getPublishMethodTypes() {
- if(publishMethodTypes == null )
- publishMethodTypes = loadPublishMethodTypes();
- return publishMethodTypes;
- }
- public ServerPublishMethodType[] loadPublishMethodTypes() {
- ArrayList<ServerPublishMethodType> types = new
ArrayList<ServerPublishMethodType>();
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf =
registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID,
"publishMethod"); //$NON-NLS-1$
- for( int i = 0; i < cf.length; i++ ) {
- types.add(new ServerPublishMethodType(cf[i]));
- }
- return types.toArray(new ServerPublishMethodType[types.size()]);
- }
-
- public IJBossServerPublishMethodType getPublishMethod(String id) {
- ServerPublishMethodType[] publishMethods = getPublishMethodTypes();
- for( int i = 0; i < publishMethods.length; i++ )
- if( publishMethods[i].getId().equals(id))
- return publishMethods[i];
- return null;
- }
- public IJBossServerPublishMethodType[] findPossiblePublishMethods(IServerType type) {
- ArrayList<IJBossServerPublishMethodType> list = new
ArrayList<IJBossServerPublishMethodType>();
- list.addAll(Arrays.asList(getPublishMethodTypes()));
- Iterator<IJBossServerPublishMethodType> i = list.iterator();
+ public IJBossServerPublisher[] getZippedPublishers() {
+ if( publishers == null )
+ loadPublishers();
+ ArrayList<IJBossServerPublisher> list = new
ArrayList<IJBossServerPublisher>();
+ Iterator<PublisherWrapper> i = publishers.iterator();
+ PublisherWrapper wrapper;
while(i.hasNext()) {
- if( !i.next().accepts(type.getId()))
- i.remove();
+ wrapper = i.next();
+ if( wrapper.isZipDelegate )
+ list.add( wrapper.getNewInstance() );
}
- return list.toArray(new IJBossServerPublishMethodType[list.size()]);
+ return list.toArray(new IJBossServerPublisher[list.size()]);
}
- public IJBossServerPublishMethodType[] findPossiblePublishMethods(IServer server) {
- return findPossiblePublishMethods(server.getServerType());
- }
+
+//
+// private ServerPublishMethodType[] publishMethodTypes;
+// public ServerPublishMethodType[] getPublishMethodTypes() {
+// if(publishMethodTypes == null )
+// publishMethodTypes = loadPublishMethodTypes();
+// return publishMethodTypes;
+// }
+//
+// public ServerPublishMethodType[] loadPublishMethodTypes() {
+// ArrayList<ServerPublishMethodType> types = new
ArrayList<ServerPublishMethodType>();
+// IExtensionRegistry registry = Platform.getExtensionRegistry();
+// IConfigurationElement[] cf =
registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID,
"publishMethod"); //$NON-NLS-1$
+// for( int i = 0; i < cf.length; i++ ) {
+// types.add(new ServerPublishMethodType(cf[i]));
+// }
+// return types.toArray(new ServerPublishMethodType[types.size()]);
+// }
+//
+// public IJBossServerPublishMethodType getPublishMethod(String id) {
+// ServerPublishMethodType[] publishMethods = getPublishMethodTypes();
+// for( int i = 0; i < publishMethods.length; i++ )
+// if( publishMethods[i].getId().equals(id))
+// return publishMethods[i];
+// return null;
+// }
+// public IJBossServerPublishMethodType[] findPossiblePublishMethods(IServerType type) {
+// ArrayList<IJBossServerPublishMethodType> list = new
ArrayList<IJBossServerPublishMethodType>();
+// list.addAll(Arrays.asList(getPublishMethodTypes()));
+// Iterator<IJBossServerPublishMethodType> i = list.iterator();
+// while(i.hasNext()) {
+// if( !i.next().accepts(type.getId()))
+// i.remove();
+// }
+// return list.toArray(new IJBossServerPublishMethodType[list.size()]);
+// }
+//
+// public IJBossServerPublishMethodType[] findPossiblePublishMethods(IServer server) {
+// return findPossiblePublishMethods(server.getServerType());
+// }
// API extension
public static interface IServerJMXRunnable {
@@ -340,38 +330,38 @@
}
- /**
- * Temporary home for start launch setup participants and launch configs
- * Should eventually be replaced by an extension point of some type
- *
- * TODO Convert this into a suitable fixed API
- */
- public static HashMap<String, IStartLaunchDelegate> JBoss7launchDelegates;
- public static ArrayList<IStartLaunchSetupParticipant> JBoss7setupParticipants;
- public static HashMap<String, IStartLaunchDelegate> JBossLaunchDelegates;
- public static ArrayList<IStartLaunchSetupParticipant> JBossSetupParticipants;
- static {
- JBoss7setupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
- JBoss7launchDelegates = new HashMap<String, IStartLaunchDelegate>();
- JBoss7setupParticipants.add(new LocalJBoss7StartLaunchDelegate());
- JBoss7launchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new
LocalJBoss7StartLaunchDelegate());
-
- JBossSetupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
- JBossLaunchDelegates = new HashMap<String, IStartLaunchDelegate>();
- JBossSetupParticipants.add(new LocalJBossStartLaunchDelegate());
- JBossLaunchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new
LocalJBossStartLaunchDelegate());
- }
- public HashMap<String, IStartLaunchDelegate> getLaunchDelegates(IServer server) {
- if( server.getServerType().getId().equals(IJBossToolingConstants.SERVER_AS_70)) {
- return JBoss7launchDelegates;
- }
- return JBossLaunchDelegates;
- }
- public ArrayList<IStartLaunchSetupParticipant> getSetupParticipants(IServer
server) {
- if( ServerUtil.isJBoss7(server)) {
- return JBoss7setupParticipants;
- }
- return JBossSetupParticipants;
- }
-
+// /**
+// * Temporary home for start launch setup participants and launch configs
+// * Should eventually be replaced by an extension point of some type
+// *
+// * TODO Convert this into a suitable fixed API
+// */
+// public static HashMap<String, IStartLaunchDelegate> JBoss7launchDelegates;
+// public static ArrayList<IStartLaunchSetupParticipant> JBoss7setupParticipants;
+// public static HashMap<String, IStartLaunchDelegate> JBossLaunchDelegates;
+// public static ArrayList<IStartLaunchSetupParticipant> JBossSetupParticipants;
+// static {
+// JBoss7setupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
+// JBoss7launchDelegates = new HashMap<String, IStartLaunchDelegate>();
+// JBoss7setupParticipants.add(new LocalJBoss7StartLaunchDelegate());
+// JBoss7launchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new
LocalJBoss7StartLaunchDelegate());
+//
+// JBossSetupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
+// JBossLaunchDelegates = new HashMap<String, IStartLaunchDelegate>();
+// JBossSetupParticipants.add(new LocalJBossStartLaunchDelegate());
+// JBossLaunchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new
LocalJBossStartLaunchDelegate());
+// }
+// public HashMap<String, IStartLaunchDelegate> getLaunchDelegates(IServer server)
{
+// if( server.getServerType().getId().equals(IJBossToolingConstants.SERVER_AS_70)) {
+// return JBoss7launchDelegates;
+// }
+// return JBossLaunchDelegates;
+// }
+// public ArrayList<IStartLaunchSetupParticipant> getSetupParticipants(IServer
server) {
+// if( ServerUtil.isJBoss7(server)) {
+// return JBoss7setupParticipants;
+// }
+// return JBossSetupParticipants;
+// }
+//
}
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 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -29,6 +29,7 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
import org.jboss.ide.eclipse.as.core.server.internal.ServerListener;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.osgi.framework.BundleContext;
@@ -77,12 +78,16 @@
return Status.OK_STATUS;
}
};
- job.schedule();
+ job.schedule(4000);
// register the debug options listener
final Hashtable<String, String> props = new Hashtable<String, String>(4);
props.put(DebugOptions.LISTENER_SYMBOLICNAME, PLUGIN_ID);
context.registerService(DebugOptionsListener.class.getName(), new Trace(), props);
+
+ // Temporary
+ BehaviourModel.getModel();
+
}
/**
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -26,9 +26,12 @@
public abstract class AbstractPublishMethod implements IJBossServerPublishMethod {
public abstract String getPublishMethodId();
- public IJBossServerPublishMethodType getPublishMethodType() {
- return ExtensionManager.getDefault().getPublishMethod(getPublishMethodId());
- }
+
+// @Deprecated
+// public IJBossServerPublishMethodType getPublishMethodType() {
+// return ExtensionManager.getDefault().getPublishMethod(getPublishMethodId());
+// }
+
public void publishStart(DeployableServerBehavior behaviour,
IProgressMonitor monitor) throws CoreException {
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -19,7 +19,7 @@
import
org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
public interface IJBossServerPublishMethod {
- public IJBossServerPublishMethodType getPublishMethodType();
+// public IJBossServerPublishMethodType getPublishMethodType();
public void publishStart(DeployableServerBehavior behaviour, IProgressMonitor monitor)
throws CoreException;
public int publishFinish(DeployableServerBehavior behaviour, IProgressMonitor monitor)
throws CoreException;
public int publishModule(DeployableServerBehavior behaviour, int kind, int deltaKind,
IModule[] module, IProgressMonitor monitor) throws CoreException;
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -0,0 +1,175 @@
+package org.jboss.ide.eclipse.as.core.server.internal;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
+
+public class BehaviourModel {
+ private static BehaviourModel model;
+ public static BehaviourModel getModel() {
+ if( model == null )
+ model = new BehaviourModel();
+ return model;
+ }
+
+ /*
+ * Server type maps to some behaviour
+ */
+ private HashMap<String, Behaviour> map;
+ public BehaviourModel() {
+ map = new HashMap<String, Behaviour>();
+ loadModel();
+ }
+
+ public static IJBossServerPublishMethodType getPublishMethodType(IServer server) {
+ String serverType = server.getServerType().getId();
+ String behaviourType =
DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(server);
+ return BehaviourModel.getModel().getBehaviour(serverType).getImpl(behaviourType);
+ }
+
+ /*
+ * Get all setup participants for this server type, regardless
+ * of behaviour type
+ */
+ public ArrayList<IJBossLaunchDelegate> getSetupParticipants(IServer server) {
+ Behaviour beh = map.get(server.getServerType().getId());
+ ArrayList<IJBossLaunchDelegate> list = new
ArrayList<IJBossLaunchDelegate>();
+ BehaviourImpl[] impls = beh.getImplementations();
+ for( int i = 0; i < impls.length; i++ ) {
+ list.add(impls[i].getLaunchDelegate());
+ }
+ return null;
+ }
+
+ /*
+ * Get the single launch delegate designated for this server type
+ */
+ public IJBossLaunchDelegate getLaunchDelegate(IServer server, String mode) {
+ Behaviour beh = map.get(server.getServerType().getId());
+ return beh.getImpl(mode).getLaunchDelegate();
+ }
+
+ protected void loadModel() {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf =
registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID,
"behaviourExtension"); //$NON-NLS-1$
+ for( int i = 0; i < cf.length; i++ ) {
+ String serverTypes = cf[i].getAttribute("serverTypes"); //$NON-NLS-1$
+ String[] allTypes = serverTypes.split(","); //$NON-NLS-1$
+ BehaviourImpl impl = new BehaviourImpl(cf[i]);
+ Behaviour b;
+ for( int j = 0; j < allTypes.length; j++ ) {
+ b = getOrCreateBehaviour(allTypes[j]);
+ b.addImpl(impl);
+ }
+ }
+ }
+
+ public Behaviour getBehaviour(String serverType) {
+ return map.get(serverType);
+ }
+
+ protected Behaviour getOrCreateBehaviour(String serverType) {
+ Behaviour b = map.get(serverType);
+ if( b == null )
+ map.put(serverType, new Behaviour(serverType));
+ return map.get(serverType);
+ }
+
+ public static class Behaviour {
+ private String serverType;
+ private HashMap<String, BehaviourImpl> behTypeToImpl;
+ public Behaviour(String serverType) {
+ this.serverType = serverType;
+ behTypeToImpl = new HashMap<String, BehaviourImpl>();
+ }
+ public String getServerType() {
+ return serverType;
+ }
+ // Will overwrite previous values
+ public void addImpl(BehaviourImpl impl) {
+ behTypeToImpl.put(impl.typeId, impl);
+ }
+ public BehaviourImpl getImpl(String behaviourType) {
+ return behTypeToImpl.get(behaviourType);
+ }
+ public BehaviourImpl[] getImplementations() {
+ ArrayList<BehaviourImpl> list = new ArrayList<BehaviourImpl>();
+ list.addAll(behTypeToImpl.values());
+ return list.toArray(new BehaviourImpl[list.size()]);
+ }
+
+ public String[] getSupportedBehaviours() {
+ Set<String> c = behTypeToImpl.keySet();
+ ArrayList<String> c2 = new ArrayList<String>();
+ c2.addAll(c);
+ Collections.sort(c2);
+ return c2.toArray(new String[c2.size()]);
+ }
+ }
+
+ /*
+ * This "implements" is a hack, just trying to get shit to compile!
+ */
+ public static class BehaviourImpl implements IJBossServerPublishMethodType {
+ private String name;
+ private String typeId;
+ private IConfigurationElement element;
+ private IJBossLaunchDelegate launchDelegate;
+ private String supportedServers;
+ public BehaviourImpl(IConfigurationElement element) {
+ this.element = element;
+ name = element.getAttribute("name"); //$NON-NLS-1$
+ typeId = element.getAttribute("typeId");//$NON-NLS-1$
+ supportedServers = element.getAttribute("serverTypes"); //$NON-NLS-1$
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getId() {
+ return typeId;
+ }
+ public boolean accepts(String serverTypeId) {
+ String[] servers = supportedServers.split(","); //$NON-NLS-1$
+ for( int i = 0; i < servers.length; i++ )
+ if( servers[i].trim().equals(serverTypeId))
+ return true;
+ return false;
+ }
+
+ public IJBossServerPublishMethod createPublishMethod() {
+ try {
+ return (IJBossServerPublishMethod)
element.createExecutableExtension("publishMethod"); //$NON-NLS-1$
+ } catch( CoreException ce ) {
+ JBossServerCorePlugin.getInstance().getLog().log(ce.getStatus());
+ }
+ return null;
+ }
+
+ public IJBossLaunchDelegate getLaunchDelegate() {
+ if( launchDelegate != null)
+ return launchDelegate;
+
+ try {
+ launchDelegate = (IJBossLaunchDelegate)
element.createExecutableExtension("launchDelegate"); //$NON-NLS-1$
+ return launchDelegate;
+ } catch( CoreException ce ) {
+ JBossServerCorePlugin.getInstance().getLog().log(ce.getStatus());
+ }
+ return null;
+ }
+ }
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -48,6 +48,7 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
@@ -235,8 +236,8 @@
DeployableServerBehavior.class, new NullProgressMonitor());
if( beh == null )
return false;
- IJBossServerPublishMethodType type = beh.createPublishMethod().getPublishMethodType();
- if( type.getId().equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD)) {
+ String type = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(getServer(),
LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+ if( type.equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD)) {
return true;
}
return false;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerPublishMethodType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerPublishMethodType.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerPublishMethodType.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -23,6 +23,19 @@
private String typeId, name;
private String[] serverTypes;
private IConfigurationElement element;
+ private String publisherClassAttribute;
+ public ServerPublishMethodType(String id, String name, String serverTypes2,
+ IConfigurationElement element, String publisherAttribute) {
+ this.typeId = id;
+ this.name = name;
+ String tmp = element.getAttribute("serverTypes"); //$NON-NLS-1$
+ serverTypes = serverTypes2.split(","); //$NON-NLS-1$
+ for( int i = 0; i < serverTypes.length; i++ )
+ serverTypes[i] = serverTypes[i].trim();
+ this.element = element;
+ this.publisherClassAttribute = publisherAttribute;
+ }
+
public ServerPublishMethodType(IConfigurationElement element) {
this.element = element;
IContributor c = element.getContributor();
@@ -33,6 +46,7 @@
// clean
for( int i = 0; i < serverTypes.length; i++ )
serverTypes[i] = serverTypes[i].trim();
+ publisherClassAttribute = "class"; //$NON-NLS-1$
}
public String getId() {
@@ -49,7 +63,7 @@
public IJBossServerPublishMethod createPublishMethod() {
try {
- return (IJBossServerPublishMethod)
element.createExecutableExtension("class"); //$NON-NLS-1$
+ return (IJBossServerPublishMethod)
element.createExecutableExtension(publisherClassAttribute);
} catch( CoreException ce ) {
}
return null;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -11,7 +11,6 @@
package org.jboss.ide.eclipse.as.core.server.internal.launch;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import org.eclipse.core.runtime.CoreException;
@@ -21,33 +20,35 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerUtil;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class DelegatingStartLaunchConfiguration extends
AbstractJBossStartLaunchConfiguration {
- public ArrayList<IStartLaunchSetupParticipant> getSetupParticipants(IServer
server) {
- return ExtensionManager.getDefault().getSetupParticipants(server);
+ public ArrayList<IJBossLaunchDelegate> getSetupParticipants(IServer server) {
+ //return ExtensionManager.getDefault().getSetupParticipants(server);
+ return BehaviourModel.getModel().getSetupParticipants(server);
}
- public HashMap<String, IStartLaunchDelegate> getLaunchDelegates(IServer server) {
- return ExtensionManager.getDefault().getLaunchDelegates(server);
- }
+// public HashMap<String, IStartLaunchDelegate> getLaunchDelegates(IServer server)
{
+// return ExtensionManager.getDefault().getLaunchDelegates(server);
+// }
// Allow all participants to set some defaults for their own details
// Participants should be careful not to change shared launch keys / values
// unless their operation mode (local / rse / etc) is in use
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy,
IServer server) throws CoreException {
- for( Iterator<IStartLaunchSetupParticipant> i =
getSetupParticipants(server).iterator(); i.hasNext(); ) {
+ for( Iterator<IJBossLaunchDelegate> i = getSetupParticipants(server).iterator();
i.hasNext(); ) {
i.next().setupLaunchConfiguration(workingCopy, server);
}
}
- protected IStartLaunchDelegate getDelegate(ILaunchConfiguration configuration) throws
CoreException {
+ protected IJBossLaunchDelegate getDelegate(ILaunchConfiguration configuration) throws
CoreException {
IServer server = ServerUtil.getServer(configuration);
DeployableServerBehavior beh = ServerConverter.getDeployableServerBehavior(server);
- IJBossServerPublishMethodType type = beh.createPublishMethod().getPublishMethodType();
- return getLaunchDelegates(server).get(type.getId());
+ String currentMode =
DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(beh.getServer());
+ //return getLaunchDelegates(server).get(currentMode);
+ return BehaviourModel.getModel().getLaunchDelegate(server, currentMode);
}
public void actualLaunch(ILaunchConfiguration configuration,
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -0,0 +1,26 @@
+package org.jboss.ide.eclipse.as.core.server.internal.launch;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+
+public interface IJBossLaunchDelegate {
+ public void actualLaunch(DelegatingStartLaunchConfiguration launchConfig,
ILaunchConfiguration configuration,
+ String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
+
+ public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode,
IProgressMonitor monitor)
+ throws CoreException;
+
+ public void preLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch,
IProgressMonitor monitor)
+ throws CoreException;
+
+ public void postLaunch(ILaunchConfiguration configuration, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException;
+
+ public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy,
IServer server)
+ throws CoreException;
+
+}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.launch;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-
-public interface IStartLaunchDelegate {
-
- public void actualLaunch(DelegatingStartLaunchConfiguration launchConfig,
ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
-
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode,
IProgressMonitor monitor)
- throws CoreException;
-
- public void preLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch,
IProgressMonitor monitor)
- throws CoreException;
-
- public void postLaunch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException;
-
-}
\ No newline at end of file
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchSetupParticipant.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchSetupParticipant.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchSetupParticipant.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.launch;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.wst.server.core.IServer;
-
-public interface IStartLaunchSetupParticipant {
-
- public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy,
IServer server)
- throws CoreException;
-
-}
\ No newline at end of file
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -36,7 +36,7 @@
* @author Rob Stryker
* @author André Dietisheim
*/
-public class LocalJBossStartLaunchDelegate extends AbstractJBossStartLaunchConfiguration
implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
+public class LocalJBossStartLaunchDelegate extends AbstractJBossStartLaunchConfiguration
implements IJBossLaunchDelegate {
public void setupLaunchConfiguration(
ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -19,8 +19,7 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchSetupParticipant;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
import
org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate;
import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
@@ -28,7 +27,7 @@
* @author Rob Stryker
*/
public class LocalJBoss7StartLaunchDelegate extends LocalJBossStartLaunchDelegate
- implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
+ implements IJBossLaunchDelegate {
public String[] getJavaLibraryPath(ILaunchConfiguration configuration) throws
CoreException {
return new String[] {};
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -24,11 +24,10 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.internal.Server;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
-import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
import org.jboss.ide.eclipse.as.core.util.internal.IMemento;
import org.jboss.ide.eclipse.as.core.util.internal.XMLMemento;
@@ -52,13 +51,17 @@
}
public static IJBossServerPublishMethodType getCurrentDeploymentMethodType(IServer
server, String defaultType) {
- String type = server.getAttribute(IDeployableServer.SERVER_MODE, defaultType);
- if( type != null ) {
- return ExtensionManager.getDefault().getPublishMethod(type);
- }
- return null;
+ return BehaviourModel.getPublishMethodType(server);
}
+ public static String getCurrentDeploymentMethodTypeId(IServer server) {
+ return getCurrentDeploymentMethodTypeId(server, null);
+ }
+
+ public static String getCurrentDeploymentMethodTypeId(IServer server, String
defaultType) {
+ return server.getAttribute(IDeployableServer.SERVER_MODE, defaultType);
+ }
+
public static DeploymentPreferences loadPreferencesFromFile(IServer server) {
File f = getFile(server);
InputStream is = null;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-10-05 11:46:11 UTC (rev
35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-10-05 11:53:53 UTC (rev
35364)
@@ -6,6 +6,7 @@
<extension-point id="pollerFailureHandler"
name="org.jboss.ide.eclipse.as.core.runtime.server.pollerFailureHandler"
schema="schema/pollerFailureHandler.exsd"/>
<extension-point id="publishers"
name="org.jboss.ide.eclipse.as.core.publishers"
schema="schema/publishers.exsd"/>
<extension-point id="publishMethod"
name="org.jboss.ide.eclipse.as.core.publishMethod"
schema="schema/publishMethod.exsd"/>
+ <extension-point id="behaviourExtension"
name="org.jboss.ide.eclipse.as.core.behaviourExtension"
schema="schema/behaviourExtension.exsd"/>
<extension-point id="jmxRunner"
name="org.jboss.ide.eclipse.as.core.jmxRunner"
schema="schema/jmxRunner.exsd"/>
<extension
@@ -1282,14 +1283,6 @@
</extension>
<extension
- point="org.jboss.ide.eclipse.as.core.publishers">
- <publisher
-
class="org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7JSTPublisher"
- priority="15"
- zipDelegate="false">
- </publisher>
- </extension>
- <extension
point="org.eclipse.jdt.core.classpathContainerInitializer">
<classpathContainerInitializer
class="org.jboss.ide.eclipse.as.core.server.internal.launch.RunJarContainerWrapper$RunJarContainerInitializer"
@@ -1326,6 +1319,8 @@
supportsArgument="true">
</variable>
</extension>
+
+ <!--
<extension
point="org.jboss.ide.eclipse.as.core.publishMethod">
<publishMethod
@@ -1335,4 +1330,39 @@
serverTypes="%AllJBTServerTypes">
</publishMethod>
</extension>
+ -->
+
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+
behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate"
+
launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate"
+ name="Local"
+
publishMethod="org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod"
+ serverTypes="%ServerTypesJBoss6OrLower"
+ typeId="local">
+ </behaviour>
+ </extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+
behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7BehaviorDelegate"
+
launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7StartLaunchDelegate"
+ name="Local"
+
publishMethod="org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod"
+ serverTypes="%ServerTypesJBoss7"
+ typeId="local">
+ </behaviour>
+ </extension>
+
+ <!-- The default publisher declaration. -->
+ <extension
+ point="org.jboss.ide.eclipse.as.core.publishers">
+ <publisher
+
class="org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7JSTPublisher"
+ priority="15"
+ zipDelegate="false">
+ </publisher>
+ </extension>
+
</plugin>
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/schema/behaviourExtension.exsd
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/schema/behaviourExtension.exsd
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/schema/behaviourExtension.exsd 2011-10-05
11:53:53 UTC (rev 35364)
@@ -0,0 +1,143 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.ide.eclipse.as.core"
xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.ide.eclipse.as.core"
id="publishers" name="org.jboss.ide.eclipse.as.core.publishers"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="behaviour" minOccurs="1"
maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="behaviour">
+ <complexType>
+ <attribute name="typeId" type="string">
+ <annotation>
+ <documentation>
+ A "type" such as local, rse, openshiftExpress, etc
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ A user-visible string representation of the type.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="serverTypes" type="string">
+ <annotation>
+ <documentation>
+ A comma-delimited string designating which server types this behaviour
element relates to.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="publishMethod" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="behaviourDelegate" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="launchDelegate" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties 2011-10-05
11:46:11 UTC (rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties 2011-10-05
11:53:53 UTC (rev 35364)
@@ -1,7 +1,9 @@
Bundle-Vendor.0 = JBoss by Red Hat
Bundle-Name.0 = JBossAS RSE Tools
-AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50
-AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
-AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.systemCopyServer
-ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60
+AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50,org.jboss.ide.eclipse.as.runtime.eap.60
+AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,
+AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,org.jboss.ide.eclipse.as.systemCopyServer
+ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
+ServerTypesJBoss6OrLower=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
+ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
RSEMethodName=Remote System Deployment
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml 2011-10-05 11:46:11 UTC
(rev 35363)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml 2011-10-05 11:53:53 UTC
(rev 35364)
@@ -1,14 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
- <!-- Below here is RSE stuff which can / should be moved if a new plugin is created
-->
<extension
- point="org.jboss.ide.eclipse.as.core.publishMethod">
- <publishMethod
- class="org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod"
- id="rse"
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+
behaviourDelegate="org.jboss.ide.eclipse.as.rse.core.RSEBehaviourDelegate"
+
launchDelegate="org.jboss.ide.eclipse.as.rse.core.RSEJBossStartLaunchDelegate"
name="%RSEMethodName"
-
serverTypes="org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.systemCopyServer">
- </publishMethod>
+ publishMethod="org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod"
+ serverTypes="%ServerTypesJBoss6OrLower"
+ typeId="rse">
+ </behaviour>
</extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+
behaviourDelegate="org.jboss.ide.eclipse.as.rse.core.RSEJBoss7BehaviourDelegate"
+
launchDelegate="org.jboss.ide.eclipse.as.rse.core.RSEJBoss7StartLaunchDelegate"
+ name="%RSEMethodName"
+ publishMethod="org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod"
+ serverTypes="%ServerTypesJBoss7"
+ typeId="rse">
+ </behaviour>
+ </extension>
</plugin>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -26,13 +26,12 @@
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import
org.jboss.ide.eclipse.as.core.server.internal.launch.AbstractJBossStartLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchSetupParticipant;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.util.ThreadUtils;
import org.jboss.ide.eclipse.as.rse.core.RSEHostShellModel.ServerShellModel;
public abstract class AbstractRSELaunchDelegate extends
AbstractJBossStartLaunchConfiguration
- implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
+ implements IJBossLaunchDelegate {
protected void executeRemoteCommand(String command, DelegatingServerBehavior behavior)
throws CoreException {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -12,9 +12,6 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.rse.core;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
-import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.DelegatingJBoss7ServerBehavior;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -33,12 +30,6 @@
*/
public void start(BundleContext bundleContext) throws Exception {
RSECorePlugin.context = bundleContext;
- DelegatingServerBehavior.addDelegateMapping(RSEPublishMethod.RSE_ID,
RSEBehaviourDelegate.class);
- DelegatingJBoss7ServerBehavior.addDelegateMapping(RSEPublishMethod.RSE_ID,
RSEJBoss7BehaviourDelegate.class);
- ExtensionManager.JBossLaunchDelegates.put(RSEPublishMethod.RSE_ID, new
RSEJBossStartLaunchDelegate());
- ExtensionManager.JBossSetupParticipants.add(new RSEJBossStartLaunchDelegate());
- ExtensionManager.JBoss7launchDelegates.put(RSEPublishMethod.RSE_ID, new
RSEJBoss7StartLaunchDelegate());
- ExtensionManager.JBoss7setupParticipants.add(new RSEJBoss7StartLaunchDelegate());
}
/*
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -20,12 +20,9 @@
import org.eclipse.wst.server.core.ServerEvent;
import org.eclipse.wst.server.ui.internal.view.servers.ShowInConsoleAction;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
-import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class ShowConsoleServerStateListener extends UnitedServerListener {
private static ShowConsoleServerStateListener instance;
@@ -44,10 +41,8 @@
if ((eventKind & ServerEvent.STATE_CHANGE) != 0) {
if( event.getServer().getServerState() == IServer.STATE_STARTING ) {
// do not launch console for remotes, for now
- DeployableServerBehavior beh =
ServerConverter.getDeployableServerBehavior(server);
- IJBossServerPublishMethodType type =
beh.createPublishMethod().getPublishMethodType();
- //IJBossServerPublishMethodType type =
DeploymentPreferenceLoader.getCurrentDeploymentMethodType(jbs.getServer());
- if( !type.getId().equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD))
+ String type = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(server,
LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+ if( !type.equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD))
return;
new Thread() {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -29,11 +29,13 @@
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.util.SocketUtil;
import org.eclipse.wst.server.ui.internal.command.ServerCommand;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel.Behaviour;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel.BehaviourImpl;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -86,26 +88,30 @@
// fill widgets
String[] nameList = new String[deployAdditions.size()];
for( int i = 0; i < nameList.length; i++ ) {
- nameList[i] = deployAdditions.get(i).getPublishType().getName();
+ nameList[i] = deployAdditions.get(i).behaviourName;
}
deployTypeCombo.setItems(nameList);
DeployableServerBehavior ds =
ServerConverter.getDeployableServerBehavior(callback.getServer().getOriginal());
String current = null;
if( ds != null ) {
- current = ds.createPublishMethod().getPublishMethodType().getName();
+ Behaviour b =
BehaviourModel.getModel().getBehaviour(callback.getServer().getOriginal().getServerType().getId());
+ String behaviourType =
DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(callback.getServer().getOriginal());
+ current = b.getImpl(behaviourType).getName();
} else {
String host = callback.getServer().getHost();
- IJBossServerPublishMethodType behType = null;
+// IJBossServerPublishMethodType behType = null;
+ BehaviourImpl impl = null;
+ String serverTypeId = callback.getServer().getServerType().getId();
if( SocketUtil.isLocalhost(host)) {
- behType =
ExtensionManager.getDefault().getPublishMethod(LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+ impl =
BehaviourModel.getModel().getBehaviour(serverTypeId).getImpl(LocalPublishMethod.LOCAL_PUBLISH_METHOD);
} else {
// socket is not localhost, hard code this for now
- behType = ExtensionManager.getDefault().getPublishMethod("rse");
//$NON-NLS-1$
+ impl =
BehaviourModel.getModel().getBehaviour(serverTypeId).getImpl("rse");
}
- current = behType.getName();
+ current = impl.getName();
callback.execute(new ChangeServerPropertyCommand(
callback.getServer(), IDeployableServer.SERVER_MODE,
- behType.getId(), Messages.EditorChangeServerMode));
+ impl.getId(), Messages.EditorChangeServerMode));
}
if( current != null ) {
int index = deployTypeCombo.indexOf(current);
@@ -130,19 +136,21 @@
}
private class DeployUIAdditions {
- private IJBossServerPublishMethodType publishType;
+ private String behaviourName;
+ private String behaviourId;
+
private IDeploymentTypeUI ui;
private boolean registered = false;
- public DeployUIAdditions(IJBossServerPublishMethodType type,IDeploymentTypeUI ui) {
- this.publishType = type;
+
+ public DeployUIAdditions(String name, String id,IDeploymentTypeUI ui) {
+ this.behaviourName = name;
+ this.behaviourId = id;
this.ui = ui;
}
+
public boolean isRegistered() {
return registered;
}
- public IJBossServerPublishMethodType getPublishType() {
- return publishType;
- }
public void createComposite(Composite parent) {
// UI can be null
if( ui != null ) {
@@ -158,10 +166,12 @@
private void loadDeployTypeData() {
deployAdditions = new ArrayList<DeployUIAdditions>();
- IJBossServerPublishMethodType[] publishMethodTypes =
ExtensionManager.getDefault().findPossiblePublishMethods(callback.getServer().getServerType());
- for( int i = 0; i < publishMethodTypes.length; i++) {
- IDeploymentTypeUI ui =
EditorExtensionManager.getDefault().getPublishPreferenceUI(publishMethodTypes[i].getId());
- deployAdditions.add(new DeployUIAdditions(publishMethodTypes[i], ui));
+ Behaviour b =
BehaviourModel.getModel().getBehaviour(callback.getServer().getServerType().getId());
+ BehaviourImpl[] supportedBehaviours = b.getImplementations();
+ for( int i = 0; i < supportedBehaviours.length; i++) {
+ IDeploymentTypeUI ui =
EditorExtensionManager.getDefault().getPublishPreferenceUI(supportedBehaviours[i].getId());
+ deployAdditions.add(new DeployUIAdditions(supportedBehaviours[i].getName(),
+ supportedBehaviours[i].getId(), ui));
}
}
@@ -177,10 +187,10 @@
if( fireEvent ) {
callback.execute(new ChangeServerPropertyCommand(
callback.getServer(), IDeployableServer.SERVER_MODE,
- ui.getPublishType().getId(), "Change server mode"));
+ ui.behaviourId, "Change server mode"));
String deployType = null;
if( shouldChangeDefaultDeployType(callback.getServer())) {
- if( ui.getPublishType().getId().equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD)) {
+ if( ui.behaviourId.equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD)) {
deployType = IDeployableServer.DEPLOY_METADATA;
} else {
deployType = IDeployableServer.DEPLOY_SERVER;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.properties
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.properties 2011-10-05 11:46:11 UTC
(rev 35363)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.properties 2011-10-05 11:53:53 UTC
(rev 35364)
@@ -1,3 +1,10 @@
#Properties file for org.jboss.ide.eclipse.as.test
Bundle-Vendor.0 = JBoss by Red Hat
-Bundle-Name.0 = AS Adapter Test Plug-in
\ No newline at end of file
+Bundle-Name.0 = AS Adapter Test Plug-in
+
+AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50,org.jboss.ide.eclipse.as.runtime.eap.60
+AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,
+AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,org.jboss.ide.eclipse.as.systemCopyServer
+ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
+ServerTypesJBoss6OrLower=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
+ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
\ No newline at end of file
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.xml 2011-10-05 11:46:11 UTC (rev
35363)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/plugin.xml 2011-10-05 11:53:53 UTC (rev
35364)
@@ -2,13 +2,36 @@
<?eclipse version="3.4"?>
<plugin>
<extension
- point="org.jboss.ide.eclipse.as.core.publishMethod">
- <publishMethod
-
class="org.jboss.ide.eclipse.as.test.publishing.v2.MockPublishMethod"
- id="mock"
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+
behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate"
+
launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate"
name="mock"
- serverTypes="org.jboss.ide.eclipse.as.systemCopyServer">
- </publishMethod>
+
publishMethod="org.jboss.ide.eclipse.as.test.publishing.v2.MockPublishMethod"
+ serverTypes="org.jboss.ide.eclipse.as.systemCopyServer"
+ typeId="mock">
+ </behaviour>
</extension>
-
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+
behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate"
+
launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate"
+ name="mock"
+
publishMethod="org.jboss.ide.eclipse.as.test.publishing.v2.MockPublishMethod"
+ serverTypes="%ServerTypesJBoss6OrLower"
+ typeId="mock">
+ </behaviour>
+ </extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.core.behaviourExtension">
+ <behaviour
+
behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7BehaviorDelegate"
+
launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7StartLaunchDelegate"
+ name="mock"
+
publishMethod="org.jboss.ide.eclipse.as.test.publishing.v2.MockPublishMethod"
+ serverTypes="%ServerTypesJBoss7"
+ typeId="mock">
+ </behaviour>
+ </extension>
</plugin>
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java 2011-10-05
11:46:11 UTC (rev 35363)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java 2011-10-05
11:53:53 UTC (rev 35364)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.ServerPreferences;
import org.jboss.ide.eclipse.as.test.util.IOUtil;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
@@ -41,7 +42,7 @@
}
protected void theTest(boolean isAs7) throws CoreException, IOException {
-
+ ServerPreferences.getInstance().setAutoPublishing(false);
IModule mod = ServerUtil.getModule(project);
server = ServerRuntimeUtils.addModule(server, mod);
ServerRuntimeUtils.publish(server);