X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=server%2Fruntime%2Forg.argeo.server.webextender%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fserver%2Fwebextender%2FTomcatDeployer.java;h=192ceadbaebdf9589b9f22fbbe062f5dfc06b1db;hb=1df1bf64759d35d3d72b9d96b26b71118fdbe031;hp=c41351dc0083440165d534fb75e2ab2431f9db53;hpb=ca91d6c3f261173feb0ae4914450a119336f83c1;p=lgpl%2Fargeo-commons.git diff --git a/server/runtime/org.argeo.server.webextender/src/main/java/org/argeo/server/webextender/TomcatDeployer.java b/server/runtime/org.argeo.server.webextender/src/main/java/org/argeo/server/webextender/TomcatDeployer.java index c41351dc0..192ceadba 100644 --- a/server/runtime/org.argeo.server.webextender/src/main/java/org/argeo/server/webextender/TomcatDeployer.java +++ b/server/runtime/org.argeo.server.webextender/src/main/java/org/argeo/server/webextender/TomcatDeployer.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2007-2012 Argeo GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.argeo.server.webextender; import org.apache.catalina.Container; @@ -15,6 +30,7 @@ import org.springframework.util.ObjectUtils; public class TomcatDeployer extends TomcatWarDeployer { private String serverInfo; private Service service; + private String contextPath = "/ui"; @Override public void setService(Object service) { @@ -23,8 +39,7 @@ public class TomcatDeployer extends TomcatWarDeployer { // TODO: listen to OSGi service so that we get notified in the // (unlikely) case the underlying service is updated serverInfo = ((Service) service).getInfo(); - if (log.isDebugEnabled()) - log.debug("Argeo modified Tomcat deployer used"); + log.info("Enhanced Argeo Tomcat webapp deployer being used"); } @Override @@ -42,8 +57,7 @@ public class TomcatDeployer extends TomcatWarDeployer { // Required for multiple RAP sessions to work with Tomcat // see // http://wiki.eclipse.org/RAP/FAQ#How_to_run_a_RAP_application_in_multiple_browser_tabs.2Fwindows.3F - // TODO make it configurable in order to cover other web apps - Context context = getContext("/org.argeo.rap.webapp"); + Context context = getContext(contextPath); if (context != null) context.setCookies(false); } @@ -51,7 +65,8 @@ public class TomcatDeployer extends TomcatWarDeployer { /** @return null if not found */ private Context getContext(String path) { for (Container container : getHost().findChildren()) { - log.debug(container.getClass() + ": " + container.getName()); + if (log.isTraceEnabled()) + log.trace(container.getClass() + ": " + container.getName()); if (container instanceof Context) { Context context = (Context) container; if (path.equals(context.getPath())) @@ -78,4 +93,8 @@ public class TomcatDeployer extends TomcatWarDeployer { return children[0]; } + public void setContextPath(String contextPath) { + this.contextPath = contextPath; + } + }