use of org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context in project webtools.servertools by eclipse.
the class Tomcat40Configuration method getWebModules.
/**
* Return a list of the web modules in this server.
* @return java.util.List
*/
public List getWebModules() {
List<WebModule> list = new ArrayList<WebModule>();
try {
Context[] contexts = serverInstance.getContexts();
if (contexts != null) {
for (int i = 0; i < contexts.length; i++) {
Context context = contexts[i];
String reload = context.getReloadable();
if (reload == null)
reload = "false";
WebModule module = new WebModule(context.getPath(), context.getDocBase(), context.getSource(), reload.equalsIgnoreCase("true") ? true : false);
list.add(module);
}
}
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error getting modules", e);
}
return list;
}
use of org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context in project webtools.servertools by eclipse.
the class Tomcat40Configuration method modifyWebModule.
/**
* Change a web module.
* @param index int
* @param docBase java.lang.String
* @param path java.lang.String
* @param reloadable boolean
*/
public void modifyWebModule(int index, String docBase, String path, boolean reloadable) {
try {
Context context = serverInstance.getContext(index);
if (context != null) {
context.setPath(path);
context.setDocBase(docBase);
context.setReloadable(reloadable ? "true" : "false");
isServerDirty = true;
WebModule module = new WebModule(path, docBase, null, reloadable);
firePropertyChangeEvent(MODIFY_WEB_MODULE_PROPERTY, new Integer(index), module);
}
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error modifying web module " + index, e);
}
}
use of org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context in project webtools.servertools by eclipse.
the class Tomcat41Configuration method modifyWebModule.
/**
* Change a web module.
* @param index int
* @param docBase java.lang.String
* @param path java.lang.String
* @param reloadable boolean
*/
public void modifyWebModule(int index, String docBase, String path, boolean reloadable) {
try {
Context context = serverInstance.getContext(index);
if (context != null) {
context.setPath(path);
context.setDocBase(docBase);
context.setReloadable(reloadable ? "true" : "false");
isServerDirty = true;
WebModule module = new WebModule(path, docBase, null, reloadable);
firePropertyChangeEvent(MODIFY_WEB_MODULE_PROPERTY, new Integer(index), module);
}
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error modifying web module " + index, e);
}
}
use of org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context in project webtools.servertools by eclipse.
the class Tomcat50Configuration method getWebModules.
/**
* Return a list of the web modules in this server.
* @return java.util.List
*/
public List getWebModules() {
List<WebModule> list = new ArrayList<WebModule>();
try {
Context[] contexts = serverInstance.getContexts();
if (contexts != null) {
for (int i = 0; i < contexts.length; i++) {
Context context = contexts[i];
String reload = context.getReloadable();
if (reload == null)
reload = "false";
WebModule module = new WebModule(context.getPath(), context.getDocBase(), context.getSource(), reload.equalsIgnoreCase("true") ? true : false);
list.add(module);
}
}
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error getting project refs", e);
}
return list;
}
use of org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context in project webtools.servertools by eclipse.
the class Tomcat50Configuration method addWebModule.
/**
* @see ITomcatConfigurationWorkingCopy#addWebModule(int, ITomcatWebModule)
*/
public void addWebModule(int index, ITomcatWebModule module) {
try {
Context context = serverInstance.createContext(index);
if (context != null) {
context.setDocBase(module.getDocumentBase());
context.setPath(module.getPath());
context.setReloadable(module.isReloadable() ? "true" : "false");
if (module.getMemento() != null && module.getMemento().length() > 0)
context.setSource(module.getMemento());
isServerDirty = true;
firePropertyChangeEvent(ADD_WEB_MODULE_PROPERTY, null, module);
}
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error adding web module " + module.getPath(), e);
}
}
Aggregations