/** * Return the Context for the deployed application that is associated * with the specified context path (if any); otherwise return * <code>null</code>. * * @param contextPath The context path of the requested web application */ public Context findDeployedApp(String contextPath) { return ((Context) host.findChild(contextPath)); }
private boolean isDeployed(File file, StandardHost standardHost) { if (deployedApps.containsKey(file.getAbsolutePath())) { return true; } // check if this is a deployed web application String name = "/" + file.getName(); // ROOT context is a special case if (name.equals("/ROOT")) name = ""; return file.isFile() && standardHost.findChild(name) != null; }
/** * Returns true if given application is deployed * false otherwise. * * @param file web application file * @param standardHost host * @return true if given application is deployed */ private boolean isDeployed(File file, StandardHost standardHost) { if (deployedApps.containsKey(file.getAbsolutePath())) { return true; } // check if this is a deployed web application String name = "/" + file.getName(); // ROOT context is a special case if (name.equals("/ROOT")) { name = ""; } return file.isFile() && standardHost.findChild(name) != null; }
/** * Returns true if given application is deployed * false otherwise. * * @param file web application file * @param standardHost host * @return true if given application is deployed */ private boolean isDeployed(final File file, final StandardHost standardHost) { if (deployedApps.containsKey(file.getAbsolutePath())) { return true; } // check if this is a deployed web application String name = "/" + file.getName(); // ROOT context is a special case if (isRoot(name)) { name = ""; } // can be a dir or a war so exists is fine return file.exists() && standardHost.findChild(name) != null; }
throw new IllegalArgumentException(msg); if (host.findChild(contextPath) != null) { String msg = MessageFormat.format(rb.getString(LogFacade.CONTEXT_PATH_ALREADY_USED_EXCEPTION), contextPath); throw new IllegalStateException(msg);
/** * Get Parent ContainerBase to add its child component * from child component's ObjectName as a String */ private ContainerBase getParentContainerFromChild(ObjectName oname) throws Exception { String hostName = oname.getKeyProperty("host"); String path = oname.getKeyProperty("path"); Service service = getService(oname); StandardEngine engine = (StandardEngine) service.getContainer(); if (hostName == null) { // child's container is Engine return engine; } else if (path == null) { // child's container is Host StandardHost host = (StandardHost) engine.findChild(hostName); return host; } else { // child's container is Context StandardHost host = (StandardHost) engine.findChild(hostName); path = getPathStr(path); StandardContext context = (StandardContext) host.findChild(path); return context; } }
/** * Get Parent ContainerBase to add its child component * from child component's ObjectName as a String */ private ContainerBase getParentContainerFromChild(ObjectName oname) throws Exception { String hostName = oname.getKeyProperty("host"); String path = oname.getKeyProperty("path"); Service service = getService(oname); StandardEngine engine = (StandardEngine) service.getContainer(); if (hostName == null) { // child's container is Engine return engine; } else if (path == null) { // child's container is Host StandardHost host = (StandardHost) engine.findChild(hostName); return host; } else { // child's container is Context StandardHost host = (StandardHost) engine.findChild(hostName); path = getPathStr(path); StandardContext context = (StandardContext) host.findChild(path); return context; } }
/** * Get Parent ContainerBase to add its child component * from child component's ObjectName as a String */ private ContainerBase getParentContainerFromChild(ObjectName oname) throws Exception { String hostName = oname.getKeyProperty("host"); String path = oname.getKeyProperty("path"); Service service = getService(oname); StandardEngine engine = (StandardEngine) service.getContainer(); if (hostName == null) { // child's container is Engine return engine; } else if (path == null) { // child's container is Host StandardHost host = (StandardHost) engine.findChild(hostName); return host; } else { // child's container is Context StandardHost host = (StandardHost) engine.findChild(hostName); path = getPathStr(path); StandardContext context = (StandardContext) host.findChild(path); return context; } }
/** * Get Parent ContainerBase to add its child component * from child component's ObjectName as a String */ private ContainerBase getParentContainerFromChild(ObjectName oname) throws Exception { String hostName = oname.getKeyProperty("host"); String path = oname.getKeyProperty("path"); Service service = getService(oname); StandardEngine engine = (StandardEngine) service.getContainer(); if (hostName == null) { // child's container is Engine return engine; } else if (path == null) { // child's container is Host StandardHost host = (StandardHost) engine.findChild(hostName); return host; } else { // child's container is Context StandardHost host = (StandardHost) engine.findChild(hostName); path = getPathStr(path); StandardContext context = (StandardContext) host.findChild(path); return context; } }
/** * Get Parent ContainerBase to add its child component * from child component's ObjectName as a String */ private ContainerBase getParentContainerFromChild(ObjectName oname) throws Exception { String hostName = oname.getKeyProperty("host"); String path = oname.getKeyProperty("path"); Service service = getService(oname); StandardEngine engine = (StandardEngine) service.getContainer(); if (hostName == null) { // child's container is Engine return engine; } else if (path == null) { // child's container is Host StandardHost host = (StandardHost) engine.findChild(hostName); return host; } else { // child's container is Context StandardHost host = (StandardHost) engine.findChild(hostName); path = getPathStr(path); StandardContext context = (StandardContext) host.findChild(path); return context; } }
ContainerBase context = (ContainerBase) standardHost.findChild("/" + name); if (context != null) { try {
/** * Get Parent ContainerBase to add its child component * from child component's ObjectName as a String */ private ContainerBase getParentContainerFromChild(ObjectName oname) throws Exception { String hostName = oname.getKeyProperty("host"); String path = oname.getKeyProperty("path"); Service service = getService(oname); StandardEngine engine = (StandardEngine) service.getContainer(); if (hostName == null) { // child's container is Engine return engine; } else if (path == null) { // child's container is Host StandardHost host = (StandardHost) engine.findChild(hostName); return host; } else { // child's container is Context StandardHost host = (StandardHost) engine.findChild(hostName); path = getPathStr(path); StandardContext context = (StandardContext) host.findChild(path); return context; } }
ContainerBase context = (ContainerBase) standardHost.findChild("/" + name); if (context != null) { try {
final ContainerBase context = (ContainerBase) standardHost.findChild("/" + name); if (context != null) { try {