Author: rob.stryker(a)jboss.com
Date: 2012-03-01 03:19:17 -0500 (Thu, 01 Mar 2012)
New Revision: 39219
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS710ExtendedProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
Log:
JBIDE-11116 to trunk
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java 2012-03-01
08:14:15 UTC (rev 39218)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java 2012-03-01
08:19:17 UTC (rev 39219)
@@ -11,13 +11,14 @@
package org.jboss.ide.eclipse.as.core.server.internal;
import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import
org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossAS710ExtendedProperties;
import
org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossAS7ExtendedProperties;
import
org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossExtendedProperties;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-public class ExtendedServerPropertiesAdapterFactory implements IAdapterFactory {
+public class ExtendedServerPropertiesAdapterFactory implements IAdapterFactory,
IJBossToolingConstants {
public static JBossExtendedProperties getExtendedProperties(IServer server) {
return (JBossExtendedProperties) new
ExtendedServerPropertiesAdapterFactory().getAdapter(server,
JBossExtendedProperties.class);
@@ -25,31 +26,42 @@
@Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
- if( adaptableObject instanceof IServer && adapterType ==
JBossExtendedProperties.class) {
- String typeId = ((IServer)adaptableObject).getServerType().getId();
- if( IJBossToolingConstants.SERVER_AS_32.equals(typeId))
- return new JBossExtendedProperties((IServer)adaptableObject);
- if( IJBossToolingConstants.SERVER_AS_40.equals(typeId))
- return new JBossExtendedProperties((IServer)adaptableObject);
- if( IJBossToolingConstants.SERVER_AS_42.equals(typeId))
- return new JBossExtendedProperties((IServer)adaptableObject);
- if( IJBossToolingConstants.SERVER_AS_50.equals(typeId))
- return new JBossExtendedProperties((IServer)adaptableObject);
- if( IJBossToolingConstants.SERVER_AS_51.equals(typeId))
- return new JBossExtendedProperties((IServer)adaptableObject);
- if( IJBossToolingConstants.SERVER_AS_60.equals(typeId))
- return new JBossExtendedProperties((IServer)adaptableObject);
- if( IJBossToolingConstants.SERVER_EAP_43.equals(typeId))
- return new JBossExtendedProperties((IServer)adaptableObject);
- if( IJBossToolingConstants.SERVER_EAP_50.equals(typeId))
- return new JBossExtendedProperties((IServer)adaptableObject);
+ if( adapterType != JBossExtendedProperties.class )
+ return null;
+ String typeId = null;
+ IServer s = null;
+ IRuntime r = null;
+ if( adaptableObject instanceof IServer ) {
+ typeId = ((IServer)adaptableObject).getServerType().getId();
+ s = (IServer)adaptableObject;
+ } else if( adaptableObject instanceof IRuntime ) {
+ typeId = ((IRuntime)adaptableObject).getRuntimeType().getId();
+ r = (IRuntime)adaptableObject;
+ }
+ if( typeId != null ) {
+ if( SERVER_AS_32.equals(typeId) || AS_32.equals(typeId))
+ return new JBossExtendedProperties(s == null ? r : s);
+ if( SERVER_AS_40.equals(typeId) || AS_40.equals(typeId))
+ return new JBossExtendedProperties(s == null ? r : s);
+ if( SERVER_AS_42.equals(typeId) || AS_42.equals(typeId))
+ return new JBossExtendedProperties(s == null ? r : s);
+ if( SERVER_AS_50.equals(typeId) || AS_50.equals(typeId))
+ return new JBossExtendedProperties(s == null ? r : s);
+ if( SERVER_AS_51.equals(typeId) || AS_51.equals(typeId))
+ return new JBossExtendedProperties(s == null ? r : s);
+ if( SERVER_AS_60.equals(typeId) || AS_60.equals(typeId))
+ return new JBossExtendedProperties(s == null ? r : s);
+ if( SERVER_EAP_43.equals(typeId) || EAP_43.equals(typeId))
+ return new JBossExtendedProperties(s == null ? r : s);
+ if( SERVER_EAP_50.equals(typeId) || EAP_50.equals(typeId))
+ return new JBossExtendedProperties(s == null ? r : s);
- if( IJBossToolingConstants.SERVER_AS_70.equals(typeId))
- return new JBossAS7ExtendedProperties((IServer)adaptableObject);
- if( IJBossToolingConstants.SERVER_AS_71.equals(typeId))
- return new JBossAS710ExtendedProperties((IServer)adaptableObject);
- if( IJBossToolingConstants.SERVER_EAP_60.equals(typeId))
- return new JBossAS710ExtendedProperties((IServer)adaptableObject);
+ if( SERVER_AS_70.equals(typeId) || AS_70.equals(typeId))
+ return new JBossAS7ExtendedProperties(s == null ? r : s);
+ if( SERVER_AS_71.equals(typeId) || AS_71.equals(typeId))
+ return new JBossAS710ExtendedProperties(s == null ? r : s);
+ if( SERVER_EAP_60.equals(typeId) || EAP_60.equals(typeId))
+ return new JBossAS710ExtendedProperties(s == null ? r : s);
// NEW_SERVER_ADAPTER
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS710ExtendedProperties.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS710ExtendedProperties.java 2012-03-01
08:14:15 UTC (rev 39218)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS710ExtendedProperties.java 2012-03-01
08:19:17 UTC (rev 39219)
@@ -10,15 +10,15 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.extendedproperties;
-import org.eclipse.wst.server.core.IServer;
+import org.eclipse.core.runtime.IAdaptable;
/**
*
*/
public class JBossAS710ExtendedProperties extends JBossAS7ExtendedProperties {
- public JBossAS710ExtendedProperties(IServer server) {
- super(server);
+ public JBossAS710ExtendedProperties(IAdaptable obj) {
+ super(obj);
}
public int getJMXProviderType() {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java 2012-03-01
08:14:15 UTC (rev 39218)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java 2012-03-01
08:19:17 UTC (rev 39219)
@@ -10,14 +10,14 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.extendedproperties;
-import org.eclipse.wst.server.core.IServer;
+import org.eclipse.core.runtime.IAdaptable;
/**
*
*/
public class JBossAS7ExtendedProperties extends JBossExtendedProperties {
- public JBossAS7ExtendedProperties(IServer server) {
- super(server);
+ public JBossAS7ExtendedProperties(IAdaptable obj) {
+ super(obj);
}
public String getNewFilesetDefaultRootFolder() {
@@ -28,4 +28,11 @@
return JMX_DEFAULT_PROVIDER;
}
+ public boolean runtimeSupportsBindingToAllInterfaces() {
+ String version = getServerBeanLoader().getFullServerVersion();
+ if( version.startsWith("7.0.1") || version.startsWith("7.0.0"))
//$NON-NLS-1$//$NON-NLS-2$
+ return false;
+ return true;
+ }
+
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java 2012-03-01
08:14:15 UTC (rev 39218)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java 2012-03-01
08:19:17 UTC (rev 39219)
@@ -1,7 +1,10 @@
package org.jboss.ide.eclipse.as.core.server.internal.extendedproperties;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.resolvers.ConfigNameResolver;
+import org.jboss.ide.eclipse.as.core.server.bean.ServerBeanLoader;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
/**
@@ -12,9 +15,16 @@
*/
public class JBossExtendedProperties {
private IServer server;
- public JBossExtendedProperties(IServer server) {
- this.server = server;
+ private IRuntime runtime;
+ public JBossExtendedProperties(IAdaptable adaptable) {
+ if( adaptable instanceof IServer) {
+ this.server = (IServer)adaptable;
+ this.runtime = server.getRuntime();
+ } else if( adaptable instanceof IRuntime){
+ this.runtime = (IRuntime)adaptable;
+ }
}
+
public String getNewFilesetDefaultRootFolder() {
return "servers/${jboss_config}"; //$NON-NLS-1$
}
@@ -36,4 +46,13 @@
public int getJMXProviderType() {
return JMX_AS_3_TO_6_PROVIDER;
}
+
+
+ public boolean runtimeSupportsBindingToAllInterfaces() {
+ return true;
+ }
+
+ protected ServerBeanLoader getServerBeanLoader() {
+ return new ServerBeanLoader(runtime.getLocation().toFile());
+ }
}
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 2012-03-01
08:14:15 UTC (rev 39218)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2012-03-01
08:19:17 UTC (rev 39219)
@@ -12,6 +12,7 @@
import java.util.ArrayList;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -26,6 +27,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledPageBook;
+import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.util.SocketUtil;
import org.eclipse.wst.server.ui.internal.command.ServerCommand;
@@ -35,6 +37,7 @@
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.server.internal.extendedproperties.JBossExtendedProperties;
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;
@@ -164,7 +167,11 @@
return true;
}
protected boolean showListenOnAllHostsCheckbox() {
- return true;
+ IServer server = callback.getServer().getOriginal();
+ JBossExtendedProperties props = (JBossExtendedProperties)server
+ .loadAdapter(JBossExtendedProperties.class,
+ new NullProgressMonitor());
+ return props == null ? false : props.runtimeSupportsBindingToAllInterfaces();
}
protected void executeShellToggled() {
Show replies by date