Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Kolosowski2004-05-22 07:19:21 -0400
committerKonrad Kolosowski2004-05-22 07:19:21 -0400
commit8154b318dc14aaab8c898c409d7e3579e71f97b7 (patch)
tree309e552bb6e56e4ecd4793771adff3fe8e68765f /org.eclipse.help.appserver
parente8c97ea3c246ba6c4b0880e9c5dae781f14811db (diff)
downloadeclipse.platform.ua-8154b318dc14aaab8c898c409d7e3579e71f97b7.tar.gz
eclipse.platform.ua-8154b318dc14aaab8c898c409d7e3579e71f97b7.tar.xz
eclipse.platform.ua-8154b318dc14aaab8c898c409d7e3579e71f97b7.zip
code formattingv20040522
Diffstat (limited to 'org.eclipse.help.appserver')
-rw-r--r--org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/AppserverPlugin.java5
-rw-r--r--org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/AppserverResources.java102
-rw-r--r--org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/DevClassPathHelper.java21
-rw-r--r--org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/IWebappServer.java46
-rw-r--r--org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/PluginClassLoaderWrapper.java1
-rw-r--r--org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/WebappManager.java92
6 files changed, 115 insertions, 152 deletions
diff --git a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/AppserverPlugin.java b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/AppserverPlugin.java
index f282a530b..e31f28dc2 100644
--- a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/AppserverPlugin.java
+++ b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/AppserverPlugin.java
@@ -106,8 +106,7 @@ public class AppserverPlugin extends Plugin {
appServer = (IWebappServer) serverElement
.createExecutableExtension(APP_SERVER_CLASS_ATTRIBUTE);
contributingServerPlugin = serverElement
- .getDeclaringExtension()
- .getNamespace();
+ .getDeclaringExtension().getNamespace();
} catch (CoreException e) {
getLog().log(e.getStatus());
throw e;
@@ -145,4 +144,4 @@ public class AppserverPlugin extends Plugin {
AppserverResources.getString("Appserver.start"), null)); //$NON-NLS-1$
appServer.start(port, hostAddress);
}
-}
+} \ No newline at end of file
diff --git a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/AppserverResources.java b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/AppserverResources.java
index ba6eb048b..c28eb0a86 100644
--- a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/AppserverResources.java
+++ b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/AppserverResources.java
@@ -21,7 +21,8 @@ import org.eclipse.core.runtime.*;
class AppserverResources {
private static ResourceBundle resBundle;
static {
- resBundle = ResourceBundle.getBundle(AppserverResources.class.getName());
+ resBundle = ResourceBundle
+ .getBundle(AppserverResources.class.getName());
}
/**
* Resources constructor.
@@ -46,10 +47,8 @@ class AppserverResources {
public static String getString(String name, String replace0) {
try {
String stringFromPropertiesFile = resBundle.getString(name);
- stringFromPropertiesFile =
- MessageFormat.format(
- stringFromPropertiesFile,
- new Object[] { replace0 });
+ stringFromPropertiesFile = MessageFormat.format(
+ stringFromPropertiesFile, new Object[]{replace0});
return stringFromPropertiesFile;
} catch (Exception e) {
return name;
@@ -59,16 +58,11 @@ class AppserverResources {
/**
* Returns a string from a property file
*/
- public static String getString(
- String name,
- String replace0,
- String replace1) {
+ public static String getString(String name, String replace0, String replace1) {
try {
String stringFromPropertiesFile = resBundle.getString(name);
- stringFromPropertiesFile =
- MessageFormat.format(
- stringFromPropertiesFile,
- new Object[] { replace0, replace1 });
+ stringFromPropertiesFile = MessageFormat.format(
+ stringFromPropertiesFile, new Object[]{replace0, replace1});
return stringFromPropertiesFile;
} catch (Exception e) {
return name;
@@ -78,17 +72,13 @@ class AppserverResources {
/**
* Returns a string from a property file
*/
- public static String getString(
- String name,
- String replace0,
- String replace1,
- String replace2) {
+ public static String getString(String name, String replace0,
+ String replace1, String replace2) {
try {
String stringFromPropertiesFile = resBundle.getString(name);
- stringFromPropertiesFile =
- MessageFormat.format(
- stringFromPropertiesFile,
- new Object[] { replace0, replace1, replace2 });
+ stringFromPropertiesFile = MessageFormat.format(
+ stringFromPropertiesFile, new Object[]{replace0, replace1,
+ replace2});
return stringFromPropertiesFile;
} catch (Exception e) {
return name;
@@ -98,18 +88,13 @@ class AppserverResources {
/**
* Returns a string from a property file
*/
- public static String getString(
- String name,
- String replace0,
- String replace1,
- String replace2,
- String replace3) {
+ public static String getString(String name, String replace0,
+ String replace1, String replace2, String replace3) {
try {
String stringFromPropertiesFile = resBundle.getString(name);
- stringFromPropertiesFile =
- MessageFormat.format(
- stringFromPropertiesFile,
- new Object[] { replace0, replace1, replace2, replace3 });
+ stringFromPropertiesFile = MessageFormat.format(
+ stringFromPropertiesFile, new Object[]{replace0, replace1,
+ replace2, replace3});
return stringFromPropertiesFile;
} catch (Exception e) {
return name;
@@ -119,24 +104,13 @@ class AppserverResources {
/**
* Returns a string from a property file
*/
- public static String getString(
- String name,
- String replace0,
- String replace1,
- String replace2,
- String replace3,
- String replace4) {
+ public static String getString(String name, String replace0,
+ String replace1, String replace2, String replace3, String replace4) {
try {
String stringFromPropertiesFile = resBundle.getString(name);
- stringFromPropertiesFile =
- MessageFormat.format(
- stringFromPropertiesFile,
- new Object[] {
- replace0,
- replace1,
- replace2,
- replace3,
- replace4 });
+ stringFromPropertiesFile = MessageFormat.format(
+ stringFromPropertiesFile, new Object[]{replace0, replace1,
+ replace2, replace3, replace4});
return stringFromPropertiesFile;
} catch (Exception e) {
return name;
@@ -146,26 +120,14 @@ class AppserverResources {
/**
* Returns a string from a property file
*/
- public static String getString(
- String name,
- String replace0,
- String replace1,
- String replace2,
- String replace3,
- String replace4,
- String replace5) {
+ public static String getString(String name, String replace0,
+ String replace1, String replace2, String replace3, String replace4,
+ String replace5) {
try {
String stringFromPropertiesFile = resBundle.getString(name);
- stringFromPropertiesFile =
- MessageFormat.format(
- stringFromPropertiesFile,
- new Object[] {
- replace0,
- replace1,
- replace2,
- replace3,
- replace4,
- replace5 });
+ stringFromPropertiesFile = MessageFormat.format(
+ stringFromPropertiesFile, new Object[]{replace0, replace1,
+ replace2, replace3, replace4, replace5});
return stringFromPropertiesFile;
} catch (Exception e) {
return name;
@@ -186,11 +148,9 @@ class AppserverResources {
else if (locales.countTokens() == 2)
return new Locale(locales.nextToken(), locales.nextToken());
else if (locales.countTokens() == 3)
- return new Locale(
- locales.nextToken(),
- locales.nextToken(),
- locales.nextToken());
+ return new Locale(locales.nextToken(), locales.nextToken(), locales
+ .nextToken());
else
return Locale.getDefault();
}
-}
+} \ No newline at end of file
diff --git a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/DevClassPathHelper.java b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/DevClassPathHelper.java
index c5861e274..021489d97 100644
--- a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/DevClassPathHelper.java
+++ b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/DevClassPathHelper.java
@@ -10,10 +10,8 @@
*******************************************************************************/
package org.eclipse.help.internal.appserver;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.io.*;
+import java.net.*;
import java.util.*;
/**
@@ -25,7 +23,8 @@ public class DevClassPathHelper {
static protected Properties devProperties = null;
static {
- // Check the osgi.dev property to see if dev classpath entries have been defined.
+ // Check the osgi.dev property to see if dev classpath entries have been
+ // defined.
String osgiDev = System.getProperty("osgi.dev"); //$NON-NLS-1$
if (osgiDev != null) {
try {
@@ -33,7 +32,8 @@ public class DevClassPathHelper {
URL location = new URL(osgiDev);
devProperties = load(location);
if (devProperties != null)
- devDefaultClasspath = getArrayFromList(devProperties.getProperty("*")); //$NON-NLS-1$
+ devDefaultClasspath = getArrayFromList(devProperties
+ .getProperty("*")); //$NON-NLS-1$
} catch (MalformedURLException e) {
devDefaultClasspath = getArrayFromList(osgiDev);
}
@@ -53,10 +53,12 @@ public class DevClassPathHelper {
}
/**
- * Returns the result of converting a list of comma-separated tokens into an array
+ * Returns the result of converting a list of comma-separated tokens into an
+ * array
*
* @return the array of string tokens
- * @param prop the initial comma-separated string
+ * @param prop
+ * the initial comma-separated string
*/
public static String[] getArrayFromList(String prop) {
if (prop == null || prop.trim().equals("")) //$NON-NLS-1$
@@ -68,7 +70,8 @@ public class DevClassPathHelper {
if (!token.equals("")) //$NON-NLS-1$
list.addElement(token);
}
- return list.isEmpty() ? new String[0] : (String[]) list.toArray(new String[list.size()]);
+ return list.isEmpty() ? new String[0] : (String[]) list
+ .toArray(new String[list.size()]);
}
public static boolean inDevelopmentMode() {
diff --git a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/IWebappServer.java b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/IWebappServer.java
index 1fbbb4250..444948c78 100644
--- a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/IWebappServer.java
+++ b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/IWebappServer.java
@@ -10,21 +10,26 @@
*******************************************************************************/
package org.eclipse.help.internal.appserver;
-
import org.eclipse.core.runtime.*;
/**
- * Interface to be implemented by the app servers that are contributed to the org.eclipse.webapp.server extension point.
- * The implementors of this class should ensure that webapps are running in an environment in which they can see their classes,
- * the J2SE/J2EE classes, as well as classes loaded by the custom class loader.
+ * Interface to be implemented by the app servers that are contributed to the
+ * org.eclipse.webapp.server extension point. The implementors of this class
+ * should ensure that webapps are running in an environment in which they can
+ * see their classes, the J2SE/J2EE classes, as well as classes loaded by the
+ * custom class loader.
+ *
* @since 2.1
*/
public interface IWebappServer {
/**
* Starts the server on specified host/port. Must be called before running a
* webapp.
- * @param port port to listen to. Pass 0 to let the system pick up a port.
- * @param host server host. Can be an IP address or a server name
+ *
+ * @param port
+ * port to listen to. Pass 0 to let the system pick up a port.
+ * @param host
+ * server host. Can be an IP address or a server name
*/
public void start(int port, String host) throws CoreException;
@@ -40,15 +45,17 @@ public interface IWebappServer {
/**
* Runs a webapp on the server.
- * @param webappName the name of the web app (also knowns as application context)
- * @param path path to the webapp directory or WAR file.
- * @param customLoader optional class loader to add to the default webapp
- * class loader
+ *
+ * @param webappName
+ * the name of the web app (also knowns as application context)
+ * @param path
+ * path to the webapp directory or WAR file.
+ * @param customLoader
+ * optional class loader to add to the default webapp class
+ * loader
*/
- public void start(
- String webappName,
- IPath path,
- ClassLoader customLoader) throws CoreException;
+ public void start(String webappName, IPath path, ClassLoader customLoader)
+ throws CoreException;
/**
* Stops the specified webapp.
@@ -57,15 +64,16 @@ public interface IWebappServer {
/**
* Returns the port number the app server listens on.
- * @return integer port number,
- * 0 if server not started
+ *
+ * @return integer port number, 0 if server not started
*/
public int getPort();
/**
* Returns the host name or ip the app server runs on.
- * @return String representaion of host name of IP,
- * null if server not started yet
+ *
+ * @return String representaion of host name of IP, null if server not
+ * started yet
*/
public String getHost();
-}
+} \ No newline at end of file
diff --git a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/PluginClassLoaderWrapper.java b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/PluginClassLoaderWrapper.java
index d50b4efd6..102dd01ea 100644
--- a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/PluginClassLoaderWrapper.java
+++ b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/PluginClassLoaderWrapper.java
@@ -12,6 +12,7 @@ package org.eclipse.help.internal.appserver;
import java.io.*;
import java.net.*;
import java.util.*;
+
import org.eclipse.core.runtime.*;
import org.eclipse.osgi.util.*;
import org.osgi.framework.*;
diff --git a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/WebappManager.java b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/WebappManager.java
index 496ccf802..8330e9679 100644
--- a/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/WebappManager.java
+++ b/org.eclipse.help.appserver/src/org/eclipse/help/internal/appserver/WebappManager.java
@@ -10,14 +10,15 @@
*******************************************************************************/
package org.eclipse.help.internal.appserver;
-import java.io.IOException;
-import java.net.URL;
+import java.io.*;
+import java.net.*;
import org.eclipse.core.runtime.*;
import org.osgi.framework.*;
/**
* Singleton class to be called by clients to run a webapp.
+ *
* @since 2.1
*/
public class WebappManager {
@@ -25,24 +26,29 @@ public class WebappManager {
/**
* Private constructor, so no instances can be created.
+ *
* @see java.lang.Object#Object()
*/
private WebappManager() {
}
/**
- * Runs a webapp on the server. The webapp is defined in a plugin and the path is relative
- * to the plugin directory.
- * <p> It is assumed that webapp names are unique. It is suggested to create
- * unique web app names by prefixing them with the plugin id.</p>
+ * Runs a webapp on the server. The webapp is defined in a plugin and the
+ * path is relative to the plugin directory.
+ * <p>
+ * It is assumed that webapp names are unique. It is suggested to create
+ * unique web app names by prefixing them with the plugin id.
+ * </p>
*
- * @param webappName the name of the web app (also knowns as application context)
- * @param pluginId plugin that defines the webapp
- * @param path webapp relative path to the plugin directory
- * @ return true if the webapp was successfully started, false otherwise
+ * @param webappName
+ * the name of the web app (also knowns as application context)
+ * @param pluginId
+ * plugin that defines the webapp
+ * @param path
+ * webapp relative path to the plugin directory
*/
public static void start(String webappName, String pluginId, IPath path)
- throws CoreException {
+ throws CoreException {
IPath webappPath = getWebappPath(pluginId, path);
@@ -50,10 +56,8 @@ public class WebappManager {
// class loader exposed by the server is available to the webapps.
IWebappServer server = AppserverPlugin.getDefault().getAppServer();
applicationsStarted = true;
- server.start(
- webappName,
- webappPath,
- new PluginClassLoaderWrapper(pluginId));
+ server.start(webappName, webappPath, new PluginClassLoaderWrapper(
+ pluginId));
}
/**
@@ -69,8 +73,8 @@ public class WebappManager {
/**
* Returns the port number the app server listens on.
- * @return integer port number,
- * 0 if server not started
+ *
+ * @return integer port number, 0 if server not started
*/
public static int getPort() {
try {
@@ -82,8 +86,9 @@ public class WebappManager {
/**
* Returns the host name or ip the app server runs on.
- * @return String representaion of host name of IP,
- * null if server not started yet
+ *
+ * @return String representaion of host name of IP, null if server not
+ * started yet
*/
public static String getHost() {
try {
@@ -95,54 +100,41 @@ public class WebappManager {
/**
* @param pluginId
- * @param path webapp path relative to the plugin directory
+ * @param path
+ * webapp path relative to the plugin directory
* @return String absolute webapp path
*/
private static IPath getWebappPath(String pluginId, IPath path)
- throws CoreException {
+ throws CoreException {
Bundle bundle = Platform.getBundle(pluginId);
if (bundle == null) {
- throw new CoreException(
- new Status(
- IStatus.ERROR,
- AppserverPlugin.PLUGIN_ID,
- IStatus.OK,
- AppserverResources.getString(
- "Appserver.cannotFindPlugin", //$NON-NLS-1$
- pluginId),
- null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ AppserverPlugin.PLUGIN_ID, IStatus.OK, AppserverResources
+ .getString("Appserver.cannotFindPlugin", //$NON-NLS-1$
+ pluginId), null));
}
// Note: we just look for one webapp directory.
// If needed, may want to use the locale specific path.
URL webappURL = Platform.find(bundle, path);
if (webappURL == null) {
- throw new CoreException(
- new Status(
- IStatus.ERROR,
- AppserverPlugin.PLUGIN_ID,
- IStatus.OK,
- AppserverResources.getString(
- "Appserver.cannotFindPath", //$NON-NLS-1$
- pluginId, path.toOSString()),
- null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ AppserverPlugin.PLUGIN_ID, IStatus.OK, AppserverResources
+ .getString("Appserver.cannotFindPath", //$NON-NLS-1$
+ pluginId, path.toOSString()), null));
}
try {
- String webappLocation = Platform.asLocalURL(Platform.resolve(webappURL)).getFile();
+ String webappLocation = Platform.asLocalURL(
+ Platform.resolve(webappURL)).getFile();
return new Path(webappLocation);
} catch (IOException ioe) {
- throw new CoreException(
- new Status(
- IStatus.ERROR,
- AppserverPlugin.PLUGIN_ID,
- IStatus.OK,
- AppserverResources.getString(
- "Appserver.cannotResolvePath", //$NON-NLS-1$
- pluginId, path.toOSString()),
- ioe));
+ throw new CoreException(new Status(IStatus.ERROR,
+ AppserverPlugin.PLUGIN_ID, IStatus.OK, AppserverResources
+ .getString("Appserver.cannotResolvePath", //$NON-NLS-1$
+ pluginId, path.toOSString()), ioe));
}
}
-}
+} \ No newline at end of file

Back to the top