Author: rob.stryker(a)jboss.com
Date: 2009-04-24 05:14:47 -0400 (Fri, 24 Apr 2009)
New Revision: 14882
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IWTPConstants.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/org.eclipse.jdt.core.prefs
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/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/AntFileFilter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java
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/XPathQuery.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IServerLogListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLog.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnection.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXSafeRunner.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableAdapter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollerFailureHandler.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.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/JBossServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DeployableLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ModulePackager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ServerSourcePathComputerDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/FileUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBossServerType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerBeanLoader.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerConverter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
Log:
i18n and headers
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathConstants.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathConstants.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathConstants.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -10,72 +10,9 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.classpath.core;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
-public interface ClasspathConstants {
+
+public interface ClasspathConstants extends IJBossServerConstants {
- /* Server runtime types */
- public static final String AS_32 = "org.jboss.ide.eclipse.as.runtime.32";
//$NON-NLS-1$
- public static final String AS_40 = "org.jboss.ide.eclipse.as.runtime.40";
//$NON-NLS-1$
- public static final String AS_42 = "org.jboss.ide.eclipse.as.runtime.42";
//$NON-NLS-1$
- public static final String AS_50 = "org.jboss.ide.eclipse.as.runtime.50";
//$NON-NLS-1$
- public static final String EAP_43 = "org.jboss.ide.eclipse.as.runtime.eap.43";
//$NON-NLS-1$
-
- /* Version Strings */
- public static final String V3_0 = "3.0"; //$NON-NLS-1$
- public static final String V3_2 = "3.2"; //$NON-NLS-1$
- public static final String V4_0 = "4.0"; //$NON-NLS-1$
- public static final String V4_2 = "4.2"; //$NON-NLS-1$
- public static final String V5_0 = "5.0"; //$NON-NLS-1$
-
-
- /* Files and folders that must be added to CP */
- public static final String SERVER = "server"; //$NON-NLS-1$
- public static final String CLIENT = "client"; //$NON-NLS-1$
- public static final String LIB = "lib"; //$NON-NLS-1$
- public static final String DEPLOY = "deploy"; //$NON-NLS-1$
- public static final String COMMON = "common"; //$NON-NLS-1$
- public static final String DEPLOYERS = "deployers"; //$NON-NLS-1$
-
- public static final String JSF_LIB = "jsf-libs"; //$NON-NLS-1$
- public static final String JBOSSWEB_TOMCAT55_SAR = "jbossweb-tomcat55.sar";
//$NON-NLS-1$
- public static final String JBOSSWEB_SAR = "jbossweb.sar"; //$NON-NLS-1$
- public static final String JBOSS_WEB_SERVICE_JAR = "jboss-web-service.jar";
//$NON-NLS-1$
- public static final String EJB3_DEPLOYER = "ejb3.deployer"; //$NON-NLS-1$
- public static final String WEBBEANS_DEPLOYER = "webbeans.deployer";
//$NON-NLS-1$
- public static final String AS5_AOP_DEPLOYER = "jboss-aop-jboss5.deployer";
//$NON-NLS-1$
- public static final String AOP_JDK5_DEPLOYER = "jboss-aop-jdk50.deployer";
//$NON-NLS-1$
- public static final String JBOSS_AOP_JDK5_JAR = "jboss-aop-jdk50.jar";
//$NON-NLS-1$
- public static final String JBOSS_WEB_DEPLOYER = "jboss-web.deployer";
//$NON-NLS-1$
- public static final String JSP_API_JAR = "jsp-api.jar"; //$NON-NLS-1$
- public static final String SERVLET_API_JAR = "servlet-api.jar"; //$NON-NLS-1$
- public static final String JSF_API_JAR = "jsf-api.jar"; //$NON-NLS-1$
- public static final String JSF_IMPL_JAR = "jsf-impl.jar"; //$NON-NLS-1$
- public static final String JBOSS_J2EE_JAR = "jboss-j2ee.jar"; //$NON-NLS-1$
- public static final String JBOSS_EJB3X_JAR = "jboss-ejb3x.jar"; //$NON-NLS-1$
- public static final String JBOSS_EJB3_JAR = "jboss-ejb3.jar"; //$NON-NLS-1$
- public static final String JBOSS_ANNOTATIONS_EJB3_JAR =
"jboss-annotations-ejb3.jar"; //$NON-NLS-1$
- public static final String EJB3_PERSISTENCE_JAR = "ejb3-persistence.jar";
//$NON-NLS-1$
- public static final String JBOSS_ASPECT_LIBRARY_JDK5_0 =
"jboss-aspect-library-jdk50.jar"; //$NON-NLS-1$
- public static final String HIBERNATE_CLIENT_JAR = "hibernate-client.jar";
//$NON-NLS-1$
- public static final String JBOSSALL_CLIENT_JAR = "jbossall-client.jar";
//$NON-NLS-1$
- public static final String JBOSSWEB_TOMCAT_50_SAR = "jbossweb-tomcat50.sar";
//$NON-NLS-1$
- public static final String JSR299_API_JAR = "jsr299-api.jar"; //$NON-NLS-1$
-
- public static final String JAVAX_SERVLET_JAR = "javax.servlet.jar";
//$NON-NLS-1$
- public static final String JAVAX_SERVLET_JSP_JAR = "javax.servlet.jsp.jar";
//$NON-NLS-1$
-
-
- // etc
- public static final String JAR_EXT = ".jar"; //$NON-NLS-1$
-
- /* Facet Names */
- public static final String FACET_JST_JAVA = "jst.java"; //$NON-NLS-1$
- public static final String FACET_WEB = "jst.web";//$NON-NLS-1$
- public static final String FACET_EJB = "jst.ejb";//$NON-NLS-1$
- public static final String FACET_EAR = "jst.ear";//$NON-NLS-1$
- public static final String FACET_UTILITY = "jst.utility";//$NON-NLS-1$
- public static final String FACET_CONNECTOR = "jst.connector";//$NON-NLS-1$
- public static final String FACET_APP_CLIENT = "jst.appclient";//$NON-NLS-1$
-
-
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -122,7 +122,7 @@
if(f.isDirectory()) {
String[] files = f.list();
for( int i = 0; i < files.length; i++ ) {
- if( files[i].endsWith(JAR_EXT)) {
+ if( files[i].endsWith(EXT_JAR)) {
list.add(getEntry(folder.append(files[i])));
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -161,7 +161,7 @@
String[] files = folder.toFile().list();
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
for( int i = 0; i < files.length; i++ ) {
- if( files[i].endsWith(JAR_EXT)) {
+ if( files[i].endsWith(EXT_JAR)) {
list.add(getEntry(folder.append(files[i])));
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/org.eclipse.jdt.core.prefs 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/org.eclipse.jdt.core.prefs 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,7 +1,74 @@
-#Tue Aug 07 15:28:54 EDT 2007
+#Fri Apr 24 04:19:52 CST 2009
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
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 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import java.util.ArrayList;
@@ -68,9 +57,9 @@
public void loadPollers() {
pollers = new HashMap<String, ServerStatePollerType>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf =
registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID,
"pollers");
+ IConfigurationElement[] cf =
registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID,
"pollers"); //$NON-NLS-1$
for( int i = 0; i < cf.length; i++ ) {
- pollers.put(cf[i].getAttribute("id"), new ServerStatePollerType(cf[i]));
+ pollers.put(cf[i].getAttribute("id"), new ServerStatePollerType(cf[i]));
//$NON-NLS-1$
}
}
@@ -120,11 +109,11 @@
public void loadFailureHandler() {
pollerFailureHandlers = new HashMap<String, IPollerFailureHandler>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf =
registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID,
"pollerFailureHandler");
+ IConfigurationElement[] cf =
registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID,
"pollerFailureHandler"); //$NON-NLS-1$
for( int i = 0; i < cf.length; i++ ) {
try {
- pollerFailureHandlers.put(cf[i].getAttribute("id"),
- (IPollerFailureHandler)cf[i].createExecutableExtension("class"));
+ pollerFailureHandlers.put(cf[i].getAttribute("id"), //$NON-NLS-1$
+ (IPollerFailureHandler)cf[i].createExecutableExtension("class"));
//$NON-NLS-1$
} catch( CoreException e ) {
// TODO ERROR LOG
} catch( ClassCastException cce ) {
@@ -140,7 +129,7 @@
return c.toArray(new IPollerFailureHandler[c.size()]);
}
- public IPollerFailureHandler getFirstPollFailureHandler(IServerStatePoller poller,
String action, List requiredProperties) {
+ public IPollerFailureHandler getFirstPollFailureHandler(IServerStatePoller poller,
String action, List<String> requiredProperties) {
IPollerFailureHandler[] handlers = getPollerFailureHandlers();
for( int i = 0; i < handlers.length; i++ ) {
if( handlers[i].accepts(poller, action, requiredProperties)) {
@@ -154,10 +143,10 @@
public IJBossServerPublisher getPublisher(IServer server, IModule[] module) {
if( publishers == null )
loadPublishers();
- Iterator i = publishers.iterator();
+ Iterator<PublisherWrapper> i = publishers.iterator();
PublisherWrapper wrapper;
while(i.hasNext()) {
- wrapper = (PublisherWrapper)i.next();
+ wrapper = i.next();
if( wrapper.publisher.accepts(server, module))
return wrapper.getNewInstance();
}
@@ -180,12 +169,12 @@
private void loadPublishers() {
ArrayList<PublisherWrapper> publishers = new
ArrayList<PublisherWrapper>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf =
registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID,
"publishers");
+ IConfigurationElement[] cf =
registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID,
"publishers"); //$NON-NLS-1$
for( int i = 0; i < cf.length; i++ ) {
try {
- Object clazz = cf[i].createExecutableExtension("class");
- String priority = cf[i].getAttribute("priority");
- String zipDelegate = cf[i].getAttribute("zipDelegate");
+ Object clazz = cf[i].createExecutableExtension("class"); //$NON-NLS-1$
+ String priority = cf[i].getAttribute("priority"); //$NON-NLS-1$
+ String zipDelegate = cf[i].getAttribute("zipDelegate"); //$NON-NLS-1$
int p = -1;
try {
p = Integer.parseInt(priority);
@@ -217,7 +206,7 @@
}
private IJBossServerPublisher getNewInstance() {
try {
- Object clazz = element.createExecutableExtension("class");
+ Object clazz = element.createExecutableExtension("class"); //$NON-NLS-1$
return (IJBossServerPublisher)clazz;
} catch( CoreException ce ) {
}
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 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,27 +1,15 @@
-/*
- * 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.
- */
+/*******************************************************************************
+ * 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;
-import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.core.runtime.IExtension;
@@ -34,6 +22,7 @@
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.ServerListener;
+import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.osgi.framework.BundleContext;
/**
@@ -42,9 +31,7 @@
public class JBossServerCorePlugin extends Plugin {
//The shared instance.
private static JBossServerCorePlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
- public static final String PLUGIN_ID = "org.jboss.ide.eclipse.as.core";
+ public static final String PLUGIN_ID = "org.jboss.ide.eclipse.as.core";
//$NON-NLS-1$
/**
* The constructor.
@@ -52,15 +39,9 @@
public JBossServerCorePlugin() {
super();
plugin = this;
- try {
- resourceBundle =
ResourceBundle.getBundle("org.jboss.ide.eclipse.as.core.ServerCorePluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
}
- public IExtension[] getExtensions (String extensionPoint)
- {
+ public IExtension[] getExtensions (String extensionPoint) {
IExtensionRegistry reg = Platform.getExtensionRegistry();
IExtensionPoint ep = reg.getExtensionPoint(extensionPoint);
IExtension[] extensions = ep.getExtensions();
@@ -86,6 +67,7 @@
public void stop(BundleContext context) throws Exception {
super.stop(context);
UnitedServerListenerManager.getDefault().removeListener(ServerListener.getDefault());
+ UnitedServerListenerManager.getDefault().removeListener(XPathModel.getDefault());
}
/**
@@ -95,22 +77,12 @@
return plugin;
}
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
public static IPath getServerStateLocation(IServer server) {
- return server == null ? getDefault().getStateLocation() :
- getServerStateLocation(server.getId());
+ return ServerUtil.getServerStateLocation(server);
}
public static IPath getServerStateLocation(String serverID) {
- return serverID == null ? getDefault().getStateLocation() :
- JBossServerCorePlugin.getDefault().getStateLocation()
- .append(serverID.replace(' ', '_'));
+ return ServerUtil.getServerStateLocation(serverID);
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,36 +1,81 @@
-/*
- * 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.
- */
+/*******************************************************************************
+ * 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;
import org.eclipse.osgi.util.NLS;
public class Messages {
private static final String BUNDLE_NAME =
"org.jboss.ide.eclipse.as.core.Messages"; //$NON-NLS-1$
+
/* Standard and re-usable */
public static String jboss;
public static String server;
public static String runtime;
public static String runModeNotSupported;
+ public static String loadXMLDocumentFailed;
+ public static String saveXMLDocumentFailed;
+ public static String loadJMXClassesFailed;
+ public static String securityException;
+ public static String JMXPoller;
+ public static String XPathLoadFailure;
+
+ public static String STOP_FAILED_MESSAGE;
+ public static String FORCE_TERMINATED;
+ public static String TERMINATED;
+ public static String FORCE_TERMINATE_FAILED;
+
+ public static String ServerStarting;
+ public static String NotSupported;
+ public static String UndeploySingleFilesJob;
+ public static String SingleFileUndeployFailed;
+ public static String SingleFileUndeployFailed2;
+ public static String ServerSaveFailed;
+ public static String LaunchConfigJREError;
+ public static String UnexpectedServerStopError;
+ public static String CopyFileError;
+ public static String DeleteFileError;
+ public static String DeleteFolderError;
+ public static String Ports;
+ public static String AddXPathDetailsJob;
+ public static String CouldNotPublishModule;
+ public static String FullPublishFail;
+ public static String IncrementalPublishFail;
+ public static String CountModifiedMembers;
+ public static String DeleteModuleFail;
+ public static String DeleteModuleFail2;
+ public static String ModuleDeleted;
+ public static String ModulePublished;
+ public static String NoPublisherFound;
+ public static String PollingStartupSuccess;
+ public static String PollingShutdownSuccess;
+ public static String PollingStartupFailed;
+ public static String PollingShutdownFailed;
+ public static String PollingStarting;
+ public static String PollingShuttingDown;
+ public static String StartupPollerNotFound;
+ public static String ShutdownPollerNotFound;
+ public static String PollerFailure;
+ public static String PollerAborted;
+ public static String ServerPollerThreadName;
+ public static String ServerTypeDiscovererFail;
+ public static String TerminateTwiddleFailed;
+ public static String CannotSetUpImproperServer;
+ public static String CannotLocateServerHome;
+ public static String ServerRuntimeNotFound;
+ public static String ServerRuntimeConfigNotFound;
+ public static String ServerNotFound;
+ public static String CannotLoadServerPoller;
+ public static String AddingJMXDeploymentFailed;
+ public static String CannotSaveServersStartArgs;
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,4 +1,58 @@
jboss=JBoss
server=Server
runtime=Runtime
-runModeNotSupported=Selected VM does not support this mode
\ No newline at end of file
+securityException=Security Exception: {0}
+JMXPoller=JMX Poller
+loadJMXClassesFailed=Could not load JMX classes for server {0}
+PollingStartupSuccess=Server Startup Succeeded
+PollingShutdownSuccess=Server Shutdown Succeeded
+PollingStartupFailed=Server Startup Failed
+PollingShutdownFailed=Server Shutdown Failed
+StartupPollerNotFound=Startup Poller not found: {0}
+ShutdownPollerNotFound=Shutdown Poller not found: {0}
+PollingStarting=Server Starting
+PollingShuttingDown=Server shutting down
+PollerFailure=Failure in Poll Thread
+PollerAborted=Poll Thread Aborted: {0}
+ServerPollerThreadName=Server Poller
+runModeNotSupported=Selected VM does not support this mode
+loadXMLDocumentFailed=Could not load document: {0}
+saveXMLDocumentFailed=Could not save document: {0}
+XPathLoadFailure=Error loading default xpaths
+STOP_FAILED_MESSAGE=Command to stop server failed. The next attempt will forcefully
terminate the process.
+FORCE_TERMINATED=The server was shutdown forcefully. All processes were terminated.
+TERMINATED=Server processes have been terminated.
+FORCE_TERMINATE_FAILED=Killing the server process has failed. The process may still be
running.
+ServerStarting=Server is starting
+NotSupported=Not Supported
+UndeploySingleFilesJob=Undeploy Single Files From Server
+SingleFileUndeployFailed=Failed to undeploy modules from all servers
+SingleFileUndeployFailed2=Failed to remove {0} from {1}
+ServerSaveFailed=Unexpected Exception while saving server metadata.
+LaunchConfigJREError=Error adding JRE entry to server classpath
+UnexpectedServerStopError=Unexpected exception while launching the stop server command.
+CopyFileError=Error copying file from {0} to {1}
+DeleteFileError=Error deleting file {0}
+DeleteFolderError=Error deleting folder {0}
+Ports=Ports
+AddXPathDetailsJob=Add Server XPath Details
+CouldNotPublishModule=Could not publish module {0}
+
+FullPublishFail=Full publish failed for module {0}
+IncrementalPublishFail=Incremental publish failed for module {0}
+DeleteModuleFail=Unable to delete module {0}
+DeleteModuleFail2=Some files were not removed from the server
+CountModifiedMembers={0} files modified in module {1}
+ModuleDeleted=Module {0} deleted.
+ModulePublished=Module {0} published.
+NoPublisherFound=No publisher found for module {0}
+ServerTypeDiscovererFail=Name '{0}' cannot be converted to a ServerType
+TerminateTwiddleFailed=Cannot terminate twiddle process
+CannotSetUpImproperServer=Cannot prepare server {0} for launch because it is not a proper
JBoss Server
+CannotLocateServerHome= Server {0} is corrupt and the server home is unable to be
located.
+ServerRuntimeNotFound=Runtime for server {0} cannot be found.
+ServerRuntimeConfigNotFound=Configuration for runtime {0} is not set.
+ServerNotFound=Server {0} not found.
+CannotLoadServerPoller=Error instantiating Server Poller {0}
+CannotSaveServersStartArgs=Could not save server start arguments for server {0}.
+AddingJMXDeploymentFailed=Error adding deployment folder to deployment scanner
\ No newline at end of file
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/AntFileFilter.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/AntFileFilter.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/AntFileFilter.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.extensions.descriptors;
import org.apache.tools.ant.DirectoryScanner;
@@ -34,10 +23,10 @@
private boolean hasScanned;
private transient DirectoryScanner scanner;
public AntFileFilter(String baseDir, String includes) {
- this.includes = includes == null ? "**/*.xml" : includes;
+ this.includes = includes == null ? "**/*.xml" : includes; //$NON-NLS-1$
this.baseDir = baseDir;
this.scanner = new DirectoryScanner();
- String includesList[] = this.includes.split(" ?, ?");
+ String includesList[] = this.includes.split(" ?, ?"); //$NON-NLS-1$
scanner.setBasedir(baseDir);
scanner.setIncludes(includesList);
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.extensions.descriptors;
import java.io.File;
@@ -20,7 +30,9 @@
import org.dom4j.io.XMLWriter;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.xml.sax.SAXException;
/**
@@ -32,6 +44,8 @@
public class XMLDocumentRepository {
/** singleton instance */
private static XMLDocumentRepository instance = null;
+ private static final String LOAD_EXTERNAL_DTD_KEY =
+ "http://apache.org/xml/features/nonvalidating/load-external-dtd";
//$NON-NLS-1$
/** singleton getter */
public static XMLDocumentRepository getDefault() {
@@ -41,10 +55,10 @@
}
/** maps a path to its actual document object */
- private HashMap pathToDocument;
+ private HashMap<String, Document> pathToDocument;
/** maps a path to the last time that path's file was changed */
- private HashMap pathToTimestamp;
+ private HashMap<String, Long> pathToTimestamp;
/** a link to a parent repository which may already contain the document
* and may prevent a costly reparse. */
@@ -52,16 +66,16 @@
/** package-private constructor */
XMLDocumentRepository() {
- pathToDocument = new HashMap();
- pathToTimestamp = new HashMap();
+ pathToDocument = new HashMap<String, Document>();
+ pathToTimestamp = new HashMap<String, Long>();
}
/** public constructor with a parent repository
* @param parent The parent repository
*/
public XMLDocumentRepository(XMLDocumentRepository parent) {
- pathToDocument = new HashMap();
- pathToTimestamp = new HashMap();
+ pathToDocument = new HashMap<String, Document>();
+ pathToTimestamp = new HashMap<String, Long>();
this.parent = parent;
}
@@ -92,7 +106,9 @@
* @return the document
*/
public Document getDocument(String fullPath, boolean load, boolean save) {
- Document d = (Document) pathToDocument.get(fullPath);
+ Document d = pathToDocument.get(fullPath);
+ if( d == null && parent != null)
+ d = parent.getDocument(fullPath, false, save);
if (d == null && load) {
d = loadDocument(fullPath);
if (save) {
@@ -111,8 +127,8 @@
*/
public boolean refresh(String fullPath) {
boolean found = pathToTimestamp.get(fullPath) != null;
- if (!found || new File(fullPath).lastModified() != ((Long) pathToTimestamp
- .get(fullPath)).longValue()) {
+ if (!found || new File(fullPath).lastModified() != pathToTimestamp
+ .get(fullPath).longValue()) {
pathToDocument.put(fullPath, loadDocument(fullPath));
pathToTimestamp.put(fullPath, new Long(new File(fullPath)
.lastModified()));
@@ -133,11 +149,9 @@
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
- sp
- .getXMLReader()
- .setFeature(
- "http://apache.org/xml/features/nonvalidating/load-external-dtd",
- false);
+ sp.getXMLReader().setFeature(
+ LOAD_EXTERNAL_DTD_KEY,
+ false);
SAXReader reader = new SAXReader(false);
reader.setXMLReader(sp.getXMLReader());
@@ -156,7 +170,7 @@
if (ex != null) {
JBossServerCorePlugin.getDefault().getLog().log(
new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- "Could not load document: " + fullpath, ex));
+ NLS.bind(Messages.loadXMLDocumentFailed,fullpath), ex));
}
return null;
}
@@ -186,7 +200,7 @@
if (ex != null) {
JBossServerCorePlugin.getDefault().getLog().log(
new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- "Could not save document: " + fullPath, ex));
+ NLS.bind(Messages.saveXMLDocumentFailed ,fullPath), ex));
}
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.extensions.descriptors;
import java.util.ArrayList;
@@ -37,11 +26,11 @@
*
*/
public class XPathCategory {
- @Deprecated private static final String DELIMITER = ",";
+ @Deprecated private static final String DELIMITER = ","; //$NON-NLS-1$
@Deprecated private static final String QUERY_LIST =
- "org.jboss.ide.eclipse.as.core.model.descriptor.QueryList";
+ "org.jboss.ide.eclipse.as.core.model.descriptor.QueryList"; //$NON-NLS-1$
@Deprecated private static final String QUERY =
- "org.jboss.ide.eclipse.as.core.model.descriptor.Query";
+ "org.jboss.ide.eclipse.as.core.model.descriptor.Query"; //$NON-NLS-1$
protected String name; // cannot include delimiter from the model, comma
@@ -62,14 +51,14 @@
private static XPathQuery[] loadQueries_LEGACY(XPathCategory category, IServer server)
{
ServerAttributeHelper helper = ServerAttributeHelper.createHelper(server);
- String list = helper.getAttribute(QUERY_LIST + "." +
category.getName().replace(' ', '_'), (String)null);
+ String list = helper.getAttribute(QUERY_LIST + '.' +
category.getName().replace(' ', '_'), (String)null);
if( list == null )
return new XPathQuery[] {};
String[] queriesByName = list.split(DELIMITER);
List<String> queryAsStringValues;
ArrayList<XPathQuery> returnList = new ArrayList<XPathQuery>();
for( int i = 0; i < queriesByName.length; i++ ) {
- queryAsStringValues = helper.getAttribute(QUERY + "." +
queriesByName[i].replace(' ', '_'), (List)null);
+ queryAsStringValues = helper.getAttribute(QUERY + '.' +
queriesByName[i].replace(' ', '_'), (List)null);
if( queryAsStringValues != null ) {
XPathQuery q =new
XPathQuery(queriesByName[i].substring(queriesByName[i].indexOf(Path.SEPARATOR)+1),
queryAsStringValues);
q.setCategory(category);
@@ -81,11 +70,11 @@
public XPathCategory(IServer server, IMemento memento) {
this.server = server;
- this.name = memento.getString("name");
- IMemento[] queryMementos = memento.getChildren("query");
+ this.name = memento.getString("name"); //$NON-NLS-1$
+ IMemento[] queryMementos = memento.getChildren("query");//$NON-NLS-1$
children = new HashMap<String, XPathQuery>();
for( int i = 0; i < queryMementos.length; i++ ) {
- String name = queryMementos[i].getString("name");
+ String name = queryMementos[i].getString("name");//$NON-NLS-1$
XPathQuery child = new XPathQuery(queryMementos[i]);
children.put(name, child);
child.setCategory(this);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.extensions.descriptors;
import java.util.ArrayList;
@@ -88,7 +77,7 @@
this.node = node;
this.attribute = attribute;
this.index = index;
- this.hasAttribute = attribute == null || attribute.equals("") ? false :
true;
+ this.hasAttribute = attribute == null || attribute.equals("") ? false :
true;//$NON-NLS-1$
this.file = file;
}
@@ -112,7 +101,7 @@
if( node instanceof DefaultElement ) {
return ((DefaultElement)node).attributeValue(attribute);
}
- return "";
+ return "";//$NON-NLS-1$
}
public Document getDocument() {
@@ -134,7 +123,7 @@
}
} catch( NullPointerException npe ) {
}
- return "";
+ return "";//$NON-NLS-1$
}
public void setText(String newValue) {
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 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.extensions.descriptors;
import java.io.File;
@@ -41,11 +30,14 @@
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.tools.jmx.core.IMemento;
import org.jboss.tools.jmx.core.util.XMLMemento;
@@ -57,13 +49,12 @@
*/
public class XPathModel extends UnitedServerListener {
- public static final String EMPTY_STRING =
"org.jboss.ide.eclipse.as.core.model.descriptor.EmptyString";
- public static final String PORTS_CATEGORY_NAME = "Ports";
- private static final String DELIMITER = ",";
+ public static final String EMPTY_STRING =
"org.jboss.ide.eclipse.as.core.model.descriptor.EmptyString"; //$NON-NLS-1$
+ public static final String PORTS_CATEGORY_NAME = Messages.Ports;
+ private static final String DELIMITER = ","; //$NON-NLS-1$
private static final String CATEGORY_LIST =
- "org.jboss.ide.eclipse.as.core.model.descriptor.Categories";
+ "org.jboss.ide.eclipse.as.core.model.descriptor.Categories"; //$NON-NLS-1$
private static final IPath STATE_LOCATION =
JBossServerCorePlugin.getDefault().getStateLocation();
- private static final String XPATH_FILE_NAME = "xpaths.xml";
/* Singleton */
private static XPathModel instance;
@@ -81,7 +72,7 @@
public void serverAdded(IServer server) {
final IServer server2 = server;
- new Job("Add Server XPath Details") {
+ new Job(Messages.AddXPathDetailsJob) {
protected IStatus run(IProgressMonitor monitor) {
if(server2==null || server2.getRuntime()==null) {
@@ -169,16 +160,16 @@
* Loading and saving is below
*/
protected File getFile(IServer server) {
- return STATE_LOCATION.append(server.getId().replace(' ',
'_')).append(XPATH_FILE_NAME).toFile();
+ return STATE_LOCATION.append(server.getId().replace(' ',
'_')).append(IJBossToolingConstants.XPATH_FILE_NAME).toFile();
}
public void save(IServer server) {
if( !serverToCategories.containsKey(server.getId()))
return;
- XMLMemento memento = XMLMemento.createWriteRoot("xpaths");
+ XMLMemento memento = XMLMemento.createWriteRoot("xpaths"); //$NON-NLS-1$
XPathCategory[] categories = getCategories(server);
for( int i = 0; i < categories.length; i++ ) {
- XMLMemento child = (XMLMemento)memento.createChild("category");
+ XMLMemento child =
(XMLMemento)memento.createChild("category");//$NON-NLS-1$
saveCategory(categories[i], server, child);
}
try {
@@ -189,11 +180,11 @@
}
public void saveCategory(XPathCategory category, IServer server, XMLMemento memento) {
- memento.putString("name", category.getName());
+ memento.putString("name", category.getName());//$NON-NLS-1$
if( category.queriesLoaded()) {
XPathQuery[] queries = category.getQueries();
for( int i = 0; i < queries.length; i++ ) {
- XMLMemento child = (XMLMemento)memento.createChild("query");
+ XMLMemento child = (XMLMemento)memento.createChild("query");//$NON-NLS-1$
saveQuery(queries[i], category, server, child);
}
}
@@ -201,11 +192,11 @@
private void saveQuery(XPathQuery query, XPathCategory category,
IServer server, XMLMemento memento) {
- memento.putString("name", query.getName());
- memento.putString("dir", query.getBaseDir());
- memento.putString("filePattern", query.getFilePattern());
- memento.putString("xpathPattern", query.getXpathPattern());
- memento.putString("attribute", query.getAttribute());
+ memento.putString("name", query.getName());//$NON-NLS-1$
+ memento.putString("dir", query.getBaseDir());//$NON-NLS-1$
+ memento.putString("filePattern", query.getFilePattern());//$NON-NLS-1$
+ memento.putString("xpathPattern", query.getXpathPattern());//$NON-NLS-1$
+ memento.putString("attribute", query.getAttribute());//$NON-NLS-1$
}
private XPathCategory[] load(IServer server) {
@@ -219,7 +210,7 @@
try {
File file = getFile(server);
XMLMemento memento = XMLMemento.createReadRoot(new FileInputStream(file));
- IMemento[] categoryMementos = memento.getChildren("category");
+ IMemento[] categoryMementos = memento.getChildren("category");//$NON-NLS-1$
categories = new XPathCategory[categoryMementos.length];
for( int i = 0; i < categoryMementos.length; i++ ) {
categories[i] = new XPathCategory(server, categoryMementos[i]);
@@ -249,15 +240,16 @@
* returns the category created
*/
private static HashMap<String, IPath> rtToPortsFile;
- private static final String ATTRIBUTE_SUFFIX = "_ATTRIBUTE";
- private static final String FILE_SUFFIX = "_FILE";
+ private static final String ATTRIBUTE_SUFFIX = "_ATTRIBUTE";//$NON-NLS-1$
+ private static final String FILE_SUFFIX = "_FILE";//$NON-NLS-1$
static {
+ IPath properties = new Path(IJBossToolingConstants.PROPERTIES);
rtToPortsFile = new HashMap<String, IPath>();
- rtToPortsFile.put("org.jboss.ide.eclipse.as.runtime.32", new
Path("properties").append("jboss.32.default.ports.properties"));
- rtToPortsFile.put("org.jboss.ide.eclipse.as.runtime.40", new
Path("properties").append("jboss.40.default.ports.properties"));
- rtToPortsFile.put("org.jboss.ide.eclipse.as.runtime.42", new
Path("properties").append("jboss.42.default.ports.properties"));
- rtToPortsFile.put("org.jboss.ide.eclipse.as.runtime.50", new
Path("properties").append("jboss.50.default.ports.properties"));
- rtToPortsFile.put("org.jboss.ide.eclipse.as.runtime.eap.43", new
Path("properties").append("jboss.eap.43.default.ports.properties"));
+ rtToPortsFile.put(IConstants.AS_32,
properties.append(IJBossToolingConstants.DEFAULT_PROPS_32));
+ rtToPortsFile.put(IConstants.AS_40,
properties.append(IJBossToolingConstants.DEFAULT_PROPS_40));
+ rtToPortsFile.put(IConstants.AS_42,
properties.append(IJBossToolingConstants.DEFAULT_PROPS_42));
+ rtToPortsFile.put(IConstants.AS_50,
properties.append(IJBossToolingConstants.DEFAULT_PROPS_50));
+ rtToPortsFile.put(IConstants.EAP_43,
properties.append(IJBossToolingConstants.DEFAULT_PROPS_EAP_43));
}
private static ArrayList<XPathCategory> loadDefaults(IServer server, String
configFolder) {
@@ -288,7 +280,7 @@
} catch (IOException e) {
JBossServerCorePlugin.getDefault().getLog().log(
new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- "Error loading default xpaths", e));
+ Messages.XPathLoadFailure, e));
}
return retVal;
}
@@ -306,7 +298,7 @@
protected void loadNamespaceMap() {
// TODO load from preferenes.
//If nothing's there, load from default
- IPath p = new
Path("properties").append("namespaceMap.properties");
+ IPath p = new
Path("properties").append("namespaceMap.properties");//$NON-NLS-1$//$NON-NLS-2$
if( p != null ) {
URL url = FileLocator.find(JBossServerCorePlugin.getDefault().getBundle(), p, null);
if( url != null ) {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.extensions.descriptors;
import java.io.Serializable;
@@ -66,11 +55,11 @@
protected transient XMLDocumentRepository repository = null;
public XPathQuery(IMemento memento) {
- this.name = memento.getString("name");
- this.baseDir = memento.getString("dir");
- this.filePattern = memento.getString("filePattern");
- this.xpathPattern = memento.getString("xpathPattern");
- this.attribute = memento.getString("attribute");
+ this.name = memento.getString("name"); //$NON-NLS-1$
+ this.baseDir = memento.getString("dir"); //$NON-NLS-1$
+ this.filePattern = memento.getString("filePattern"); //$NON-NLS-1$
+ this.xpathPattern = memento.getString("xpathPattern"); //$NON-NLS-1$
+ this.attribute = memento.getString("attribute"); //$NON-NLS-1$
}
public XPathQuery(String name, List list) {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IEventCodes.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.extensions.events;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IServerLogListener.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IServerLogListener.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IServerLogListener.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.extensions.events;
import org.eclipse.core.runtime.IStatus;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLog.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLog.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLog.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.extensions.events;
import java.io.File;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.extensions.events;
import java.io.File;
@@ -29,9 +18,9 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-public class ServerLogger implements IJBossServerConstants {
+public class ServerLogger {
private static ServerLogger instance;
public static ServerLogger getDefault() {
if( instance == null ) {
@@ -78,7 +67,8 @@
}
public static File getServerLogFile(IServer server) {
- File f = JBossServerCorePlugin.getServerStateLocation(server).append(LOG).toFile();
+ File f = JBossServerCorePlugin.getServerStateLocation(
+ server).append(IJBossToolingConstants.LOG).toFile();
if( !f.getParentFile().exists() )
f.getParentFile().mkdirs();
return f;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnection.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnection.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnection.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.extensions.jmx;
import java.io.IOException;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.extensions.jmx;
import java.util.ArrayList;
@@ -12,6 +22,7 @@
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.Messages;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.tools.jmx.core.ExtensionManager;
import org.jboss.tools.jmx.core.IConnectionProvider;
@@ -169,7 +180,7 @@
@SuppressWarnings(value={"unchecked"})
public IConnectionWrapper createConnection(Map map) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Not Supported", null));
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
Messages.NotSupported, null));
}
public void addConnection(IConnectionWrapper connection) {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.extensions.jmx;
import java.net.MalformedURLException;
@@ -30,9 +19,12 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
/**
* A repository for classloaders that relate to servers,
@@ -117,7 +109,7 @@
try {
IRuntime rt = s.getRuntime();
IPath loc = rt.getLocation();
- URL url = loc.append("client").append("jbossall-client.jar")
+ URL url =
loc.append(IJBossServerConstants.CLIENT).append(IJBossServerConstants.JBOSSALL_CLIENT_JAR)
.toFile().toURI().toURL();
URLClassLoader loader = new URLClassLoader(new URL[] { url, },
Thread.currentThread().getContextClassLoader());
@@ -125,7 +117,7 @@
} catch (MalformedURLException murle) {
JBossServerCorePlugin.getDefault().getLog().log(
new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- "Cannot load JMX classes for server: " + s.getName(), murle));
+ NLS.bind(Messages.loadJMXClassesFailed, s.getName()), murle));
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXSafeRunner.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXSafeRunner.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXSafeRunner.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.extensions.jmx;
import java.util.Properties;
@@ -10,6 +20,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.tools.jmx.core.IJMXRunnable;
import org.jboss.tools.jmx.core.JMXException;
@@ -53,7 +64,7 @@
JMXUtil.setCredentials(s,user,pass);
Properties p = JMXUtil.getDefaultProperties(s);
ic = new InitialContext(p);
- Object obj = ic.lookup("jmx/invoker/RMIAdaptor"); //$NON-NLS-1$
+ Object obj = ic.lookup(IJBossRuntimeConstants.RMIAdaptor);
ic.close();
if (obj instanceof MBeanServerConnection) {
MBeanServerConnection connection = (MBeanServerConnection) obj;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXUtil.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXUtil.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.extensions.jmx;
import java.lang.reflect.Constructor;
@@ -28,6 +17,7 @@
import java.util.Properties;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -58,10 +48,10 @@
// get our methods
Class simplePrincipal = Thread.currentThread()
.getContextClassLoader().loadClass(
- "org.jboss.security.SimplePrincipal");
+ IJBossServerConstants.CLASS_SIMPLE_PRINCIPAL);
Class securityAssoc = Thread.currentThread()
.getContextClassLoader().loadClass(
- "org.jboss.security.SecurityAssociation");
+ IJBossServerConstants.CLASS_SECURITY_ASSOCIATION);
securityAssoc.getMethods(); // force-init the methods since the
// class hasn't been initialized yet.
@@ -71,14 +61,16 @@
.newInstance(new Object[] { principal });
// set the principal
- Method setPrincipalMethod = securityAssoc.getMethod("setPrincipal",
+ Method setPrincipalMethod = securityAssoc.getMethod(
+ IJBossServerConstants.METHOD_SET_PRINCIPAL,
new Class[] { Principal.class });
setPrincipalMethod.invoke(null,
new Object[] { newPrincipalInstance });
// set the credential
Method setCredentialMethod = securityAssoc.getMethod(
- "setCredential", new Class[] { Object.class });
+ IJBossServerConstants.METHOD_SET_CREDENTIAL,
+ new Class[] { Object.class });
setCredentialMethod.invoke(null, new Object[] { credential });
} catch (ClassNotFoundException e) {
temp = e;
@@ -118,13 +110,13 @@
if( jbs != null ) {
int port = jbs.getJNDIPort();
- props.put("java.naming.factory.initial",
- "org.jnp.interfaces.NamingContextFactory");
- props.put("java.naming.factory.url.pkgs",
- "org.jboss.naming:org.jnp.interfaces");
- props.put("java.naming.provider.url", "jnp://" + jbs.getHost() +
":"
- + port);
- props.put("jnp.disableDiscovery", "true");
+ props.put(IJBossServerConstants.NAMING_FACTORY_KEY,
+ IJBossServerConstants.NAMING_FACTORY_VALUE);
+ props.put(IJBossServerConstants.NAMING_FACTORY_PKGS,
+ IJBossServerConstants.NAMING_FACTORY_INTERFACES);
+ props.put(IJBossServerConstants.NAMING_FACTORY_PROVIDER_URL,
+ "jnp://" + jbs.getHost() + ":" + port); //$NON-NLS-1$
//$NON-NLS-2$
+ props.put(IJBossServerConstants.JNP_DISABLE_DISCOVERY, new
Boolean(true).booleanValue());
}
return props;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,14 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.extensions.polling;
import java.util.ArrayList;
@@ -33,8 +23,10 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXClassLoaderRepository;
@@ -42,6 +34,7 @@
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.tools.jmx.core.IJMXRunnable;
/**
@@ -51,12 +44,12 @@
*/
public class JMXPoller implements IServerStatePoller {
- public static final String POLLER_ID =
"org.jboss.ide.eclipse.as.core.runtime.server.JMXPoller";
+ public static final String POLLER_ID =
"org.jboss.ide.eclipse.as.core.runtime.server.JMXPoller"; //$NON-NLS-1$
public static final int JMXPOLLER_CODE = IEventCodes.JMXPOLLER_CODE;
public static final Properties IGNORED_PROPERTIES = new Properties();
- public static final String REQUIRED_USER =
"org.jboss.ide.eclipse.as.core.extensions.polling.jmx.REQUIRED_USER";
- public static final String REQUIRED_PASS =
"org.jboss.ide.eclipse.as.core.extensions.polling.jmx.REQUIRED_PASS";
+ public static final String REQUIRED_USER =
"org.jboss.ide.eclipse.as.core.extensions.polling.jmx.REQUIRED_USER";
//$NON-NLS-1$
+ public static final String REQUIRED_PASS =
"org.jboss.ide.eclipse.as.core.extensions.polling.jmx.REQUIRED_PASS";
//$NON-NLS-1$
public static final int STATE_STARTED = 1;
public static final int STATE_STOPPED = 0;
@@ -87,14 +80,15 @@
private class JMXPollerRunnable implements IJMXRunnable {
public void run(MBeanServerConnection connection) throws Exception {
Object attInfo = connection.getAttribute(
- new ObjectName("jboss.system:type=Server"),
- "Started");
+ new ObjectName(IJBossRuntimeConstants.SYSTEM_MBEAN),
+ IJBossRuntimeConstants.STARTED_METHOD);
boolean b = ((Boolean) attInfo).booleanValue();
started = b ? STATE_STARTED : STATE_TRANSITION;
done = b;
if( !startingFound ) {
startingFound = true;
- IStatus s = new Status(IStatus.INFO, JBossServerCorePlugin.PLUGIN_ID,
JMXPOLLER_CODE|started, "Server is starting", null);
+ IStatus s = new Status(IStatus.INFO, JBossServerCorePlugin.PLUGIN_ID,
+ JMXPOLLER_CODE|started, Messages.ServerStarting, null);
log(s);
}
}
@@ -124,7 +118,7 @@
if( !waitingForCredentials ) {
waitingForCredentials = true;
requiresInfoException = new PollingSecurityException(
- "Security Exception: " + t.getMessage());
+ NLS.bind(Messages.securityException, t.getMessage()));
} else {
// we're waiting. are they back yet?
if( requiredPropertiesReturned != null ) {
@@ -178,7 +172,7 @@
private void launchJMXPoller() {
PollerRunnable run = new PollerRunnable();
- Thread t = new Thread(run, "JMX Poller");
+ Thread t = new Thread(run, Messages.JMXPoller);
t.start();
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.extensions.polling;
import java.util.List;
@@ -42,7 +31,7 @@
*/
public class ProcessTerminatedPoller implements IServerStatePoller {
- public static final String POLLER_ID =
"org.jboss.ide.eclipse.as.core.runtime.server.processTerminatedPoller";
+ public static final String POLLER_ID =
"org.jboss.ide.eclipse.as.core.runtime.server.processTerminatedPoller";
//$NON-NLS-1$
private ServerStatePollerType type;
private JBossServerBehavior server;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.extensions.polling;
import java.util.Date;
@@ -36,7 +25,7 @@
*
*/
public class TimeoutPoller implements IServerStatePoller {
- public static final String POLLER_ID =
"org.jboss.ide.eclipse.as.core.runtime.server.timeoutpoller";
+ public static final String POLLER_ID =
"org.jboss.ide.eclipse.as.core.runtime.server.timeoutpoller"; //$NON-NLS-1$
private boolean expectedState;
private long endTime;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableAdapter.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableAdapter.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableAdapter.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.modules;
import org.eclipse.core.resources.IFile;
@@ -13,7 +23,7 @@
public IModuleArtifact getModuleArtifact(Object obj) {
if( obj instanceof IFile ) {
IFile f = ((IFile)obj);
- IModule m = SingleDeployableFactory.getFactory().findModule(f);
+ IModule m = SingleDeployableFactory.findModule(f);
if( m != null )
return new SingleDeployableModuleArtifact(m);
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,14 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.modules;
import java.util.ArrayList;
@@ -43,6 +33,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
@@ -56,6 +47,7 @@
import org.eclipse.wst.server.core.model.ModuleDelegate;
import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
@@ -65,12 +57,12 @@
*
*/
public class SingleDeployableFactory extends ModuleFactoryDelegate {
- public static final String FACTORY_ID =
"org.jboss.ide.eclipse.as.core.singledeployablefactory";
+ public static final String FACTORY_ID =
"org.jboss.ide.eclipse.as.core.singledeployablefactory"; //$NON-NLS-1$
private static SingleDeployableFactory factDelegate;
- public static final String MODULE_TYPE = "jboss.singlefile";
- public static final String VERSION = "1.0";
- private static final String PREFERENCE_KEY =
"org.jboss.ide.eclipse.as.core.singledeployable.deployableList";
- private static final String DELIM = "\r";
+ public static final String MODULE_TYPE = "jboss.singlefile"; //$NON-NLS-1$
+ public static final String VERSION = "1.0"; //$NON-NLS-1$
+ private static final String PREFERENCE_KEY =
"org.jboss.ide.eclipse.as.core.singledeployable.deployableList"; //$NON-NLS-1$
+ private static final String DELIM = "\r"; //$NON-NLS-1$
private static ModuleFactory factory;
@@ -132,7 +124,7 @@
moduleToDelegate = new HashMap<IModule, SingleDeployableModuleDelegate>();
registerListener();
String files =
JBossServerCorePlugin.getDefault().getPluginPreferences().getString(PREFERENCE_KEY);
- if( files.equals("")) return;
+ if( files.equals("")) return; //$NON-NLS-1$
String[] files2 = files.split(DELIM);
for( int i = 0; i < files2.length; i++ ) {
addModule(new Path(files2[i]));
@@ -186,7 +178,7 @@
public void saveDeployableList() {
Iterator<IPath> i = moduleIdToModule.keySet().iterator();
- String val = "";
+ String val = ""; //$NON-NLS-1$
while(i.hasNext()) {
val += i.next().toString() + DELIM;
}
@@ -293,7 +285,7 @@
this(paths,true);
}
public UndeployFromServerJob(ArrayList<IPath> paths, boolean removeFromFactory)
{
- super("Undeploy Single Files From Server");
+ super(Messages.UndeploySingleFilesJob);
this.paths = paths;
this.removeFromFactory = removeFromFactory;
}
@@ -302,9 +294,10 @@
IPath next;
IModule mod;
IServer[] allServers = ServerCore.getServers();
- MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IStatus.ERROR,
"Failed to undeploy modules from all servers", null);
- for( Iterator i = paths.iterator(); i.hasNext(); ) {
- next = (IPath)i.next();
+ MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IStatus.ERROR,
+ Messages.SingleFileUndeployFailed, null);
+ for( Iterator<IPath> i = paths.iterator(); i.hasNext(); ) {
+ next = i.next();
mod = getFactory().getModule(next);
if( mod != null ) {
boolean removedFromAllServers = true;
@@ -318,7 +311,9 @@
new PublishServerJob(s).schedule();
} catch( CoreException ce ) {
removedFromAllServers = false;
- IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Failed to remove " + next + " from " + allServers[j].getName(), ce);
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.SingleFileUndeployFailed2, next, allServers[j].getName()),
+ ce);
ms.add(s);
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.publishers;
import java.io.File;
@@ -36,22 +25,25 @@
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.DeletedModule;
import org.eclipse.wst.server.core.model.IModuleFolder;
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.util.ProjectModule;
import org.jboss.ide.eclipse.as.core.ExtensionManager;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.server.xpl.ModulePackager;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
+import org.jboss.ide.eclipse.as.core.util.IWTPConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.FileUtil.FileUtilListener;
import org.jboss.ide.eclipse.as.core.util.FileUtil.IFileUtilListener;
@@ -89,12 +81,10 @@
if( delegate != null ) {
return delegate.publishModule(server, module, publishType, delta, monitor);
} else {
- // TODO log, return
+ // TODO log, use unzipped instead
}
}
-
-
boolean deleted = false;
for( int i = 0; i < module.length; i++ ) {
if( module[i].isExternal() )
@@ -136,7 +126,7 @@
if( list.size() > 0 ) {
MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FULL_FAIL,
- "Full Publish Failed for module " + module.getName(), null);
+ NLS.bind(Messages.FullPublishFail, module.getName()), null);
for( int i = 0; i < list.size(); i++ )
ms.add(list.get(i));
return ms;
@@ -146,7 +136,7 @@
// adjust timestamps
FileFilter filter = new FileFilter() {
public boolean accept(File pathname) {
- if( pathname.getAbsolutePath().toLowerCase().endsWith(".xml"))
+ if( pathname.getAbsolutePath().toLowerCase().endsWith(IConstants.EXT_XML))
return true;
return false;
}
@@ -155,7 +145,7 @@
publishState = IServer.PUBLISH_STATE_NONE;
IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FULL_SUCCESS,
- countMembers(module) + " files modified in module " + module.getName(),
null);
+ NLS.bind(Messages.CountModifiedMembers, countMembers(module), module.getName()),
null);
return ret;
}
@@ -172,13 +162,13 @@
}
if( results != null && results.length > 0 ) {
MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_INC_FAIL,
- "Incremental Publish Failed for module " + module.getName(), null);
+ NLS.bind(Messages.IncrementalPublishFail, module.getName()), null);
for( int i = 0; i < results.length; i++ )
ms.add(results[i]);
return ms;
}
IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FULL_SUCCESS,
- countChanges(delta) + " files modified in module " + module.getName(),
null);
+ NLS.bind(Messages.CountModifiedMembers, countChanges(delta), module.getName()),
null);
return ret;
}
@@ -189,13 +179,14 @@
if( errors.length > 0 ) {
publishState = IServer.PUBLISH_STATE_FULL;
MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_REMOVE_FAIL,
- "Unable to delete module " + mod.getName(), new Exception("Some files
were not removed from the server"));
+ NLS.bind(Messages.DeleteModuleFail, mod.getName()),
+ new Exception(Messages.DeleteModuleFail2));
for( int i = 0; i < errors.length; i++ )
ms.addAll(errors[i]);
throw new CoreException(ms);
}
IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_REMOVE_SUCCESS,
- mod.getName() + " removed.", null);
+ NLS.bind(Messages.ModuleDeleted, mod.getName()), null);
return ret;
}
@@ -217,12 +208,14 @@
return listener.getStatuses();
} else {
IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_COPY_BINARY_FAIL,
- "Could not publish module " + moduleTree[moduleTree.length-1], null);
+ NLS.bind(Messages.CouldNotPublishModule,
+ moduleTree[moduleTree.length-1]), null);
return new IStatus[] {s};
}
} catch( CoreException ce ) {
IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_COPY_BINARY_FAIL,
- "Could not publish module " + moduleTree[moduleTree.length-1], ce);
+ NLS.bind(Messages.CouldNotPublishModule,
+ moduleTree[moduleTree.length-1]), null);
return new IStatus[] {s};
}
}
@@ -234,20 +227,21 @@
*/
protected IStatus[] localSafeDelete(IPath deployPath) {
String serverDeployFolder = server.getDeployFolder();
- Assert.isTrue(!deployPath.toFile().equals(new Path(serverDeployFolder).toFile()),
"An attempt to delete your entire deploy folder has been prevented. This should never
happen");
+ Assert.isTrue(!deployPath.toFile().equals(new Path(serverDeployFolder).toFile()),
+ "An attempt to delete your entire deploy folder has been prevented. This
should never happen"); //$NON-NLS-1$
final ArrayList<IStatus> status = new ArrayList<IStatus>();
IFileUtilListener listener = new IFileUtilListener() {
public void fileCopied(File source, File dest, boolean result,Exception e) {}
public void fileDeleted(File file, boolean result, Exception e) {
if( result == false || e != null ) {
status.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FILE_DELETE_FAIL,
- "Attempt to delete " + file.getAbsolutePath() + "
failed",e));
+ NLS.bind(Messages.DeleteFileError, file.getAbsolutePath()),e));
}
}
public void folderDeleted(File file, boolean result, Exception e) {
if( result == false || e != null ) {
status.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FILE_DELETE_FAIL,
- "Attempt to delete " + file.getAbsolutePath() + "
failed",e));
+ NLS.bind(Messages.DeleteFolderError, file.getAbsolutePath()),e));
}
}
};
@@ -255,8 +249,8 @@
return (IStatus[]) status.toArray(new IStatus[status.size()]);
}
public static boolean deployPackaged(IModule[] moduleTree) {
- if(
moduleTree[moduleTree.length-1].getModuleType().getId().equals("jst.utility"))
return true;
- if(
moduleTree[moduleTree.length-1].getModuleType().getId().equals("jst.appclient"))
return true;
+ if(
moduleTree[moduleTree.length-1].getModuleType().getId().equals(IWTPConstants.FACET_UTILITY))
return true;
+ if(
moduleTree[moduleTree.length-1].getModuleType().getId().equals(IWTPConstants.FACET_APP_CLIENT))
return true;
return false;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,34 +1,25 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.publishers;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
/**
@@ -46,6 +37,7 @@
public IStatus publishModule(IServer server, IModule[] module,
int publishType, IModuleResourceDelta[] delta, IProgressMonitor monitor) throws
CoreException {
- return new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, "No publisher
found for module " + module[module.length-1]);
+ return new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.NoPublisherFound, module[module.length-1]));
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.publishers;
import org.eclipse.core.resources.IFile;
@@ -32,6 +21,7 @@
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
public class PublishUtil {
public static int countChanges(IModuleResourceDelta[] deltas) {
@@ -78,22 +68,26 @@
if( new Path(name).segmentCount() > 1 )
// we strongly suspect this is a binary object and not a project
return root.append(new Path(name).lastSegment());
- if( "jst.ear".equals(type))
- root = root.append(name + ".ear");
- else if( "jst.web".equals(type))
- root = root.append(name + ".war");
- else if( "jst.utility".equals(type) && i >= 1 &&
"jst.web".equals(moduleTree[i-1].getModuleType().getId()))
- root = root.append("WEB-INF").append("lib").append(name +
".jar");
- else if( "jst.connector".equals(type)) {
- root = root.append(name + ".rar");
- } else if( "jst.jboss.esb".equals(type)){
- root = root.append(name + ".esb");
+ if( IJBossServerConstants.FACET_EAR.equals(type))
+ root = root.append(name + IJBossServerConstants.EXT_EAR);
+ else if( IJBossServerConstants.FACET_WEB.equals(type))
+ root = root.append(name + IJBossServerConstants.EXT_WAR);
+ else if( IJBossServerConstants.FACET_UTILITY.equals(type) && i >= 1
+ &&
IJBossServerConstants.FACET_WEB.equals(moduleTree[i-1].getModuleType().getId()))
+ root = root.append(IJBossServerConstants.WEB_INF)
+ .append(IJBossServerConstants.LIB)
+ .append(name + IJBossServerConstants.EXT_JAR);
+ else if( IJBossServerConstants.FACET_UTILITY.equals(type)) {
+ root = root.append(name + IJBossServerConstants.EXT_RAR);
+ } else if( IJBossServerConstants.FACET_ESB.equals(type)){
+ root = root.append(name + IJBossServerConstants.EXT_ESB);
}else
- root = root.append(name + ".jar");
+ root = root.append(name + IJBossServerConstants.EXT_JAR);
}
return root;
}
+ // TODO This can also change to find the isBinaryModule method
public static boolean isBinaryObject(IModule[] moduleTree) {
String name;
for( int i = 0; i < moduleTree.length; i++ ) {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.publishers;
import java.io.File;
@@ -31,11 +20,14 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
+import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
import
org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory.SingleDeployableModuleDelegate;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
@@ -57,7 +49,7 @@
public boolean accepts(IServer server, IModule[] module) {
if( module != null && module.length > 0
&& module[module.length-1] != null
- &&
module[module.length-1].getModuleType().getId().equals("jboss.singlefile"))
+ &&
module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
return true;
return false;
}
@@ -99,20 +91,22 @@
destFile.setLastModified(new Date().getTime());
if( l.errorFound || !success ) {
publishState = IServer.PUBLISH_STATE_FULL;
- Exception e = l.e != null ? l.e : new Exception("Move from " + tempDestFile
+ " to " + destFile + " failed.");
+ Exception e = l.e != null ? l.e : new Exception(
+ NLS.bind(Messages.CopyFileError, tempDestFile, destFile));
return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.SINGLE_FILE_PUBLISH_FAIL,
- "The module " + module.getName() + " cannot be published.",
e);
+ NLS.bind(Messages.CouldNotPublishModule, module.getName()), e);
}
} else {
// deleted module. o noes. Ignore it. We can't re-publish it, so just ignore it.
publishState = IServer.PUBLISH_STATE_UNKNOWN;
Status status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.SINGLE_FILE_PUBLISH_MNF,
- "The module " + module.getName() + " cannot be published because it
cannot be located. (" + module.getName() + ")", null);
+ NLS.bind(Messages.CouldNotPublishModule, module.getName()), null);
return status;
}
Status status = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
- IEventCodes.SINGLE_FILE_PUBLISH_SUCCESS, "Module " + module.getName() +
" copied.", null);
+ IEventCodes.SINGLE_FILE_PUBLISH_SUCCESS,
+ NLS.bind(Messages.ModulePublished,module.getName()), null);
return status;
}
@@ -128,17 +122,17 @@
if( l.errorFound ) {
publishState = IServer.PUBLISH_STATE_FULL;
return new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.SINGLE_FILE_UNPUBLISH_FAIL,
- "Unable to delete module " + module.getName() + " from
server.", l.e);
+ NLS.bind(Messages.DeleteModuleFail, module.getName()), l.e);
}
} else {
// deleted module. o noes. Ignore it.
publishState = IServer.PUBLISH_STATE_UNKNOWN;
Status status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.SINGLE_FILE_UNPUBLISH_MNF,
- "The module cannot be removed because it cannot be located. (" +
module.getName() + ")", null);
+ NLS.bind(Messages.DeleteModuleFail, module.getName()), null);
return status;
}
Status status = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.SINGLE_FILE_UNPUBLISH_SUCCESS,
- "Module " + module.getName() + " removed.", null);
+ NLS.bind(Messages.ModuleDeleted, module.getName()), null);
return status;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,14 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import org.eclipse.wst.server.core.IServer;
@@ -28,15 +18,15 @@
*
* @author rob.stryker(a)jboss.com
*/
-public interface IDeployableServer extends IJBossServerConstants {
- public static final String DEPLOY_DIRECTORY =
"org.jboss.ide.eclipse.as.core.server.deployDirectory";
- public static final String TEMP_DEPLOY_DIRECTORY =
"org.jboss.ide.eclipse.as.core.server.tempDeployDirectory";
- public static final String DEPLOY_DIRECTORY_TYPE =
"org.jboss.ide.eclipse.as.core.server.deployDirectoryType";
- public static final String ZIP_DEPLOYMENTS_PREF =
"org.jboss.ide.eclipse.as.core.server.zipDeploymentsPreference";
+public interface IDeployableServer {
+ public static final String DEPLOY_DIRECTORY =
"org.jboss.ide.eclipse.as.core.server.deployDirectory"; //$NON-NLS-1$
+ public static final String TEMP_DEPLOY_DIRECTORY =
"org.jboss.ide.eclipse.as.core.server.tempDeployDirectory"; //$NON-NLS-1$
+ public static final String DEPLOY_DIRECTORY_TYPE =
"org.jboss.ide.eclipse.as.core.server.deployDirectoryType"; //$NON-NLS-1$
+ public static final String ZIP_DEPLOYMENTS_PREF =
"org.jboss.ide.eclipse.as.core.server.zipDeploymentsPreference"; //$NON-NLS-1$
- public static final String DEPLOY_METADATA = "metadata";
- public static final String DEPLOY_CUSTOM = "custom";
- public static final String DEPLOY_SERVER = "server";
+ public static final String DEPLOY_METADATA = "metadata"; //$NON-NLS-1$
+ public static final String DEPLOY_CUSTOM = "custom"; //$NON-NLS-1$
+ public static final String DEPLOY_SERVER = "server"; //$NON-NLS-1$
public String getDeployFolder();
public void setDeployFolder(String folder);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerConstants.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerConstants.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerConstants.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,82 +1,30 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.IWTPConstants;
/**
- *
+ * This is just a collector interface, and deprecated
* @author Rob Stryker
- *
+ * @deprecated
*/
-public interface IJBossServerConstants {
- // Metadata folders
- public static final String LOG = "log";
- public static final String TEMP_DEPLOY = "tempDeploy";
- public static final String JBOSSTOOLS_TMP = "jbosstoolsTemp";
- public static final String TMP = "tmp";
- public static final String CONFIG_IN_METADATA = "jbossConfig";
-
-
- // Preference codes
- public static final String USE_METADATA_CONFIG =
"IJBossServerConstants.useMetadataConfig";
-
- // Launch configuration constants
- public static final String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
- public static final String JBOSS_SERVER_BASE_DIR = "jboss.server.base.dir";
- public static final String JBOSS_SERVER_NAME = "jboss.server.name";
- public static final String JBOSS_HOME_DIR = "jboss.home.dir";
-
- // Folder constants
- public static final String DEFAULT_SERVER_NAME = "default";
- public static final String DEPLOY = "deploy";
- public static final String SERVER = "server";
- public static final String WORK = "work";
- public static final String DATA = "data";
-// public static final String TMP = "tmp"; // repeat
-// public static final String LOG = "log"; // repeat
- public static final String[] JBOSS_TEMPORARY_FOLDERS = new String[] { WORK, DATA, TMP,
LOG};
-
- // Property keys stored in the server object
- public static final String SERVER_USERNAME =
"org.jboss.ide.eclipse.as.core.server.userName";
- public static final String SERVER_PASSWORD =
"org.jboss.ide.eclipse.as.core.server.password";
- public static final String JNDI_PORT =
"org.jboss.ide.eclipse.as.core.server.jndiPort";
- public static final String WEB_PORT =
"org.jboss.ide.eclipse.as.core.server.webPort";
- public static final String JNDI_PORT_DETECT =
"org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect";
- public static final String WEB_PORT_DETECT=
"org.jboss.ide.eclipse.as.core.server.webPortAutoDetect";
- public static final String JNDI_PORT_DETECT_XPATH =
"org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect.XPath";
- public static final String WEB_PORT_DETECT_XPATH =
"org.jboss.ide.eclipse.as.core.server.webPortAutoDetect.XPath";
- public static final String JNDI_PORT_DEFAULT_XPATH = "Ports" + Path.SEPARATOR
+ "JNDI";
- public static final String WEB_PORT_DEFAULT_XPATH = "Ports" + Path.SEPARATOR +
"JBoss Web";
- public static final int JNDI_DEFAULT_PORT = 1099;
- public static final int JBOSS_WEB_DEFAULT_PORT = 8080;
+public interface IJBossServerConstants extends
+ IJBossRuntimeConstants,
+ IWTPConstants,
+ IJBossToolingConstants,
+ IJBossRuntimeResourceConstants {
-
- // Poller constants
- public static final String STARTUP_POLLER_KEY =
"org.jboss.ide.eclipse.as.core.server.attributes.startupPollerKey";
- public static final String SHUTDOWN_POLLER_KEY =
"org.jboss.ide.eclipse.as.core.server.attributes.shutdownPollerKey";
- public static final String DEFAULT_STARTUP_POLLER =
"org.jboss.ide.eclipse.as.core.runtime.server.JMXPoller";
- public static final String DEFAULT_SHUTDOWN_POLLER =
"org.jboss.ide.eclipse.as.core.runtime.server.processTerminatedPoller";
-
}
+
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/*
- * 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.
- */
+/*******************************************************************************
+ * 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;
import org.eclipse.core.runtime.CoreException;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import java.util.HashMap;
@@ -31,10 +20,10 @@
* @author Rob Stryker
*/
public interface IJBossServerRuntime {
- public static String PROPERTY_VM_ID = "PROPERTY_VM_ID";
- public static String PROPERTY_VM_TYPE_ID = "PROPERTY_VM_TYPE_ID";
+ public static String PROPERTY_VM_ID = "PROPERTY_VM_ID"; //$NON-NLS-1$
+ public static String PROPERTY_VM_TYPE_ID = "PROPERTY_VM_TYPE_ID";
//$NON-NLS-1$
- public static String PROPERTY_CONFIGURATION_NAME =
"org.jboss.ide.eclipse.as.core.runtime.configurationName";
+ public static String PROPERTY_CONFIGURATION_NAME =
"org.jboss.ide.eclipse.as.core.runtime.configurationName"; //$NON-NLS-1$
public IRuntime getRuntime();
public IVMInstall getVM();
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollerFailureHandler.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollerFailureHandler.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollerFailureHandler.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import java.util.List;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import java.util.List;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import org.eclipse.core.runtime.IStatus;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import java.util.ArrayList;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,30 +1,18 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -38,8 +26,8 @@
import org.eclipse.wst.server.core.model.ServerDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.IWTPConstants;
import org.jboss.ide.eclipse.as.core.util.ModuleUtil;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
@@ -67,7 +55,7 @@
* Abstracts to implement
*/
public IStatus canModifyModules(IModule[] add, IModule[] remove) {
- return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,0, "OK",
null);
+ return Status.OK_STATUS;
}
public IModule[] getChildModules(IModule[] module) {
@@ -87,7 +75,7 @@
private IModule[] doGetParentModules(IModule module) {
- IModule[] ears =
org.eclipse.wst.server.core.ServerUtil.getModules("jst.ear"); //$NON-NLS-1$
+ IModule[] ears =
org.eclipse.wst.server.core.ServerUtil.getModules(IWTPConstants.FACET_EAR);
ArrayList<IModule> list = new ArrayList<IModule>();
for (int i = 0; i < ears.length; i++) {
IEnterpriseApplication ear =
(IEnterpriseApplication)ears[i].loadAdapter(IEnterpriseApplication.class,null);
@@ -111,7 +99,7 @@
public String getDeployFolder() {
IJBossServerRuntime jbsrt = getRuntime();
- return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(DEPLOY_DIRECTORY,
""))).toString();
+ return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(DEPLOY_DIRECTORY,
""))).toString(); //$NON-NLS-1$
}
public void setDeployFolder(String folder) {
@@ -120,7 +108,7 @@
public String getTempDeployFolder() {
IJBossServerRuntime jbsrt = getRuntime();
- return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(TEMP_DEPLOY_DIRECTORY,
""))).toString();
+ return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(TEMP_DEPLOY_DIRECTORY,
""))).toString(); //$NON-NLS-1$
}
public void setTempDeployFolder(String folder) {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import java.util.List;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerRuntime.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerRuntime.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import org.eclipse.wst.server.core.model.RuntimeDelegate;
@@ -26,7 +15,7 @@
public class DeployableServerRuntime extends RuntimeDelegate {
public DeployableServerRuntime() {
- // TODO Auto-generated constructor stub
+ // Nothing to do
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import java.io.FileInputStream;
@@ -40,11 +29,12 @@
import org.eclipse.wst.server.core.model.ServerDelegate;
import org.eclipse.wst.server.core.util.HttpLaunchable;
import org.eclipse.wst.server.core.util.WebResource;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
public class JBossLaunchAdapter extends LaunchableAdapterDelegate {
- private static final String JAVA_NAMING_PROVIDER_URL_PROPKEY =
"java.naming.provider.url"; //$NON-NLS-1$
- private static final String JAVA_NAMING_FACTORY_INITIAL_PROPKEY =
"java.naming.factory.initial"; //$NON-NLS-1$
+ private static final String JAVA_NAMING_PROVIDER_URL_PROPKEY =
IJBossServerConstants.NAMING_FACTORY_PROVIDER_URL;
+ private static final String JAVA_NAMING_FACTORY_INITIAL_PROPKEY =
IJBossServerConstants.NAMING_FACTORY_KEY;
public JBossLaunchAdapter() {
// TODO Auto-generated constructor stub
}
@@ -69,13 +59,16 @@
private Object prepareJndiLaunchable(IModuleArtifact moduleObject, ServerDelegate
delegate) {
JndiLaunchable launchable = null;
JBossServer server = (JBossServer)delegate;
- IPath p = new
Path(server.getConfigDirectory()).append("jndi.properties");
+ IPath p = new Path(server.getConfigDirectory())
+ .append(IJBossServerConstants.JNDI_PROPERTIES);
Properties props = new Properties();
try {
props.load(new FileInputStream(p.toFile()));
} catch( IOException ioe ) {
- props.put(JAVA_NAMING_FACTORY_INITIAL_PROPKEY,
"org.jnp.interfaces.NamingContextFactory");
-
props.put(JAVA_NAMING_PROVIDER_URL_PROPKEY,"org.jboss.naming:org.jnp.interfaces");
+ props.put(JAVA_NAMING_FACTORY_INITIAL_PROPKEY,
+ IJBossServerConstants.NAMING_FACTORY_VALUE);
+ props.put(JAVA_NAMING_PROVIDER_URL_PROPKEY,
+ IJBossServerConstants.NAMING_FACTORY_INTERFACES);
}
if(moduleObject instanceof EJBBean) {
@@ -106,7 +99,7 @@
path = path.substring(1);
url = new URL(url, path);
} else
- url = new URL(url, servlet.getName()); //$NON-NLS-1$
+ url = new URL(url, servlet.getName());
} else if (moduleObject instanceof WebResource) {
WebResource resource = (WebResource) moduleObject;
String path = resource.getPath().toString();
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 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/*
- * 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.
- */
+/*******************************************************************************
+ * 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;
import java.io.File;
@@ -37,16 +26,19 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jst.server.core.IWebModule;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.core.model.IURLProvider;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
/**
@@ -62,7 +54,7 @@
public void setDefaults(IProgressMonitor monitor) {
super.setDefaults(monitor);
- setAttribute("auto-publish-time", 1);
+ setAttribute("auto-publish-time", 1); //$NON-NLS-1$
}
public void saveConfiguration(IProgressMonitor monitor) throws CoreException {
@@ -74,12 +66,17 @@
String startArgs =
lc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String)null);
String originalArgs = startArgs;
if( !getServer().getHost().equals(getHost(true)))
- startArgs = ArgsUtil.setArg(startArgs, "-b", "--host",
getServer().getHost());
+ startArgs = ArgsUtil.setArg(startArgs,
+ IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT,
+ IJBossRuntimeConstants.STARTUP_ARG_HOST_LONG,
+ getServer().getHost());
IJBossServerRuntime runtime = (IJBossServerRuntime)
getServer().getRuntime().loadAdapter(IJBossServerRuntime.class, null);
String config = runtime.getJBossConfiguration();
- startArgs = ArgsUtil.setArg(startArgs, "-c", "--configuration",
config);
+ startArgs = ArgsUtil.setArg(startArgs,
+ IJBossRuntimeConstants.STARTUP_ARG_CONFIG_SHORT,
+ IJBossRuntimeConstants.STARTUP_ARG_CONFIG_LONG, config);
if( startArgs != null && !startArgs.trim().equals(originalArgs)) {
ILaunchConfigurationWorkingCopy wc = lc.getWorkingCopy();
@@ -88,7 +85,8 @@
}
}
} catch( CoreException ce ) {
- IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Could not
save server's start arguments", ce);
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.CannotSaveServersStartArgs, getServer().getName()), ce);
JBossServerCorePlugin.getDefault().getLog().log(s);
}
}
@@ -106,7 +104,9 @@
ILaunchConfiguration lc = s.getLaunchConfiguration(true, new NullProgressMonitor());
if(lc!=null) {
String startArgs =
lc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String)null);
- String val = ArgsUtil.getValue(startArgs, "-b", "--host");
+ String val = ArgsUtil.getValue(startArgs,
+ IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT,
+ IJBossRuntimeConstants.STARTUP_ARG_HOST_LONG);
if( val != null ) {
host = val;
}
@@ -139,7 +139,7 @@
IJBossServerRuntime jbsrt = getRuntime();
String type = getDeployLocationType();
if( type.equals(DEPLOY_CUSTOM))
- return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(DEPLOY_DIRECTORY,
""))).toString();
+ return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(DEPLOY_DIRECTORY,
""))).toString(); //$NON-NLS-1$
if( type.equals(DEPLOY_METADATA)) {
return JBossServerCorePlugin.getServerStateLocation(getServer()).
append(IJBossServerConstants.DEPLOY).makeAbsolute().toString();
@@ -167,7 +167,7 @@
IJBossServerRuntime jbsrt = getRuntime();
String type = getDeployLocationType();
if( type.equals(DEPLOY_CUSTOM))
- return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(TEMP_DEPLOY_DIRECTORY,
""))).toString();
+ return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(TEMP_DEPLOY_DIRECTORY,
""))).toString(); //$NON-NLS-1$
if( type.equals(DEPLOY_METADATA)) {
return JBossServerCorePlugin.getServerStateLocation(getServer()).
append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute().toString();
@@ -199,13 +199,13 @@
if( map.get(JBOSS_SERVER_BASE_DIR) != null ) {
String name = map.get(JBOSS_SERVER_NAME) != null ?
- (String)map.get(JBOSS_SERVER_NAME) : DEFAULT_SERVER_NAME;
+ (String)map.get(JBOSS_SERVER_NAME) : DEFAULT_CONFIGURATION;
return (String)map.get(JBOSS_SERVER_BASE_DIR) + Path.SEPARATOR + name;
}
if( map.get(JBOSS_HOME_DIR) != null ) {
return (String)map.get(JBOSS_HOME_DIR) + Path.SEPARATOR + SERVER
- + Path.SEPARATOR + DEFAULT_SERVER_NAME;
+ + Path.SEPARATOR + DEFAULT_CONFIGURATION;
}
} catch( CoreException ce ) {
}
@@ -284,14 +284,14 @@
// first class parameters
public String getUsername() {
- return getAttribute(SERVER_USERNAME, "");
+ return getAttribute(SERVER_USERNAME, ""); //$NON-NLS-1$
}
public void setUsername(String name) {
setAttribute(SERVER_USERNAME, name);
}
public String getPassword() {
- return getAttribute(SERVER_PASSWORD, "");
+ return getAttribute(SERVER_PASSWORD, ""); //$NON-NLS-1$
}
public void setPassword(String pass) {
setAttribute(SERVER_PASSWORD, pass);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,23 @@
-/*
- * 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.
- */
+/*******************************************************************************
+ * 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
+ ******************************************************************************/
+/*******************************************************************************
+ * 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;
import javax.management.MBeanServerConnection;
@@ -36,6 +35,7 @@
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.extensions.jmx.JBossServerConnectionProvider;
@@ -43,6 +43,8 @@
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import
org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.internal.launch.StopLaunchConfiguration;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.tools.jmx.core.IJMXRunnable;
/**
@@ -51,11 +53,6 @@
*
*/
public class JBossServerBehavior extends DeployableServerBehavior {
- private static final String STOP_FAILED_MESSAGE =
- "Command to stop server failed. The next attempt will forcefully terminate the
process.";
- private static final String FORCE_TERMINATED = "The server was shutdown forcefully.
All processes were terminated.";
- private static final String TERMINATED = "Server processes have been
terminated.";
- private static final String FORCE_TERMINATE_FAILED = "Killing the server process
has failed. The process may still be running.";
private PollThread pollThread = null;
protected IProcess process;
@@ -85,7 +82,7 @@
if( !success ) {
if( process != null && !process.isTerminated() ) {
setServerStarted();
- pollThread.cancel(STOP_FAILED_MESSAGE);
+ pollThread.cancel(Messages.STOP_FAILED_MESSAGE);
nextStopRequiresForce = true;
}
}
@@ -109,20 +106,20 @@
protected void addForceStopFailedEvent(DebugException e) {
IStatus status = new Status(IStatus.ERROR,
JBossServerCorePlugin.PLUGIN_ID, IEventCodes.BEHAVIOR_FORCE_STOP_FAILED,
- FORCE_TERMINATE_FAILED, e);
+ Messages.FORCE_TERMINATE_FAILED, e);
ServerLogger.getDefault().log(getServer(), status);
}
protected void addForceStopEvent() {
IStatus status = new Status(IStatus.ERROR,
JBossServerCorePlugin.PLUGIN_ID, IEventCodes.BEHAVIOR_FORCE_STOP,
- FORCE_TERMINATED, null);
+ Messages.FORCE_TERMINATED, null);
ServerLogger.getDefault().log(getServer(), status);
}
protected void addProcessTerminatedEvent() {
IStatus status = new Status(IStatus.INFO,
JBossServerCorePlugin.PLUGIN_ID, IEventCodes.BEHAVIOR_PROCESS_TERMINATED,
- TERMINATED, null);
+ Messages.TERMINATED, null);
ServerLogger.getDefault().log(getServer(), status);
}
@@ -183,7 +180,7 @@
if( this.pollThread != null ) {
pollThread.cancel();
}
- this.pollThread = new PollThread("Server Poller", expectedState, this);
+ this.pollThread = new PollThread(Messages.ServerPollerThreadName, expectedState,
this);
pollThread.start();
}
@@ -217,7 +214,7 @@
}
protected boolean shouldSuspendScanner() {
- if(
getServer().getServerType().getId().equals("org.jboss.ide.eclipse.as.50"))
+ if( getServer().getServerType().getId().equals(IConstants.AS_50))
return false;
if( getServer().getServerState() != IServer.STATE_STARTED)
return false;
@@ -225,13 +222,13 @@
}
protected void suspendDeployment(MBeanServerConnection connection) throws Exception {
- ObjectName name = new
ObjectName("jboss.deployment:flavor=URL,type=DeploymentScanner");
- connection.invoke(name, "stop", new Object[] { }, new String[] {});
+ ObjectName name = new
ObjectName(IJBossRuntimeConstants.DEPLOYMENT_SCANNER_MBEAN_NAME);
+ connection.invoke(name, IJBossRuntimeConstants.STOP, new Object[] { }, new String[]
{});
}
protected void resumeDeployment(MBeanServerConnection connection) throws Exception {
- ObjectName name = new
ObjectName("jboss.deployment:flavor=URL,type=DeploymentScanner");
- connection.invoke(name, "start", new Object[] { }, new String[] {});
+ ObjectName name = new
ObjectName(IJBossRuntimeConstants.DEPLOYMENT_SCANNER_MBEAN_NAME);
+ connection.invoke(name, IJBossRuntimeConstants.START, new Object[] { }, new String[]
{});
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import java.util.HashMap;
@@ -31,6 +20,7 @@
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.IVMInstallType;
import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.model.RuntimeDelegate;
@@ -38,23 +28,24 @@
import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
public class LocalJBossServerRuntime extends RuntimeDelegate implements
IJBossServerRuntime {
public void setDefaults(IProgressMonitor monitor) {
String location = Platform.getOS().equals(Platform.WS_WIN32)
- ? "c:/program files/jboss-" : "/usr/bin/jboss-";
+ ? "c:/program files/jboss-" : "/usr/bin/jboss-"; //$NON-NLS-1$
//$NON-NLS-2$
String version = getRuntime().getRuntimeType().getVersion();
- location += version + ".x";
+ location += version + ".x"; //$NON-NLS-1$
getRuntimeWorkingCopy().setLocation(new Path(location));
getRuntimeWorkingCopy().setName(getNextRuntimeName());
- setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME,
IJBossServerConstants.DEFAULT_SERVER_NAME);
+ setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME,
IJBossServerConstants.DEFAULT_CONFIGURATION);
setVM(null);
}
private String getNextRuntimeName() {
String version = getRuntime().getRuntimeType().getVersion();
- String base = Messages.jboss + " " + version + " " +
Messages.runtime;
+ String base = Messages.jboss + " " + version + " " +
Messages.runtime; //$NON-NLS-1$//$NON-NLS-2$
return getNextRuntimeName(base);
}
@@ -65,17 +56,18 @@
int i = 0;
while (rt != null) {
- rt = ServerCore.findRuntime(base + " " + ++i);
+ rt = ServerCore.findRuntime(base + " " + ++i); //$NON-NLS-1$
}
- return base + " " + i;
+ return base + " " + i; //$NON-NLS-1$
}
public IStatus validate() {
IStatus s = super.validate();
if( !s.isOK()) return s;
- if( getJBossConfiguration().equals(""))
- return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0, "Runtime
Configuration Not Set", null);
+ if( getJBossConfiguration().equals("")) //$NON-NLS-1$
+ return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0,
+ NLS.bind(Messages.ServerRuntimeConfigNotFound, getRuntime().getName()), null);
return Status.OK_STATUS;
}
@@ -111,7 +103,7 @@
}
public String getJBossConfiguration() {
- return getAttribute(PROPERTY_CONFIGURATION_NAME, (String)"");
+ return getAttribute(PROPERTY_CONFIGURATION_NAME, (String)""); //$NON-NLS-1$
}
public void setJBossConfiguration(String config) {
@@ -119,29 +111,33 @@
}
public String getDefaultRunArgs() {
- return "--configuration=" + getJBossConfiguration() + " ";
+ return IConstants.STARTUP_ARG_CONFIG_LONG + "=" + getJBossConfiguration() +
IConstants.SPACE; //$NON-NLS-1$
}
public String getDefaultRunVMArgs() {
+ IConstants c = new IConstants(){};
String name = getRuntime().getName();
- String ret = "-Dprogram.name=\"JBossTools " + name + "\"
";
+ String ret = c.SYSPROP + c.PROGRAM_NAME_ARG + c.EQ + c.QUOTE +
+ "JBossTools: " + name + c.QUOTE + c.SPACE; //$NON-NLS-1$
if( Platform.getOS().equals(Platform.OS_MACOSX))
- ret += "-server ";
- ret += "-Xms256m -Xmx512m -XX:MaxPermSize=256m ";
+ ret += c.SERVER_ARG + c.SPACE;
+ ret += c.DEFAULT_MEM_ARGS;
if( Platform.getOS().equals(Platform.OS_LINUX))
- ret += "-Djava.net.preferIPv4Stack=true ";
- ret += "-Dsun.rmi.dgc.client.gcInterval=3600000 ";
- ret += "-Dsun.rmi.dgc.server.gcInterval=3600000 ";
- ret += "-Djava.endorsed.dirs=\"" +
(getRuntime().getLocation().append("lib").append("endorsed")) +
"\" ";
- if(
getRuntime().getLocation().append("bin").append("native").toFile().exists()
)
- ret += "-Djava.library.path=\"" +
getRuntime().getLocation().append("bin").append("native") +
"\" ";
+ ret += c.SYSPROP + c.JAVA_PREFER_IP4_ARG + c.EQ + true + c.SPACE;
+ ret += c.SYSPROP + c.SUN_CLIENT_GC_ARG + c.EQ + 3600000 + c.SPACE;
+ ret += c.SYSPROP + c.SUN_SERVER_GC_ARG + c.EQ + 3600000 + c.SPACE;
+ ret += c.SYSPROP + c.ENDORSED_DIRS + c.EQ + c.QUOTE +
+ (getRuntime().getLocation().append(c.LIB).append(c.ENDORSED)) + c.QUOTE + c.SPACE;
+ if( getRuntime().getLocation().append(c.BIN).append(c.NATIVE).toFile().exists() )
+ ret += c.SYSPROP + c.JAVA_LIB_PATH + c.EQ + c.QUOTE +
+ getRuntime().getLocation().append(c.BIN).append(c.NATIVE) + c.QUOTE + c.SPACE;
return ret;
}
public HashMap<String, String> getDefaultRunEnvVars(){
HashMap<String, String> envVars = new HashMap<String, String>(1);
- envVars.put("Path", "native");
+ envVars.put("Path", IConstants.NATIVE); //$NON-NLS-1$
return envVars;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,33 +1,24 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import java.util.Date;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.ExtensionManager;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
@@ -56,8 +47,8 @@
public static final int STATE_STOPPING = IServer.STATE_STOPPING << 3;
public static final int STATE_STOPPED = IServer.STATE_STOPPED << 3;
- public static final String SERVER_STARTING =
"org.jboss.ide.eclipse.as.core.runtime.server.PollThread.server.starting";
- public static final String SERVER_STOPPING =
"org.jboss.ide.eclipse.as.core.runtime.server.PollThread.server.stopping";
+ public static final String SERVER_STARTING =
"org.jboss.ide.eclipse.as.core.runtime.server.PollThread.server.starting";
//$NON-NLS-1$
+ public static final String SERVER_STOPPING =
"org.jboss.ide.eclipse.as.core.runtime.server.PollThread.server.stopping";
//$NON-NLS-1$
private boolean expectedState, abort, stateStartedOrStopped;
private IServerStatePoller poller;
@@ -249,7 +240,8 @@
* Event Log Stuff here!
*/
protected void alertEventLogStarting() {
- String message = expectedState ? "Server Starting" : "Server shutting
down";
+ String message = expectedState ?
+ Messages.PollingStarting : Messages.PollingShuttingDown;
int state = expectedState ? STATE_STARTING : STATE_STOPPING;
IStatus status = new Status(IStatus.INFO,
@@ -259,26 +251,26 @@
protected void alertEventLogPollerException(PollingException e) {
IStatus status = new Status(IStatus.ERROR,
- JBossServerCorePlugin.PLUGIN_ID, POLLING_FAIL_CODE, "Failure in Poll
Thread", e);
+ JBossServerCorePlugin.PLUGIN_ID, POLLING_FAIL_CODE, Messages.PollerFailure, e);
ServerLogger.getDefault().log(behavior.getServer(), status);
}
protected void alertEventLogAbort() {
IStatus status = new Status(IStatus.WARNING,
- JBossServerCorePlugin.PLUGIN_ID, POLLING_FAIL_CODE | getStateMask(expectedState,
false), "Poll Thread Aborted: "
- + abortMessage, null);
+ JBossServerCorePlugin.PLUGIN_ID, POLLING_FAIL_CODE | getStateMask(expectedState,
false),
+ NLS.bind(Messages.PollerAborted, abortMessage), null);
ServerLogger.getDefault().log(behavior.getServer(), status);
}
protected void alertEventLogTimeout() {
IStatus status = new Status(IStatus.ERROR,
- JBossServerCorePlugin.PLUGIN_ID, POLLING_FAIL_CODE | getStateMask(expectedState,
false), "", null);
+ JBossServerCorePlugin.PLUGIN_ID, POLLING_FAIL_CODE | getStateMask(expectedState,
false), "", null); //$NON-NLS-1$
ServerLogger.getDefault().log(behavior.getServer(), status);
}
protected void alertEventLogFailure() {
- String startupFailed = "Server Startup Failed";
- String shutdownFailed = "Server Shutdown Failed";
+ String startupFailed = Messages.PollingStartupFailed;
+ String shutdownFailed = Messages.PollingShutdownFailed;
IStatus status = new Status(IStatus.ERROR,
JBossServerCorePlugin.PLUGIN_ID, POLLING_FAIL_CODE | getStateMask(expectedState,
false),
expectedState ? startupFailed : shutdownFailed, null);
@@ -286,8 +278,8 @@
}
protected void alertEventLogSuccess(boolean currentState) {
- String startupSuccess = "Server Startup Succeeded";
- String shutdownSuccess = "Server Shutdown Succeeded";
+ String startupSuccess = Messages.PollingStartupSuccess;
+ String shutdownSuccess = Messages.PollingShutdownSuccess;
int state = getStateMask(expectedState, true);
IStatus status = new Status(IStatus.INFO,
JBossServerCorePlugin.PLUGIN_ID, POLLING_ROOT_CODE | state | SUCCESS,
@@ -296,8 +288,8 @@
}
protected void alertPollerNotFound() {
- String startupPollerNotFound = "Startup Poller not found: " + pollerId;
- String shutdownPollerNotFound = "Shutdown Poller not found: "+ pollerId;
+ String startupPollerNotFound = NLS.bind(Messages.StartupPollerNotFound, pollerId);
+ String shutdownPollerNotFound = NLS.bind(Messages.ShutdownPollerNotFound, pollerId);
IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
POLLING_FAIL_CODE | getStateMask(expectedState, false),
expectedState ? startupPollerNotFound : shutdownPollerNotFound, null);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import java.util.List;
@@ -34,6 +23,7 @@
import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
/**
* This class just opens up the get and set attributes for a server,
@@ -121,7 +111,7 @@
return save(false, new NullProgressMonitor());
} catch( Exception e ) {
IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- "Unexpected Exception while saving server metadata: ", e);
+ Messages.ServerSaveFailed, e);
JBossServerCorePlugin.getDefault().getLog().log(s);
}
return null;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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;
import java.io.File;
@@ -15,6 +25,7 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerEvent;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.extensions.jmx.JBossServerConnectionProvider;
@@ -23,6 +34,7 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.tools.jmx.core.IJMXRunnable;
@@ -70,7 +82,7 @@
} catch( JMXException jmxe ) {
IStatus s = jmxe.getStatus();
IStatus newStatus = new Status(s.getSeverity(), s.getPlugin(),
IEventCodes.ADD_DEPLOYMENT_FOLDER_FAIL,
- "Error adding deployment folder to Deployment Scanner",
s.getException());
+ Messages.AddingJMXDeploymentFailed, s.getException());
ServerLogger.getDefault().log(event.getServer(), newStatus);
}
}
@@ -110,7 +122,7 @@
IDeployableServer ds = ServerConverter.getDeployableServer(server);
String deployFolder = ds.getDeployFolder();
String asURL = new File(deployFolder).toURL().toString();
- ObjectName name = new
ObjectName("jboss.deployment:flavor=URL,type=DeploymentScanner");
- connection.invoke(name, "addURL", new Object[] { asURL }, new String[]
{String.class.getName()});
+ ObjectName name = new
ObjectName(IJBossRuntimeConstants.DEPLOYMENT_SCANNER_MBEAN_NAME);
+ connection.invoke(name, IJBossRuntimeConstants.addURL, new Object[] { asURL }, new
String[] {String.class.getName()});
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,30 +1,21 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
/**
@@ -38,23 +29,23 @@
this.el = el;
}
public boolean supportsStartup() {
- return Boolean.parseBoolean(el.getAttribute("supportsStartup"));
+ return Boolean.parseBoolean(el.getAttribute("supportsStartup"));
//$NON-NLS-1$
}
public boolean supportsShutdown() {
- return Boolean.parseBoolean(el.getAttribute("supportsShutdown"));
+ return Boolean.parseBoolean(el.getAttribute("supportsShutdown"));
//$NON-NLS-1$
}
public String getName() {
- return el.getAttribute("name");
+ return el.getAttribute("name"); //$NON-NLS-1$
}
public String getId() {
- return el.getAttribute("id");
+ return el.getAttribute("id"); //$NON-NLS-1$
}
public IServerStatePoller createPoller() {
try {
- return (IServerStatePoller)el.createExecutableExtension("class");
+ return (IServerStatePoller)el.createExecutableExtension("class");
//$NON-NLS-1$
} catch( Exception e ) {
IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- "Error instantiating Server Poller: " + el.getAttribute("name"),
e);
+ NLS.bind(Messages.CannotLoadServerPoller, el.getAttribute("name")), e);
//$NON-NLS-1$
JBossServerCorePlugin.getDefault().getLog().log(s);
}
return null;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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 java.io.File;
@@ -24,6 +34,7 @@
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jdt.launching.VMRunnerConfiguration;
import org.eclipse.jst.server.core.ServerProfilerDelegate;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
@@ -33,10 +44,11 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public abstract class AbstractJBossLaunchConfigType extends
AbstractJavaLaunchConfigurationDelegate {
- public static final String SERVER_ID = "server-id";
+ public static final String SERVER_ID = "server-id"; //$NON-NLS-1$
// we have no need to do anything in pre-launch check
public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode,
IProgressMonitor monitor) throws CoreException {
@@ -125,15 +137,18 @@
protected static JBossServer findJBossServer(String serverId) throws CoreException {
if( serverId == null )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"No server specified"));
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.ServerNotFound, serverId)));
IServer s = ServerCore.findServer(serverId);
if( s == null )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Server Not Found"));
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.ServerNotFound, serverId)));
JBossServer jbs = ServerConverter.getJBossServer(s);
if( jbs == null )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Server Not Found"));
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.ServerNotFound, serverId)));
return jbs;
}
@@ -144,7 +159,8 @@
if( rt != null )
jbrt = (IJBossServerRuntime)rt.loadAdapter(IJBossServerRuntime.class, new
NullProgressMonitor());
if( jbrt == null )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Runtime Not Found"));
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.ServerRuntimeNotFound, server.getName())));
return jbrt;
}
@@ -164,7 +180,7 @@
IRuntimeClasspathEntry.BOOTSTRAP_CLASSES));
} catch (CoreException e) {
IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- "Unexpected Exception converting launch classpath: ", e);
+ Messages.LaunchConfigJREError, e);
JBossServerCorePlugin.getDefault().getLog().log(s);
}
}
@@ -172,8 +188,8 @@
protected static void addToolsJar(ArrayList<IRuntimeClasspathEntry> cp, IVMInstall
vmInstall) {
File f = vmInstall.getInstallLocation();
- File c1 = new File(f, "lib");
- File c2 = new File(c1, "tools.jar");
+ File c1 = new File(f, IConstants.LIB);
+ File c2 = new File(c1, IConstants.TOOLS_JAR);
if( c2.exists())
addCPEntry(cp, new Path(c2.getAbsolutePath()));
}
@@ -201,7 +217,7 @@
File libDir = new File(libPath);
File libs[] = libDir.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
- return (name != null && name.endsWith("jar"));
+ return (name != null && name.endsWith(IConstants.EXT_JAR));
}
});
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DeployableLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DeployableLaunchConfiguration.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DeployableLaunchConfiguration.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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;
@@ -33,9 +22,9 @@
public class DeployableLaunchConfiguration implements
ILaunchConfigurationDelegate {
- public static final String ACTION_KEY =
"org.jboss.ide.eclipse.as.core.server.stripped.DeployableLaunchConfiguration.Action";
- public static final String START = "_START_";
- public static final String STOP = "_STOP_";
+ public static final String ACTION_KEY =
"org.jboss.ide.eclipse.as.core.server.stripped.DeployableLaunchConfiguration.Action";
//$NON-NLS-1$
+ public static final String START = "_START_"; //$NON-NLS-1$
+ public static final String STOP = "_STOP_"; //$NON-NLS-1$
public static DeployableServerBehavior getServerBehavior(ILaunchConfiguration
configuration) throws CoreException {
IServer server = ServerUtil.getServer(configuration);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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 java.net.MalformedURLException;
@@ -45,24 +34,29 @@
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jdt.launching.StandardClasspathProvider;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.ServerUtil;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
public class JBossServerStartupLaunchConfiguration extends AbstractJBossLaunchConfigType
{
static final char[] INVALID_CHARS = new char[] {'\\', '/', ':',
'*', '?', '"', '<', '>', '|',
'\0', '@', '&'};
- static final String LAUNCH_TYPE =
"org.jboss.ide.eclipse.as.core.server.startupConfiguration";
- static final String DEFAULTS_SET = "jboss.defaults.been.set";
- static final String START_JAR_LOC = "bin" + Path.SEPARATOR +
"run.jar";
- static final String START_MAIN_TYPE = "org.jboss.Main";
+ static final String LAUNCH_TYPE =
"org.jboss.ide.eclipse.as.core.server.startupConfiguration"; //$NON-NLS-1$
+ static final String DEFAULTS_SET = "jboss.defaults.been.set"; //$NON-NLS-1$
+ static final String START_JAR_LOC = IJBossRuntimeResourceConstants.BIN + Path.SEPARATOR
+ IJBossRuntimeResourceConstants.START_JAR;
+ static final String START_MAIN_TYPE = IJBossRuntimeConstants.START_MAIN_TYPE;
public static ILaunchConfigurationWorkingCopy setupLaunchConfiguration(IServer server,
String action) throws CoreException {
ILaunchConfigurationWorkingCopy config = createLaunchConfiguration(server);
@@ -79,7 +73,8 @@
// Upgrade old launch configs
JBossServer jbs = findJBossServer(server.getId());
if( jbs == null )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Server " + server.getName() + " is not a proper JBoss Server"));
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.CannotSetUpImproperServer, server.getName())));
String cpProvider =
workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER,
(String)null);
if( !DEFAULT_CP_PROVIDER_ID.equals(cpProvider)) {
@@ -100,7 +95,8 @@
protected static void updateMandatedFields(ILaunchConfigurationWorkingCopy wc,
JBossServer jbs) throws CoreException{
String serverHome = getServerHome(jbs);
if( serverHome == null )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Server " + jbs.getServer().getName() + " is corrupt and the server home is
unable to be located."));
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.CannotLocateServerHome, jbs.getServer().getName())));
IRuntime rt = jbs.getServer().getRuntime();
IJBossServerRuntime jbrt = null;
@@ -108,43 +104,59 @@
jbrt = (IJBossServerRuntime)rt.getAdapter(IJBossServerRuntime.class);
if( jbrt == null )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Runtime not found"));
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.ServerRuntimeNotFound, jbs.getServer().getName())));
/* Args and vm args */
- String args = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
"");
- String vmArgs = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
"");
+ String args = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
""); //$NON-NLS-1$
+ String vmArgs = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
""); //$NON-NLS-1$
String host = jbs.getServer().getHost();
- String host2 = ArgsUtil.getValue(args, "-b", "--host");
+ String host2 = ArgsUtil.getValue(args,
+ IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT,
+ IJBossRuntimeConstants.STARTUP_ARG_HOST_LONG);
if( !host.equals(host2))
- args = ArgsUtil.setArg(args, "-b", "--host", host);
-
+ args = ArgsUtil.setArg(args,
+ IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT,
+ IJBossRuntimeConstants.STARTUP_ARG_HOST_LONG, host);
+
IJBossServerRuntime runtime = (IJBossServerRuntime)
jbs.getServer().getRuntime().loadAdapter(IJBossServerRuntime.class, null);
String config = runtime.getJBossConfiguration();
- args = ArgsUtil.setArg(args, "-c", "--configuration", config);
-
+ args = ArgsUtil.setArg(args,
+ IJBossRuntimeConstants.STARTUP_ARG_CONFIG_SHORT,
+ IJBossRuntimeConstants.STARTUP_ARG_CONFIG_LONG, config);
+
if( jbs.isMetadataConfig()) {
try {
IPath dest = JBossServerCorePlugin.getServerStateLocation(jbs.getServer());
dest = dest.append(IJBossServerConstants.CONFIG_IN_METADATA);
- args = ArgsUtil.setArg(args, null, "-Djboss.server.home.url",
dest.toFile().toURL().toString());
+ args = ArgsUtil.setArg(args, null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JBOSS_SERVER_HOME_URL,
+ dest.toFile().toURL().toString());
} catch( MalformedURLException murle) {}
}
- vmArgs= ArgsUtil.setArg(vmArgs, null, "-Djava.endorsed.dirs",
- "\"" +
runtime.getRuntime().getLocation().append("lib").append("endorsed") +
"\"", false);
+ vmArgs= ArgsUtil.setArg(vmArgs, null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.ENDORSED_DIRS,
+ runtime.getRuntime().getLocation().append(
+ IJBossRuntimeResourceConstants.LIB).append(
+ IJBossRuntimeResourceConstants.ENDORSED).toOSString(), true);
- if(
runtime.getRuntime().getLocation().append("bin").append("native").toFile().exists()
)
- vmArgs = ArgsUtil.setArg(vmArgs, null, "-Djava.library.path",
- "\"" +
runtime.getRuntime().getLocation().append("bin").append("native") +
"\"", false);
+ if( runtime.getRuntime().getLocation().append(
+ IJBossRuntimeResourceConstants.BIN).append(
+ IJBossRuntimeResourceConstants.NATIVE).toFile().exists() )
+ vmArgs = ArgsUtil.setArg(vmArgs, null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JAVA_LIB_PATH,
+ runtime.getRuntime().getLocation().append(IJBossRuntimeResourceConstants.BIN).append(
+ IJBossRuntimeResourceConstants.NATIVE).toOSString(), true);
/* Claspath */
List<String> cp =
wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, new
ArrayList<String>());
List<String> newCP = fixCP(cp, jbs);
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome +
Path.SEPARATOR + "bin");
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome +
Path.SEPARATOR + IJBossRuntimeResourceConstants.BIN);
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
args.trim());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs.trim());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, newCP);
@@ -175,11 +187,13 @@
protected static void forceDefaultsSet(ILaunchConfigurationWorkingCopy wc, IServer
server) throws CoreException {
JBossServer jbs = findJBossServer(server.getId());
if( jbs == null )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Server " + server.getName() + " is not a proper JBoss Server"));
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.CannotSetUpImproperServer, server.getName())));
String serverHome = getServerHome(jbs);
if( serverHome == null )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Server " + server.getName() + " is corrupt and the server home is unable
to be located."));
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.CannotLocateServerHome, server.getName())));
IRuntime rt = jbs.getServer().getRuntime();
String jrePath = null;
@@ -189,7 +203,8 @@
}
if( jbrt == null )
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Runtime not found"));
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.ServerRuntimeNotFound, jbs.getServer().getName())));
IVMInstall install = jbrt.getVM();
IPath path = JavaRuntime.newJREContainerPath(install);
@@ -198,7 +213,7 @@
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
getDefaultArgs(jbs));
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
jbrt.getDefaultRunVMArgs());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
START_MAIN_TYPE);
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome +
Path.SEPARATOR + "bin");
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome +
Path.SEPARATOR + IJBossRuntimeResourceConstants.BIN);
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jrePath);
wc.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES,
jbrt.getDefaultRunEnvVars());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, getClasspath(jbs));
@@ -215,7 +230,7 @@
addJREEntry(classpath, jbrt.getVM());
String version = jbs.getServer().getRuntime().getRuntimeType().getVersion();
- if( version.equals("4.0"))
+ if( version.equals(IJBossToolingConstants.AS_40))
addToolsJar(classpath, jbrt.getVM());
ArrayList<String> runtimeClassPaths = convertClasspath(classpath);
@@ -231,7 +246,9 @@
protected static String getDefaultArgs(JBossServer jbs) throws CoreException {
IJBossServerRuntime rt = findJBossServerRuntime(jbs.getServer());
if (rt != null) {
- return rt.getDefaultRunArgs() + " -b " + jbs.getServer().getHost();
+ return rt.getDefaultRunArgs() +
+ IJBossRuntimeConstants.SPACE + IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT +
+ IJBossRuntimeConstants.SPACE + jbs.getServer().getHost();
}
return null;
}
@@ -266,7 +283,7 @@
protected static String getValidLaunchConfigurationName(String s) {
if (s == null || s.length() == 0)
- return "1";
+ return "1"; //$NON-NLS-1$
int size = INVALID_CHARS.length;
for (int i = 0; i < size; i++) {
s = s.replace(INVALID_CHARS[i], '_');
@@ -314,7 +331,7 @@
}
/* For "restore defaults" functionality */
- private static final String DEFAULT_CP_PROVIDER_ID =
"org.jboss.ide.eclipse.as.core.server.internal.launch.serverClasspathProvider";
+ private static final String DEFAULT_CP_PROVIDER_ID =
"org.jboss.ide.eclipse.as.core.server.internal.launch.serverClasspathProvider";
//$NON-NLS-1$
public static class JBossServerDefaultClasspathProvider extends
StandardClasspathProvider {
public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration
configuration) throws CoreException {
boolean useDefault =
configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH,
true);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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;
@@ -16,8 +26,8 @@
import org.eclipse.wst.server.core.ServerCore;
public class RunJarContainerWrapper {
- public static final String ID =
"org.jboss.ide.eclipse.as.core.server.launch.runJarContainer";
- public static final String RESOLVER_ID =
"org.jboss.ide.eclipse.as.core.server.launch.runJarContainer.resolver";
+ public static final String ID =
"org.jboss.ide.eclipse.as.core.server.launch.runJarContainer"; //$NON-NLS-1$
+ public static final String RESOLVER_ID =
"org.jboss.ide.eclipse.as.core.server.launch.runJarContainer.resolver";
//$NON-NLS-1$
public static class RunJarContainerInitializer extends ClasspathContainerInitializer {
public void initialize(IPath containerPath, IJavaProject project)
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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 java.io.File;
@@ -41,16 +30,18 @@
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
public class StopLaunchConfiguration extends AbstractJBossLaunchConfigType {
- public static final String STOP_LAUNCH_TYPE =
"org.jboss.ide.eclipse.as.core.server.stopLaunchConfiguration";
- public static final String STOP_MAIN_TYPE = "org.jboss.Shutdown";
- public static final String STOP_JAR_LOC = "bin" + File.separator +
"shutdown.jar";
+ public static final String STOP_LAUNCH_TYPE =
"org.jboss.ide.eclipse.as.core.server.stopLaunchConfiguration"; //$NON-NLS-1$
+ public static final String STOP_MAIN_TYPE = IJBossRuntimeConstants.SHUTDOWN_MAIN_TYPE;
+ public static final String STOP_JAR_LOC = IJBossRuntimeResourceConstants.BIN +
File.separator + IJBossRuntimeResourceConstants.SHUTDOWN_JAR;
/* Returns whether termination was normal */
public static boolean stop(IServer server) {
@@ -69,7 +60,7 @@
} catch( CoreException ce ) {
// report it from here
IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- "Unexpected Exception launching stop server command: ", ce);
+ Messages.UnexpectedServerStopError, ce);
JBossServerCorePlugin.getDefault().getLog().log(s);
return false;
}
@@ -94,7 +85,7 @@
wc.setAttribute(SERVER_ID, server.getId());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
getDefaultArgs(jbs));
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
STOP_MAIN_TYPE);
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome +
Path.SEPARATOR + "bin");
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome +
Path.SEPARATOR + IJBossRuntimeResourceConstants.BIN);
ArrayList<IRuntimeClasspathEntry> classpath = new
ArrayList<IRuntimeClasspathEntry>();
addCPEntry(classpath, jbs, STOP_JAR_LOC);
addJREEntry(classpath, jbrt.getVM());
@@ -107,12 +98,13 @@
}
public static String getDefaultArgs(JBossServer jbs) throws CoreException {
- String args = "-S ";
- args += "-s " + jbs.getHost() + ":" + jbs.getJNDIPort() + "
";
- if( jbs.getUsername() != null && !jbs.getUsername().equals(""))
- args += "-u " + jbs.getUsername() + " ";
- if( jbs.getPassword() != null && !jbs.getUsername().equals(""))
- args += "-p " + jbs.getPassword() + " ";
+ IJBossRuntimeConstants c = new IJBossRuntimeConstants() {};
+ String args = c.SHUTDOWN_STOP_ARG + c.SPACE;
+ args += c.SHUTDOWN_SERVER_ARG + c.SPACE + jbs.getHost() + ":" +
jbs.getJNDIPort() + c.SPACE; //$NON-NLS-1$
+ if( jbs.getUsername() != null && !jbs.getUsername().equals(""))
//$NON-NLS-1$
+ args += c.SHUTDOWN_USER_ARG + c.SPACE + jbs.getUsername() + c.SPACE;
+ if( jbs.getPassword() != null && !jbs.getUsername().equals(""))
//$NON-NLS-1$
+ args += c.SHUTDOWN_PASS_ARG + c.SPACE + jbs.getPassword() + c.SPACE;
return args;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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 java.io.File;
@@ -35,13 +24,16 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
public class TwiddleLaunchConfiguration extends AbstractJBossLaunchConfigType {
- public static final String TWIDDLE_LAUNCH_TYPE =
"org.jboss.ide.eclipse.as.core.server.twiddleConfiguration";
+ public static final String TWIDDLE_LAUNCH_TYPE =
"org.jboss.ide.eclipse.as.core.server.twiddleConfiguration"; //$NON-NLS-1$
- protected static final String TWIDDLE_MAIN_TYPE =
"org.jboss.console.twiddle.Twiddle";
- protected static final String TWIDDLE_JAR_LOC = "bin" + File.separator +
"twiddle.jar";
+ protected static final String TWIDDLE_MAIN_TYPE =
IJBossRuntimeConstants.TWIDDLE_MAIN_TYPE;
+ protected static final String TWIDDLE_JAR_LOC =
+ IJBossRuntimeResourceConstants.BIN + File.separator +
IJBossRuntimeResourceConstants.TWIDDLE_JAR;
public static ILaunchConfigurationWorkingCopy createLaunchConfiguration(IServer server)
throws CoreException {
return createLaunchConfiguration(server, getDefaultArgs(server));
@@ -60,15 +52,15 @@
ILaunchConfigurationWorkingCopy wc = launchConfigType.newInstance(null, launchName);
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, args);
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
TWIDDLE_MAIN_TYPE);
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome +
Path.SEPARATOR + "bin");
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome +
Path.SEPARATOR + IJBossRuntimeResourceConstants.BIN);
wc.setAttribute(TwiddleLaunchConfiguration.SERVER_ID, server.getId());
ArrayList<IRuntimeClasspathEntry> classpath = new
ArrayList<IRuntimeClasspathEntry>();
addCPEntry(classpath, jbs, TWIDDLE_JAR_LOC);
// Twiddle requires more classes and I'm too lazy to actually figure OUT which ones
it needs.
- addDirectory (serverHome, classpath, "lib");
- addDirectory (serverHome, classpath, "lib" + File.separator +
"endorsed");
- addDirectory (serverHome, classpath, "client");
+ addDirectory (serverHome, classpath, IJBossRuntimeResourceConstants.LIB);
+ addDirectory (serverHome, classpath, IJBossRuntimeResourceConstants.LIB +
File.separator + IJBossRuntimeResourceConstants.ENDORSED);
+ addDirectory (serverHome, classpath, IJBossRuntimeResourceConstants.CLIENT);
addJREEntry(classpath, jbrt.getVM());
ArrayList<String> runtimeClassPaths = convertClasspath(classpath);
String cpKey = IJavaLaunchConfigurationConstants.ATTR_CLASSPATH;
@@ -79,13 +71,15 @@
}
public static String getDefaultArgs(IServer server) throws CoreException {
+ IJBossRuntimeConstants c = new IJBossRuntimeConstants() { };
JBossServer jbs = findJBossServer(server.getId());
- String twiddleArgs = "-s " + jbs.getHost() + ":"
- + jbs.getJNDIPort() + " -a jmx/rmi/RMIAdaptor ";
+ String twiddleArgs = c.SHUTDOWN_SERVER_ARG + c.SPACE + jbs.getHost() + ":"
//$NON-NLS-1$
+ + jbs.getJNDIPort() + c.SPACE + c.SHUTDOWN_ADAPTER_ARG
+ + c.SPACE + c.RMIAdaptor + c.SPACE;
if( jbs.getUsername() != null )
- twiddleArgs += "-u " + jbs.getUsername() + " ";
+ twiddleArgs += c.SHUTDOWN_USER_ARG + c.SPACE + jbs.getUsername() + c.SPACE;
if( jbs.getPassword() != null )
- twiddleArgs += "-p " + jbs.getPassword() + " ";
+ twiddleArgs += c.SHUTDOWN_PASS_ARG + c.SPACE + jbs.getPassword() + c.SPACE;
return twiddleArgs;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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 java.util.ArrayList;
@@ -38,6 +27,7 @@
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
public class TwiddleLauncher {
@@ -72,7 +62,7 @@
protected static ProcessData[] toProcessDatas(IProcess[] processes) {
ProcessData[] datas = new ProcessData[processes.length];
for( int i = 0; i < processes.length; i++ ) {
- datas[i] = new ProcessData(processes[i], "");
+ datas[i] = new ProcessData(processes[i], ""); //$NON-NLS-1$
datas[i].startListening();
}
return datas;
@@ -118,7 +108,8 @@
for( int i = 0; i < processes.length; i++ )
processes[i].getProcess().terminate();
} catch( DebugException e ) {
- IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Cannot
terminate twiddle process", e);
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ Messages.TerminateTwiddleFailed, e);
JBossServerCorePlugin.getDefault().getLog().log(s);
}
}
@@ -161,8 +152,8 @@
this.outMonitor = process.getStreamsProxy().getOutputStreamMonitor();
this.errMonitor = process.getStreamsProxy().getErrorStreamMonitor();
- out = "";
- err = "";
+ out = ""; //$NON-NLS-1$
+ err = ""; //$NON-NLS-1$
}
public void startListening() {
@@ -176,8 +167,8 @@
}
public void resetStrings() {
- out = "";
- err = "";
+ out = ""; //$NON-NLS-1$
+ err = ""; //$NON-NLS-1$
}
public void destroy() {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ModulePackager.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ModulePackager.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ModulePackager.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,12 +1,13 @@
-/***************************************************************************************************
-* Copyright (c) 2005 Eteration A.S. and Gorkem Ercan. All rights reserved. This program
and the
-* accompanying materials are 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: Gorkem Ercan - initial API and implementation
-*
-**************************************************************************************************/
+/*******************************************************************************
+ * 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.xpl;
import java.io.ByteArrayOutputStream;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,13 +1,13 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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
+/*******************************************************************************
+ * 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:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.xpl;
import java.io.BufferedOutputStream;
@@ -70,7 +70,7 @@
private static final File tempDir =
ServerPlugin.getInstance().getStateLocation().toFile();
- private static final String TEMPFILE_PREFIX = "tmp";
+ private static final String TEMPFILE_PREFIX = "tmp"; //$NON-NLS-1$
/**
* PublishUtil cannot be created. Use static methods.
@@ -96,7 +96,7 @@
File file = to.toFile();
// Change from original PublishUtil, will require
- tempFile = File.createTempFile(TEMPFILE_PREFIX, "." + to.getFileExtension(),
getTempFolder());
+ tempFile = File.createTempFile(TEMPFILE_PREFIX, "." + to.getFileExtension(),
getTempFolder()); //$NON-NLS-1$
out = new FileOutputStream(tempFile);
@@ -117,7 +117,7 @@
throw e;
} catch (Exception e) {
IPath path = mf.getModuleRelativePath().append(mf.getName());
- Trace.trace(Trace.SEVERE, "Error copying file: " + to.toOSString() + "
to " + path.toOSString(), e);
+ //Trace.trace(Trace.SEVERE, "Error copying file: " + to.toOSString() +
" to " + path.toOSString(), e);
throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorCopyingFile, path.toOSString(), e.getLocalizedMessage()), null));
} finally {
if (tempFile != null && tempFile.exists())
@@ -180,7 +180,7 @@
status.add(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorDeleting, dir.getAbsolutePath()), null));
monitor.done();
} catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error deleting directory " +
dir.getAbsolutePath(), e);
+ //Trace.trace(Trace.SEVERE, "Error deleting directory " +
dir.getAbsolutePath(), e);
status.add(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
e.getLocalizedMessage(), null));
}
@@ -437,14 +437,14 @@
}
private void deleteFile2(IPath path, IModuleFile file) throws CoreException {
- Trace.trace(Trace.PUBLISHING, "Deleting: " + file.getName() + " from
" + path.toString());
+ //Trace.trace(Trace.PUBLISHING, "Deleting: " + file.getName() + " from
" + path.toString());
IPath path2 = path.append(file.getModuleRelativePath()).append(file.getName());
if (path2.toFile().exists() && !path2.toFile().delete())
throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorDeleting, path2), null));
}
private void copyFile(IModuleFile mf, IPath path) throws CoreException {
- Trace.trace(Trace.PUBLISHING, "Copying: " + mf.getName() + " to " +
path.toString());
+ //Trace.trace(Trace.PUBLISHING, "Copying: " + mf.getName() + " to "
+ path.toString());
IFile file = (IFile) mf.getAdapter(IFile.class);
if (file != null)
@@ -490,7 +490,7 @@
private IStatus[] copy(IModuleResource resource, IPath path, IProgressMonitor monitor)
{
String name = resource.getName();
- Trace.trace(Trace.PUBLISHING, "Copying: " + name + " to " +
path.toString());
+ //Trace.trace(Trace.PUBLISHING, "Copying: " + name + " to " +
path.toString());
List status = new ArrayList(2);
if (resource instanceof IModuleFolder) {
IModuleFolder folder = (IModuleFolder) resource;
@@ -537,7 +537,7 @@
File tempFile = null;
try {
File file = path.toFile();
- tempFile = File.createTempFile(TEMPFILE_PREFIX, "." +
path.getFileExtension(), getTempFolder());
+ tempFile = File.createTempFile(TEMPFILE_PREFIX, "." +
path.getFileExtension(), getTempFolder()); //$NON-NLS-1$
BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(tempFile));
ZipOutputStream zout = new ZipOutputStream(bout);
addZipEntries(zout, resources);
@@ -547,7 +547,7 @@
} catch (CoreException e) {
return new IStatus[] { e.getStatus() };
} catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error zipping", e);
+ //Trace.trace(Trace.SEVERE, "Error zipping", e);
return new Status[] { new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorCreatingZipFile, path.lastSegment(), e.getLocalizedMessage()), e)
};
} finally {
if (tempFile != null && tempFile.exists())
@@ -568,7 +568,7 @@
IPath path = mf.getModuleRelativePath().append(mf.getName());
String entryPath = path.toPortableString();
- if (!entryPath.endsWith("/"))
+ if (!entryPath.endsWith("/")) //$NON-NLS-1$
entryPath += '/';
ZipEntry ze = new ZipEntry(entryPath);
@@ -682,7 +682,7 @@
}
return Status.OK_STATUS;
} catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error copying file", e);
+ //Trace.trace(Trace.SEVERE, "Error copying file", e);
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorCopyingFile, new String[] {to, e.getLocalizedMessage()}), e);
} finally {
try {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ServerSourcePathComputerDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ServerSourcePathComputerDelegate.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ServerSourcePathComputerDelegate.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,12 +1,13 @@
-/***************************************************************************************************
- * Copyright (c) 2005 Eteration A.S. and Gorkem Ercan. All rights reserved. This program
and the
- * accompanying materials are 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
+/*******************************************************************************
+ * 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: Gorkem Ercan - initial API and implementation
- *
-
**************************************************************************************************/
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.xpl;
import java.util.ArrayList;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.util;
import java.util.ArrayList;
@@ -28,14 +17,19 @@
public class ArgsUtil {
public static final Integer NO_VALUE = new Integer(-1);
-
+ public static final String EQ = "="; //$NON-NLS-1$
+ public static final String SPACE=" "; //$NON-NLS-1$
+ public static final String VMO = "-D"; //$NON-NLS-1$
+ public static final String EMPTY=""; //$NON-NLS-1$
+ public static final String QUOTE="\""; //$NON-NLS-1$
+
public static Map<String, Object> getSystemProperties(String argString) {
String[] args = parse(argString);
HashMap<String, Object> map = new HashMap<String, Object>();
for( int i = 0; i < args.length; i++ ) {
- if( args[i].startsWith("-D")) {
- int eq = args[i].indexOf('=');
+ if( args[i].startsWith(VMO)) {
+ int eq = args[i].indexOf(EQ);
if( eq != -1 ) {
map.put(args[i].substring(2, eq),
args[i].substring(eq+1));
@@ -55,8 +49,8 @@
for( int i = 0; i < args.length; i++ ) {
if( args[i].equals(shortOpt) && i+1 < args.length)
return args[i+1];
- if( longOpt != null && args[i].startsWith(longOpt + "="))
- return args[i].substring(args[i].indexOf('=') + 1);
+ if( longOpt != null && args[i].startsWith(longOpt + EQ))
+ return args[i].substring(args[i].indexOf(EQ) + 1);
}
return null;
}
@@ -69,7 +63,7 @@
int current = 0;
boolean inQuotes = false;
boolean done = false;
- String tmp = "";
+ String tmp = EMPTY;
StringBuffer buf = new StringBuffer();
while( !done ) {
@@ -110,34 +104,34 @@
}
public static String setArg(String allArgs, String shortOpt, String longOpt, String
value ) {
- if( value.contains(" "))
- value = "\"" + value + "\"";
+ if( value.contains(SPACE))
+ value = QUOTE + value + QUOTE;
return setArg(allArgs, shortOpt, longOpt, value, false);
}
public static String setArg(String allArgs, String shortOpt, String longOpt, String
value, boolean addQuotes ) {
if( addQuotes )
- value = "\"" + value + "\"";
+ value = QUOTE + value + QUOTE;
boolean found = false;
String[] args = parse(allArgs);
- String retVal = "";
+ String retVal = EMPTY;
for( int i = 0; i < args.length; i++ ) {
if( args[i].equals(shortOpt)) {
args[i+1] = value;
- retVal += args[i] + " " + args[++i] + " ";
+ retVal += args[i] + SPACE + args[++i] + SPACE;
found = true;
- } else if( longOpt != null && args[i].startsWith(longOpt + "=")) {
- args[i] = longOpt + "=" + value;
- retVal += args[i] + " ";
+ } else if( longOpt != null && args[i].startsWith(longOpt + EQ)) {
+ args[i] = longOpt + EQ + value;
+ retVal += args[i] + SPACE;
found = true;
} else {
- retVal += args[i] + " ";
+ retVal += args[i] + SPACE;
}
}
// turn this to a retval;
if( !found )
- retVal = retVal + longOpt + "=" + value;
+ retVal = retVal + longOpt + EQ + value;
return retVal;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/FileUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/FileUtil.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/FileUtil.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.util;
import java.io.File;
@@ -30,7 +19,9 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
public class FileUtil {
@@ -153,16 +144,20 @@
public void fileCopied(File source, File dest, boolean result,
Exception e) {
if(!result)
- errors.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Error
copying file " + source.toString() + " to " + dest.toString(), e));
+ errors.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.CopyFileError, source.toString(), dest.toString()), e));
}
public void fileDeleted(File file, boolean result, Exception e) {
if(!result)
- errors.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Error
deleting file " + file.toString(), e));
+ errors.add(new Status(IStatus.ERROR,
+ JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.DeleteFolderError, file.toString(), e)));
}
public void folderDeleted(File file, boolean result, Exception e) {
if(!result)
- errors.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Error
deleting folder " + file.toString(), e));
+ errors.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.DeleteFolderError, file.toString()), e));
}
public IStatus[] getStatuses() {
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IConstants.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IConstants.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IConstants.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * 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.util;
+
+public interface IConstants extends
+ IJBossRuntimeConstants,
+ IWTPConstants,
+ IJBossToolingConstants,
+ IJBossRuntimeResourceConstants {
+
+}
\ No newline at end of file
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * 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.util;
+
+public interface IJBossRuntimeConstants {
+ // Launch configuration constants / Command Line Args
+ public static final String SPACE = " ";//$NON-NLS-1$
+ public static final String SYSPROP = "-D";//$NON-NLS-1$
+ public static final String EQ = "="; //$NON-NLS-1$
+ public static final String QUOTE = "\""; //$NON-NLS-1$
+ public static final String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
//$NON-NLS-1$
+ public static final String JBOSS_SERVER_HOME_URL = "jboss.server.base.url";
//$NON-NLS-1$
+ public static final String JBOSS_SERVER_BASE_DIR = "jboss.server.base.dir";
//$NON-NLS-1$
+ public static final String JBOSS_SERVER_NAME = "jboss.server.name";
//$NON-NLS-1$
+ public static final String JBOSS_HOME_DIR = "jboss.home.dir"; //$NON-NLS-1$
+ public static final String ENDORSED_DIRS = "java.endorsed.dirs";
//$NON-NLS-1$
+ public static final String JAVA_LIB_PATH = "java.library.path"; //$NON-NLS-1$
+
+ public static final String SHUTDOWN_SERVER_ARG = "-s";//$NON-NLS-1$
+ public static final String SHUTDOWN_USER_ARG = "-u";//$NON-NLS-1$
+ public static final String SHUTDOWN_PASS_ARG = "-p";//$NON-NLS-1$
+ public static final String SHUTDOWN_ADAPTER_ARG = "-a";//$NON-NLS-1$
+ public static final String SHUTDOWN_STOP_ARG = "-S"; //$NON-NLS-1$
+ public static final String STARTUP_ARG_HOST_SHORT = "-b"; //$NON-NLS-1$
+ public static final String STARTUP_ARG_HOST_LONG = "--host"; //$NON-NLS-1$
+ public static final String STARTUP_ARG_CONFIG_SHORT = "-c"; //$NON-NLS-1$
+ public static final String STARTUP_ARG_CONFIG_LONG = "--configuration";
//$NON-NLS-1$
+ public static final String SERVER_ARG = "-server"; //$NON-NLS-1$
+ public static final String DEFAULT_MEM_ARGS = "-Xms256m -Xmx512m
-XX:MaxPermSize=256m "; //$NON-NLS-1$
+ public static final String SUN_CLIENT_GC_ARG =
"sun.rmi.dgc.client.gcInterval"; //$NON-NLS-1$
+ public static final String SUN_SERVER_GC_ARG =
"sun.rmi.dgc.server.gcInterval"; //$NON-NLS-1$
+ public static final String JAVA_PREFER_IP4_ARG = "java.net.preferIPv4Stack";
//$NON-NLS-1$
+ public static final String PROGRAM_NAME_ARG = "program.name"; //$NON-NLS-1$
+
+ /* JBoss classes and methods for reflection */
+ public static final String TWIDDLE_MAIN_TYPE =
"org.jboss.console.twiddle.Twiddle"; //$NON-NLS-1$
+ public static final String SHUTDOWN_MAIN_TYPE = "org.jboss.Shutdown";
//$NON-NLS-1$
+ public static final String START_MAIN_TYPE = "org.jboss.Main"; //$NON-NLS-1$
+ public static final String CLASS_SIMPLE_PRINCIPAL =
"org.jboss.security.SimplePrincipal"; //$NON-NLS-1$
+ public static final String CLASS_SECURITY_ASSOCIATION =
"org.jboss.security.SecurityAssociation"; //$NON-NLS-1$
+ public static final String METHOD_SET_CREDENTIAL = "setCredential";
//$NON-NLS-1$
+ public static final String METHOD_SET_PRINCIPAL = "setPrincipal";
//$NON-NLS-1$
+
+ /* JNDI Properties */
+ public static final String NAMING_FACTORY_KEY = "java.naming.factory.initial";
//$NON-NLS-1$
+ public static final String NAMING_FACTORY_VALUE =
"org.jnp.interfaces.NamingContextFactory"; //$NON-NLS-1$
+ public static final String NAMING_FACTORY_PKGS =
"java.naming.factory.url.pkgs"; //$NON-NLS-1$
+ public static final String NAMING_FACTORY_INTERFACES =
"org.jboss.naming:org.jnp.interfaces"; //$NON-NLS-1$
+ public static final String NAMING_FACTORY_PROVIDER_URL =
"java.naming.provider.url"; //$NON-NLS-1$
+ public static final String JNP_DISABLE_DISCOVERY = "jnp.disableDiscovery";
//$NON-NLS-1$
+
+ /* JMX Constants */
+ public static final String RMIAdaptor = "jmx/invoker/RMIAdaptor";
//$NON-NLS-1$
+ public static final String STARTED_METHOD = "Started"; //$NON-NLS-1$
+ public static final String SYSTEM_MBEAN = "jboss.system:type=Server";
//$NON-NLS-1$
+ public static final String
DEPLOYMENT_SCANNER_MBEAN_NAME="jboss.deployment:flavor=URL,type=DeploymentScanner";
//$NON-NLS-1$
+ public static final String STOP = "stop"; //$NON-NLS-1$
+ public static final String START = "start"; //$NON-NLS-1$
+ public static final String addURL = "addURL"; //$NON-NLS-1$
+
+}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * 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.util;
+
+public interface IJBossRuntimeResourceConstants {
+ /* Files and folders that are in various JBoss installations */
+ public static final String SERVER = "server"; //$NON-NLS-1$
+ public static final String BIN = "bin"; //$NON-NLS-1$
+ public static final String CLIENT = "client"; //$NON-NLS-1$
+ public static final String LIB = "lib"; //$NON-NLS-1$
+ public static final String DEPLOY = "deploy"; //$NON-NLS-1$
+ public static final String COMMON = "common"; //$NON-NLS-1$
+ public static final String DEPLOYERS = "deployers"; //$NON-NLS-1$
+ public static final String WORK = "work"; //$NON-NLS-1$
+ public static final String DATA = "data"; //$NON-NLS-1$
+ public static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
+ public static final String FOLDER_TMP = "tmp"; //$NON-NLS-1$
+ public static final String FOLDER_LOG = "log"; //$NON-NLS-1$
+ public static final String ENDORSED = "endorsed"; //$NON-NLS-1$
+ public static final String NATIVE = "native"; //$NON-NLS-1$
+ public static final String[] JBOSS_TEMPORARY_FOLDERS = new String[] { WORK, DATA,
FOLDER_TMP, FOLDER_LOG};
+
+ public static final String TWIDDLE_JAR = "twiddle.jar"; //$NON-NLS-1$
+ public static final String SHUTDOWN_JAR = "shutdown.jar"; //$NON-NLS-1$
+ public static final String START_JAR = "run.jar"; //$NON-NLS-1$
+ public static final String TOOLS_JAR = "tools.jar"; //$NON-NLS-1$
+
+
+ public static final String JSF_LIB = "jsf-libs"; //$NON-NLS-1$
+ public static final String JBOSSWEB_TOMCAT55_SAR = "jbossweb-tomcat55.sar";
//$NON-NLS-1$
+ public static final String JBOSSWEB_SAR = "jbossweb.sar"; //$NON-NLS-1$
+ public static final String JBOSS_WEB_SERVICE_JAR = "jboss-web-service.jar";
//$NON-NLS-1$
+ public static final String EJB3_DEPLOYER = "ejb3.deployer"; //$NON-NLS-1$
+ public static final String WEBBEANS_DEPLOYER = "webbeans.deployer";
//$NON-NLS-1$
+ public static final String AS5_AOP_DEPLOYER = "jboss-aop-jboss5.deployer";
//$NON-NLS-1$
+ public static final String AOP_JDK5_DEPLOYER = "jboss-aop-jdk50.deployer";
//$NON-NLS-1$
+ public static final String JBOSS_AOP_JDK5_JAR = "jboss-aop-jdk50.jar";
//$NON-NLS-1$
+ public static final String JBOSS_WEB_DEPLOYER = "jboss-web.deployer";
//$NON-NLS-1$
+ public static final String JSP_API_JAR = "jsp-api.jar"; //$NON-NLS-1$
+ public static final String SERVLET_API_JAR = "servlet-api.jar"; //$NON-NLS-1$
+ public static final String JSF_API_JAR = "jsf-api.jar"; //$NON-NLS-1$
+ public static final String JSF_IMPL_JAR = "jsf-impl.jar"; //$NON-NLS-1$
+ public static final String JBOSS_J2EE_JAR = "jboss-j2ee.jar"; //$NON-NLS-1$
+ public static final String JBOSS_EJB3X_JAR = "jboss-ejb3x.jar"; //$NON-NLS-1$
+ public static final String JBOSS_EJB3_JAR = "jboss-ejb3.jar"; //$NON-NLS-1$
+ public static final String JBOSS_ANNOTATIONS_EJB3_JAR =
"jboss-annotations-ejb3.jar"; //$NON-NLS-1$
+ public static final String EJB3_PERSISTENCE_JAR = "ejb3-persistence.jar";
//$NON-NLS-1$
+ public static final String JBOSS_ASPECT_LIBRARY_JDK5_0 =
"jboss-aspect-library-jdk50.jar"; //$NON-NLS-1$
+ public static final String HIBERNATE_CLIENT_JAR = "hibernate-client.jar";
//$NON-NLS-1$
+ public static final String JBOSSALL_CLIENT_JAR = "jbossall-client.jar";
//$NON-NLS-1$
+ public static final String JBOSSWEB_TOMCAT_50_SAR = "jbossweb-tomcat50.sar";
//$NON-NLS-1$
+ public static final String JSR299_API_JAR = "jsr299-api.jar"; //$NON-NLS-1$
+ public static final String JNDI_PROPERTIES = "jndi.properties"; //$NON-NLS-1$
+
+ public static final String JAVAX_SERVLET_JAR = "javax.servlet.jar";
//$NON-NLS-1$
+ public static final String JAVAX_SERVLET_JSP_JAR = "javax.servlet.jsp.jar";
//$NON-NLS-1$
+
+ public static final String CONFIG_DEFAULT = "default"; //$NON-NLS-1$
+ public static final String DEFAULT_CONFIGURATION = CONFIG_DEFAULT;
+ public static final String CONFIG_ALL = "all"; //$NON-NLS-1$
+ public static final String CONFIG_MINIMAL = "minimal"; //$NON-NLS-1$
+}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * 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.util;
+
+import org.eclipse.core.runtime.IPath;
+import org.jboss.ide.eclipse.as.core.Messages;
+
+public interface IJBossToolingConstants {
+ /* Server runtime types */
+ public static final String AS_32 = "org.jboss.ide.eclipse.as.runtime.32";
//$NON-NLS-1$
+ public static final String AS_40 = "org.jboss.ide.eclipse.as.runtime.40";
//$NON-NLS-1$
+ public static final String AS_42 = "org.jboss.ide.eclipse.as.runtime.42";
//$NON-NLS-1$
+ public static final String AS_50 = "org.jboss.ide.eclipse.as.runtime.50";
//$NON-NLS-1$
+ public static final String EAP_43 = "org.jboss.ide.eclipse.as.runtime.eap.43";
//$NON-NLS-1$
+
+ /* Version Strings */
+ public static final String V3_0 = "3.0"; //$NON-NLS-1$
+ public static final String V3_2 = "3.2"; //$NON-NLS-1$
+ public static final String V4_0 = "4.0"; //$NON-NLS-1$
+ public static final String V4_2 = "4.2"; //$NON-NLS-1$
+ public static final String V5_0 = "5.0"; //$NON-NLS-1$
+
+
+ /* Files or folders inside the TOOLING */
+ public static final String LOG = "log"; //$NON-NLS-1$
+ public static final String TEMP_DEPLOY = "tempDeploy"; //$NON-NLS-1$
+ public static final String JBOSSTOOLS_TMP = "jbosstoolsTemp"; //$NON-NLS-1$
+ public static final String TMP = "tmp"; //$NON-NLS-1$
+ public static final String CONFIG_IN_METADATA = "jbossConfig"; //$NON-NLS-1$
+ public static final String XPATH_FILE_NAME = "xpaths.xml"; //$NON-NLS-1$
+
+
+ // Inside the plugin (not metadata)
+ public static final String PROPERTIES = "properties"; //$NON-NLS-1$
+ public static final String DEFAULT_PROPS_32 =
"jboss.32.default.ports.properties"; //$NON-NLS-1$
+ public static final String DEFAULT_PROPS_40 =
"jboss.40.default.ports.properties"; //$NON-NLS-1$
+ public static final String DEFAULT_PROPS_42 =
"jboss.42.default.ports.properties"; //$NON-NLS-1$
+ public static final String DEFAULT_PROPS_50 =
"jboss.50.default.ports.properties"; //$NON-NLS-1$
+ public static final String DEFAULT_PROPS_EAP_43 =
"jboss.eap.43.default.ports.properties"; //$NON-NLS-1$
+
+ // Poller constants
+ public static final String DEFAULT_STARTUP_POLLER =
"org.jboss.ide.eclipse.as.core.runtime.server.JMXPoller"; //$NON-NLS-1$
+ public static final String DEFAULT_SHUTDOWN_POLLER =
"org.jboss.ide.eclipse.as.core.runtime.server.processTerminatedPoller";
//$NON-NLS-1$
+
+ /*
+ * Property keys stored in the server object
+ */
+ public static final String USE_METADATA_CONFIG =
"IJBossServerConstants.useMetadataConfig"; //$NON-NLS-1$
+ public static final String STARTUP_POLLER_KEY =
"org.jboss.ide.eclipse.as.core.server.attributes.startupPollerKey";
//$NON-NLS-1$
+ public static final String SHUTDOWN_POLLER_KEY =
"org.jboss.ide.eclipse.as.core.server.attributes.shutdownPollerKey";
//$NON-NLS-1$
+ public static final String SERVER_USERNAME =
"org.jboss.ide.eclipse.as.core.server.userName"; //$NON-NLS-1$
+ public static final String SERVER_PASSWORD =
"org.jboss.ide.eclipse.as.core.server.password"; //$NON-NLS-1$
+ public static final String JNDI_PORT =
"org.jboss.ide.eclipse.as.core.server.jndiPort"; //$NON-NLS-1$
+ public static final String WEB_PORT =
"org.jboss.ide.eclipse.as.core.server.webPort"; //$NON-NLS-1$
+ public static final String JNDI_PORT_DETECT =
"org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect"; //$NON-NLS-1$
+ public static final String WEB_PORT_DETECT=
"org.jboss.ide.eclipse.as.core.server.webPortAutoDetect"; //$NON-NLS-1$
+ public static final String JNDI_PORT_DETECT_XPATH =
"org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect.XPath"; //$NON-NLS-1$
+ public static final String WEB_PORT_DETECT_XPATH =
"org.jboss.ide.eclipse.as.core.server.webPortAutoDetect.XPath"; //$NON-NLS-1$
+ public static final String JNDI_PORT_DEFAULT_XPATH = Messages.Ports + IPath.SEPARATOR +
"JNDI"; //$NON-NLS-1$
+ public static final String WEB_PORT_DEFAULT_XPATH = Messages.Ports + IPath.SEPARATOR +
"JBoss Web"; //$NON-NLS-1$
+ public static final int JNDI_DEFAULT_PORT = 1099;
+ public static final int JBOSS_WEB_DEFAULT_PORT = 8080;
+
+}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IWTPConstants.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IWTPConstants.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IWTPConstants.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.util;
+
+public interface IWTPConstants {
+ /* Facet / Module Names */
+ public static final String FACET_JST_JAVA = "jst.java"; //$NON-NLS-1$
+ public static final String FACET_WEB = "jst.web";//$NON-NLS-1$
+ public static final String FACET_EJB = "jst.ejb";//$NON-NLS-1$
+ public static final String FACET_EAR = "jst.ear";//$NON-NLS-1$
+ public static final String FACET_UTILITY = "jst.utility";//$NON-NLS-1$
+ public static final String FACET_CONNECTOR = "jst.connector";//$NON-NLS-1$
+ public static final String FACET_APP_CLIENT = "jst.appclient";//$NON-NLS-1$
+ public static final String FACET_ESB = "jst.jboss.esb";//$NON-NLS-1$
+
+ public static final String EXT_JAR = ".jar"; //$NON-NLS-1$
+ public static final String EXT_ESB = ".esb"; //$NON-NLS-1$
+ public static final String EXT_RAR = ".rar"; //$NON-NLS-1$
+ public static final String EXT_WAR = ".war"; //$NON-NLS-1$
+ public static final String EXT_EAR = ".ear"; //$NON-NLS-1$
+ public static final String EXT_XML = ".xml"; //$NON-NLS-1$
+
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBossServerType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBossServerType.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBossServerType.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -8,14 +8,16 @@
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-
package org.jboss.ide.eclipse.as.core.util;
import java.io.File;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.ide.eclipse.as.core.Messages;
+
public class JBossServerType {
- private static final String SYSTEM_JAR_NAME = "twiddle.jar";
+ private static final String SYSTEM_JAR_NAME = "twiddle.jar"; //$NON-NLS-1$
private String type;
private String jbossSystemJarPath;
private String[] versions = new String[0];
@@ -27,24 +29,24 @@
}
public static final JBossServerType AS = new JBossServerType(
- "AS",
- "bin"+File.separatorChar + SYSTEM_JAR_NAME,
- new String[]{"5.0", "4.2", "4.0", "3.2"});
+ "AS", //$NON-NLS-1$
+ "bin"+File.separatorChar + SYSTEM_JAR_NAME, //$NON-NLS-1$
+ new String[]{"5.0", "4.2", "4.0", "3.2"});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
public static final JBossServerType EAP = new JBossServerType(
- "EAP",
- "jboss-as" + File.separatorChar + "bin"+ File.separatorChar +
SYSTEM_JAR_NAME,
- new String[]{"4.2","4.3"});
+ "EAP", //$NON-NLS-1$
+ "jboss-as" + File.separatorChar + "bin"+ File.separatorChar +
SYSTEM_JAR_NAME, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[]{"4.2","4.3"}); //$NON-NLS-1$ //$NON-NLS-2$
public static final JBossServerType SOAP = new JBossServerType(
- "SOA-P",
- "jboss-as" + File.separatorChar + "bin"+ File.separatorChar +
SYSTEM_JAR_NAME,
- new String[]{"4.3"});
+ "SOA-P", //$NON-NLS-1$
+ "jboss-as" + File.separatorChar + "bin"+ File.separatorChar +
SYSTEM_JAR_NAME, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[]{"4.3"}); //$NON-NLS-1$
public static final JBossServerType UNKNOWN = new JBossServerType(
- "UNKNOWN",
- "",
- new String[]{"5.0", "4.3", "4.2", "4.0",
"3.2"});
+ "UNKNOWN", //$NON-NLS-1$
+ "", //$NON-NLS-1$
+ new String[]{"5.0", "4.3", "4.2", "4.0",
"3.2"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
public String toString() {
return type;
@@ -58,7 +60,8 @@
} else if(SOAP.type.equals(name)) {
return SOAP;
}
- throw new IllegalArgumentException("Name '" + name + "' cannot
be converted to ServerType");
+ throw new IllegalArgumentException(
+ NLS.bind(Messages.ServerTypeDiscovererFail, name));
}
public String[] getVersions() {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.util;
import java.util.ArrayList;
@@ -9,6 +19,7 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IModuleType;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
public class ModuleUtil {
public static ArrayList<IModule[]> getShallowChildren(IServer server, IModule[]
root) {
@@ -40,7 +51,7 @@
int last = module.length-1;
if (module[last] != null && module[last].getModuleType() != null) {
IModuleType moduleType = module[last].getModuleType();
- if("jst.ear".equals(moduleType.getId())) { //$NON-NLS-1$
+ if(IJBossServerConstants.FACET_EAR.equals(moduleType.getId())) {
IEnterpriseApplication enterpriseApplication = (IEnterpriseApplication) module[0]
.loadAdapter(IEnterpriseApplication.class, null);
if (enterpriseApplication != null) {
@@ -50,7 +61,7 @@
}
}
}
- else if ("jst.web".equals(moduleType.getId())) { //$NON-NLS-1$
+ else if (IJBossServerConstants.FACET_WEB.equals(moduleType.getId())) {
IWebModule webModule = (IWebModule) module[last].loadAdapter(IWebModule.class,
null);
if (webModule != null) {
IModule[] modules = webModule.getModules();
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerBeanLoader.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerBeanLoader.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerBeanLoader.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -8,7 +8,6 @@
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-
package org.jboss.ide.eclipse.as.core.util;
import java.io.File;
@@ -23,7 +22,7 @@
*/
public class ServerBeanLoader {
- public static final String SOAP_JBPM_JPDL_PATH = "jbpm-jpdl";
+ public static final String SOAP_JBPM_JPDL_PATH = "jbpm-jpdl"; //$NON-NLS-1$
public JBossServerType getServerType(File location) {
File asSystemJar = new File(location, JBossServerType.AS.getSystemJarPath());
@@ -52,10 +51,10 @@
if(systemJarFile.canRead()) {
try {
ZipFile jar = new ZipFile(systemJarFile);
- ZipEntry manifest = jar.getEntry("META-INF/MANIFEST.MF");
+ ZipEntry manifest = jar.getEntry("META-INF/MANIFEST.MF"); //$NON-NLS-1$
Properties props = new Properties();
props.load(jar.getInputStream(manifest));
- version = (String)props.get("Specification-Version");
+ version = (String)props.get("Specification-Version"); //$NON-NLS-1$
} catch (IOException e) {
// version = ""
}
@@ -64,22 +63,22 @@
}
public String getServerVersion(String version) {
- if(version==null) return "";
+ if(version==null) return ""; //$NON-NLS-1$
String[] versions = JBossServerType.UNKNOWN.getVersions();
- String adapterVersion = "";
+ String adapterVersion = ""; //$NON-NLS-1$
// trying to match adapter version by X.X version
for (String currentVersion : versions) {
- String pattern = currentVersion.replace(".", "\\.") +
".*";
+ String pattern = currentVersion.replace(".", "\\.") +
".*"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if(version.matches(pattern)) {
adapterVersion = currentVersion;
break;
}
}
- if("".equals(adapterVersion)) {
+ if("".equals(adapterVersion)) { //$NON-NLS-1$
// trying to match by major version
for (String currentVersion : versions) {
- String pattern = currentVersion.substring(0, 2).replace(".",
"\\.") + ".*";
+ String pattern = currentVersion.substring(0, 2).replace(".",
"\\.") + ".*"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if(version.matches(pattern)) {
adapterVersion = currentVersion;
break;
@@ -91,20 +90,20 @@
public String getAdapterVersion(String version) {
String[] versions = JBossServerType.UNKNOWN.getVersions();
- String adapterVersion = "";
+ String adapterVersion = ""; //$NON-NLS-1$
// trying to match adapter version by X.X version
for (String currentVersion : versions) {
- String pattern = currentVersion.replace(".", "\\.") +
".*";
+ String pattern = currentVersion.replace(".", "\\.") +
".*"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if(version.matches(pattern)) {
adapterVersion = currentVersion;
break;
}
}
- if("".equals(adapterVersion)) {
+ if("".equals(adapterVersion)) { //$NON-NLS-1$
// trying to match by major version
for (String currentVersion : versions) {
- String pattern = currentVersion.substring(0, 2).replace(".",
"\\.") + ".*";
+ String pattern = currentVersion.substring(0, 2).replace(".",
"\\.") + ".*"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if(version.matches(pattern)) {
adapterVersion = currentVersion;
break;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerConverter.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerConverter.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerConverter.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,24 +1,13 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, 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.
- */
+/*******************************************************************************
+ * 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.util;
import java.util.ArrayList;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2009-04-24
09:00:34 UTC (rev 14881)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2009-04-24
09:14:47 UTC (rev 14882)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.util;
import java.io.File;
@@ -9,13 +19,22 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
public class ServerUtil {
-
+ public static IPath getServerStateLocation(IServer server) {
+ return server == null ? JBossServerCorePlugin.getDefault().getStateLocation() :
+ getServerStateLocation(server.getId());
+ }
+
+ public static IPath getServerStateLocation(String serverID) {
+ return serverID == null ? JBossServerCorePlugin.getDefault().getStateLocation() :
+ JBossServerCorePlugin.getDefault().getStateLocation()
+ .append(serverID.replace(' ', '_'));
+ }
+
public static IPath makeRelative(IJBossServerRuntime rt, IPath p) {
if( p.isAbsolute() && rt != null) {
if(rt.getRuntime().getLocation().isPrefixOf(p)) {