Search in sources :

Example 96 with Context

use of org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context in project webtools.servertools by eclipse.

the class Tomcat55Configuration 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;
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) ArrayList(java.util.ArrayList) CoreException(org.eclipse.core.runtime.CoreException)

Example 97 with Context

use of org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context in project webtools.servertools by eclipse.

the class Tomcat60Configuration 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;
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) ArrayList(java.util.ArrayList) CoreException(org.eclipse.core.runtime.CoreException)

Example 98 with Context

use of org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context in project webtools.servertools by eclipse.

the class Tomcat60Configuration 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);
    }
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) CoreException(org.eclipse.core.runtime.CoreException)

Example 99 with Context

use of org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context in project webtools.servertools by eclipse.

the class Tomcat70Configuration 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);
    }
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) CoreException(org.eclipse.core.runtime.CoreException)

Example 100 with Context

use of org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context in project webtools.servertools by eclipse.

the class Tomcat70Configuration 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;
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) ArrayList(java.util.ArrayList) CoreException(org.eclipse.core.runtime.CoreException)

Aggregations

Context (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context)58 Context (com.microsoft.z3.Context)36 CoreException (org.eclipse.core.runtime.CoreException)35 Test (org.junit.Test)24 BoolExpr (com.microsoft.z3.BoolExpr)23 List (java.util.List)20 IOException (java.io.IOException)18 ServerInstance (org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance)18 Context (org.kie.workbench.common.dmn.api.definition.v1_1.Context)17 HashMap (java.util.HashMap)16 File (java.io.File)14 Map (java.util.Map)14 ArrayList (java.util.ArrayList)13 Solver (com.microsoft.z3.Solver)12 Status (com.microsoft.z3.Status)12 IPath (org.eclipse.core.runtime.IPath)12 IStatus (org.eclipse.core.runtime.IStatus)12 Status (org.eclipse.core.runtime.Status)11 Factory (org.eclipse.jst.server.tomcat.core.internal.xml.Factory)11 Z3Exception (com.microsoft.z3.Z3Exception)9