Author: jim.ma
Date: 2015-03-13 04:15:43 -0400 (Fri, 13 Mar 2015)
New Revision: 19559
Added:
spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/ManagementFilter.java
Modified:
spi/branches/management/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java
Log:
[JBWS-3881]:Add filter to forward request from url
http://localhost:8080/context/endpoint/management?config to
http://localhost:8080/context/endpoint?config
Added:
spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/ManagementFilter.java
===================================================================
---
spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/ManagementFilter.java
(rev 0)
+++
spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/ManagementFilter.java 2015-03-13
08:15:43 UTC (rev 19559)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2015, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.deployment;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Filter to forward endpoint management request to cxf endpoint interceptor
+ * @author @author <a href="mailto:ema@redhat.com>Jim Ma</a>
+ *
+ */
+public class ManagementFilter implements Filter {
+ private String pattern;
+
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+ pattern = filterConfig.getInitParameter("httpURLPattern");
+ }
+
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain
chain) throws IOException,
+ ServletException {
+ HttpServletRequest req = (HttpServletRequest) request;
+ if ("PUT".equals(req.getMethod()) ||
"GET".equals(req.getMethod())) {
+ String query = req.getQueryString();
+ if (query != null && !"wsdl".equals(query)) {
+ String forwardPath = pattern.endsWith("/*") ?
pattern.substring(0, pattern.length()-2) : pattern;
+ req.getRequestDispatcher(forwardPath + "?" +
query).forward(request, response);
+ }
+ } else {
+ chain.doFilter(request, response);
+ }
+
+ }
+ @Override
+ public void destroy() {
+
+ }
+
+}
Property changes on:
spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/ManagementFilter.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
spi/branches/management/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java
===================================================================
---
spi/branches/management/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java 2015-03-13
08:11:47 UTC (rev 19558)
+++
spi/branches/management/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java 2015-03-13
08:15:43 UTC (rev 19559)
@@ -36,7 +36,6 @@
{
public static final String STANDARD_ENDPOINT_CONFIG =
"Standard-Endpoint-Config";
public static final String DEFAULT_ENDPOINT_CONFIG_FILE =
"jaxws-endpoint-config.xml";
- public static final String STATISTICS_ENABLED = "statistics-enabled";
public EndpointConfig(String configName, List<UnifiedHandlerChainMetaData>
preHandlerChains,
List<UnifiedHandlerChainMetaData> postHandlerChains, Map<String,
String> properties,