JBossWS SVN: r19549 - in stack/cxf/trunk/modules/testsuite/cxf-tests/src/test: resources/jaxws/cxf/fastinfoset and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-03-10 12:15:03 -0400 (Tue, 10 Mar 2015)
New Revision: 19549
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFI.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFIImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorld.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml
Log:
[JBWS-3875] Modifying fastinfoset test to also check FI configured with feature properties
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java 2015-03-10 16:11:57 UTC (rev 19548)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java 2015-03-10 16:15:03 UTC (rev 19549)
@@ -38,11 +38,15 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.FileAsset;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.ws.api.configuration.ClientConfigUtil;
+import org.jboss.ws.api.configuration.ClientConfigurer;
import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.WrapThreadContextClassLoader;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -58,11 +62,23 @@
archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ "Dependencies: org.apache.cxf\n"))
.addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFIImpl.class)
.addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFeatureImpl.class)
+ .add(new FileAsset(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml")), "jaxws-endpoint-config.xml")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/fastinfoset/WEB-INF/web.xml"));
return archive;
}
+ @Override
+ protected String getClientJarPaths() {
+ return JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-cxf-fastinfoset-client.jar") { {
+ archive
+ .addManifest()
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml"), "jaxws-client-config.xml");
+ }
+ });
+ }
+
@Test
@RunAsClient
public void testInfoset() throws Exception
@@ -77,11 +93,11 @@
bus.getInInterceptors().add(new LoggingInInterceptor(pwIn));
bus.getOutInterceptors().add(new LoggingOutInterceptor(pwOut));
- URL wsdlURL = new URL(baseURL + "HelloWorldService/HelloWorldImpl?wsdl");
- QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldService");
+ URL wsdlURL = new URL(baseURL + "HelloWorldService/HelloWorldFIImpl?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldFIService");
Service service = Service.create(wsdlURL, serviceName, new UseThreadBusFeature());
- QName portQName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldImplPort");
- HelloWorld port = (HelloWorld) service.getPort(portQName, HelloWorld.class);
+ QName portQName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldFIImplPort");
+ HelloWorldFI port = (HelloWorldFI) service.getPort(portQName, HelloWorldFI.class);
assertEquals("helloworld", port.echo("helloworld"));
assertTrue("request is expected fastinfoset", out.toString().indexOf("application/fastinfoset") > -1);
assertTrue("response is expected fastinfoset", in.toString().indexOf("application/fastinfoset") > -1);
@@ -123,4 +139,39 @@
}
+ @Test
+ @RunAsClient
+ @WrapThreadContextClassLoader
+ public void testInfosetUsingFeatureProperties() throws Exception
+ {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream in = new ByteArrayOutputStream();
+ PrintWriter pwIn = new PrintWriter(in);
+ PrintWriter pwOut = new PrintWriter(out);
+ Bus bus = BusFactory.newInstance().createBus();
+ BusFactory.setThreadDefaultBus(bus);
+ try {
+ bus.getInInterceptors().add(new LoggingInInterceptor(pwIn));
+ bus.getOutInterceptors().add(new LoggingOutInterceptor(pwOut));
+
+ URL wsdlURL = new URL(baseURL + "HelloWorldService/HelloWorldImpl?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldService");
+ Service service = Service.create(wsdlURL, serviceName, new UseThreadBusFeature());
+ QName portQName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldImplPort");
+ HelloWorld port = (HelloWorld) service.getPort(portQName, HelloWorld.class);
+
+ ClientConfigurer configurer = ClientConfigUtil.resolveClientConfigurer();
+ configurer.setConfigProperties(port, "META-INF/jaxws-client-config.xml", "Custom Client Config");
+
+ assertEquals("helloworld", port.echo("helloworld"));
+ assertTrue("request is expected fastinfoset", out.toString().indexOf("application/fastinfoset") > -1);
+ assertTrue("response is expected fastinfoset", in.toString().indexOf("application/fastinfoset") > -1);
+ } finally {
+ bus.shutdown(true);
+ pwOut.close();
+ pwIn.close();
+ }
+
+ }
+
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorld.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorld.java 2015-03-10 16:11:57 UTC (rev 19548)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorld.java 2015-03-10 16:15:03 UTC (rev 19549)
@@ -23,10 +23,7 @@
import javax.jws.WebService;
-import org.apache.cxf.annotations.FastInfoset;
-
@WebService(targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset")
-@FastInfoset(force = true)
public interface HelloWorld
{
String echo(String input);
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFI.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFI.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFI.java 2015-03-10 16:15:03 UTC (rev 19549)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.test.ws.jaxws.cxf.fastinfoset;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.FastInfoset;
+
+@WebService(targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset")
+@FastInfoset(force = true)
+public interface HelloWorldFI
+{
+ String echo(String input);
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFI.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFIImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFIImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFIImpl.java 2015-03-10 16:15:03 UTC (rev 19549)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.test.ws.jaxws.cxf.fastinfoset;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.FastInfoset;
+
+@WebService
+(
+ serviceName = "HelloWorldFIService",
+ targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset"
+)
+@FastInfoset(force = true)
+public class HelloWorldFIImpl
+{
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFIImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java 2015-03-10 16:11:57 UTC (rev 19548)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java 2015-03-10 16:15:03 UTC (rev 19549)
@@ -23,14 +23,11 @@
import javax.jws.WebService;
-import org.apache.cxf.annotations.FastInfoset;
-
@WebService
(
serviceName = "HelloWorldService",
targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset"
)
-@FastInfoset(force = true)
public class HelloWorldImpl
{
public String echo(String input)
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml 2015-03-10 16:15:03 UTC (rev 19549)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0 schema/jbossws-jaxws-config_4_0.xsd">
+
+ <client-config>
+ <config-name>Custom Client Config</config-name>
+ <property>
+ <property-name>cxf.features</property-name>
+ <property-value>org.apache.cxf.feature.FastInfosetFeature</property-value>
+ </property>
+ </client-config>
+
+</jaxws-config>
\ No newline at end of file
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml 2015-03-10 16:15:03 UTC (rev 19549)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0 schema/jbossws-jaxws-config_4_0.xsd">
+
+ <endpoint-config>
+ <config-name>org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldImpl</config-name>
+ <property>
+ <property-name>cxf.features</property-name>
+ <property-value>org.apache.cxf.feature.FastInfosetFeature</property-value>
+ </property>
+ </endpoint-config>
+
+</jaxws-config>
\ No newline at end of file
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml 2015-03-10 16:11:57 UTC (rev 19548)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml 2015-03-10 16:15:03 UTC (rev 19549)
@@ -12,6 +12,10 @@
<servlet-name>FeatureServlet</servlet-name>
<servlet-class>org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFeatureImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>FIServlet</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFIImpl</servlet-class>
+ </servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
@@ -21,4 +25,8 @@
<servlet-name>FeatureServlet</servlet-name>
<url-pattern>/HelloWorldService/HelloWorldFeatureImpl</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>FIServlet</servlet-name>
+ <url-pattern>/HelloWorldService/HelloWorldFIImpl</url-pattern>
+ </servlet-mapping>
</web-app>
\ No newline at end of file
9 years, 9 months
JBossWS SVN: r19548 - in stack/cxf/trunk/modules: client/src/main/java/org/jboss/wsf/stack/cxf/client and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-03-10 12:11:57 -0400 (Tue, 10 Mar 2015)
New Revision: 19548
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/FeatureUtils.java
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
Log:
[JBWS-3875] Allow setting CXF features using properties on client/endpoint configs and in jboss-webservices.xml
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2015-03-10 09:02:23 UTC (rev 19547)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2015-03-10 16:11:57 UTC (rev 19548)
@@ -236,4 +236,8 @@
@LogMessage(level = WARN)
@Message(id = 24105, value = "Could not create instance of specified ClientBusSelector: %s")
void couldNotLoadClientBusSelector(String selector, @Cause Throwable cause);
+
+ @LogMessage(level = WARN)
+ @Message(id = 24106, value = "Could not remove previuosly set features on client: %s")
+ void couldNoRemoveFeaturesOnClient(String feature);
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2015-03-10 09:02:23 UTC (rev 19547)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2015-03-10 16:11:57 UTC (rev 19548)
@@ -42,6 +42,7 @@
public static final String CXF_POLICY_ALTERNATIVE_SELECTOR_PROP = "cxf.policy.alternativeSelector";
public static final String CXF_IN_INTERCEPTORS_PROP = "cxf.interceptors.in";
public static final String CXF_OUT_INTERCEPTORS_PROP = "cxf.interceptors.out";
+ public static final String CXF_FEATURES_PROP = "cxf.features";
public static final String CXF_MANAGEMENT_ENABLED = "cxf.management.enabled";
public static final String CXF_MANAGEMENT_INSTALL_RESPONSE_TIME_INTERCEPTORS = "cxf.management.installResponseTimeInterceptors";
public static final String CXF_WS_DISCOVERY_ENABLED = "cxf.ws-discovery.enabled";
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2015-03-10 09:02:23 UTC (rev 19547)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2015-03-10 16:11:57 UTC (rev 19548)
@@ -86,6 +86,7 @@
public void setConfigProperties(Client client, Map<String, String> properties) {
client.getEndpoint().putAll(properties);
InterceptorUtils.addInterceptors(client, properties);
+ FeatureUtils.addFeatures(client, client.getBus(), properties);
}
private void savePropList(Client client, Map<String, String> props) {
@@ -102,6 +103,8 @@
InterceptorUtils.removeInterceptors(client.getInInterceptors(), (String)ep.get(p));
} else if (Constants.CXF_OUT_INTERCEPTORS_PROP.equals(p)) {
InterceptorUtils.removeInterceptors(client.getOutInterceptors(), (String)ep.get(p));
+ } else if (Constants.CXF_FEATURES_PROP.equals(p)) {
+ Loggers.ROOT_LOGGER.couldNoRemoveFeaturesOnClient((String)ep.get(p));
}
ep.remove(p);
}
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/FeatureUtils.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/FeatureUtils.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/FeatureUtils.java 2015-03-10 16:11:57 UTC (rev 19548)
@@ -0,0 +1,81 @@
+/*
+ * 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.stack.cxf.client.configuration;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.feature.Feature;
+import org.apache.cxf.interceptor.InterceptorProvider;
+import org.jboss.ws.common.utils.DelegateClassLoader;
+import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
+import org.jboss.wsf.stack.cxf.client.Constants;
+
+/**
+ * Utils methods for adding/removing CXF features
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 10-Mar-2015
+ *
+ */
+public class FeatureUtils
+{
+ public static void addFeatures(InterceptorProvider interceptorProvider, Bus bus, Map<String, String> properties) {
+ final String features = properties.get(Constants.CXF_FEATURES_PROP);
+ if (features != null) {
+ for (Feature f : createFeatures(features)) {
+ f.initialize(interceptorProvider, bus);
+ }
+ }
+ }
+
+ private static List<Feature> createFeatures(String propValue) {
+ List<Feature> list = new ArrayList<Feature>();
+ StringTokenizer st = new StringTokenizer(propValue, ", ", false );
+ while (st.hasMoreTokens()) {
+ String itc = st.nextToken();
+ Feature feature = (Feature)newInstance(itc);
+ if (feature != null) {
+ list.add(feature);
+ }
+ }
+ return list;
+ }
+
+ private static Object newInstance(String className)
+ {
+ try
+ {
+ ClassLoader loader = new DelegateClassLoader(ClassLoaderProvider.getDefaultProvider()
+ .getServerIntegrationClassLoader(), SecurityActions.getContextClassLoader());
+ Class<?> clazz = SecurityActions.loadClass(loader, className);
+ return clazz.newInstance();
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/FeatureUtils.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2015-03-10 09:02:23 UTC (rev 19547)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2015-03-10 16:11:57 UTC (rev 19548)
@@ -66,6 +66,7 @@
import org.jboss.wsf.stack.cxf.Loggers;
import org.jboss.wsf.stack.cxf.addressRewrite.SoapAddressRewriteHelper;
import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.stack.cxf.client.configuration.FeatureUtils;
import org.jboss.wsf.stack.cxf.client.configuration.InterceptorUtils;
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
import org.jboss.wsf.stack.cxf.extensions.policy.PolicySetsAnnotationListener;
@@ -159,6 +160,8 @@
policySetsListener = new PolicySetsAnnotationListener(dep.getClassLoader());
bus.getExtension(FactoryBeanListenerManager.class).addListener(policySetsListener);
}
+
+ FeatureUtils.addFeatures(bus, bus, props);
}
private static Map<String, String> getProperties(JBossWebservicesMetaData wsmd) {
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2015-03-10 09:02:23 UTC (rev 19547)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2015-03-10 16:11:57 UTC (rev 19548)
@@ -44,6 +44,7 @@
import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.stack.cxf.Loggers;
import org.jboss.wsf.stack.cxf.addressRewrite.SoapAddressRewriteHelper;
+import org.jboss.wsf.stack.cxf.client.configuration.FeatureUtils;
import org.jboss.wsf.stack.cxf.client.configuration.InterceptorUtils;
@@ -108,6 +109,7 @@
propMap.putAll(epConfProps);
}
InterceptorUtils.addInterceptors(this, epConfProps);
+ FeatureUtils.addFeatures(this, getBus(), epConfProps);
}
//handlers config is done later, as when this methods is called getBinding() can't
//be used without messing with the servlet destinations due to the endpoint address
9 years, 9 months
JBossWS SVN: r19547 - in common/branches/management/src: main/java/org/jboss/ws/common/management and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2015-03-10 05:02:23 -0400 (Tue, 10 Mar 2015)
New Revision: 19547
Added:
common/branches/management/src/main/java/org/jboss/ws/common/utils/RuntimeConfigUtils.java
Modified:
common/branches/management/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
common/branches/management/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java
common/branches/management/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
common/branches/management/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java
Log:
[JBWS-3880]Add apis to allow get all configurations and runtime properties from Endpoint
Modified: common/branches/management/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
===================================================================
--- common/branches/management/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2015-03-10 09:02:06 UTC (rev 19546)
+++ common/branches/management/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2015-03-10 09:02:23 UTC (rev 19547)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -21,8 +21,10 @@
*/
package org.jboss.ws.common.deployment;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.management.MalformedObjectNameException;
@@ -45,12 +47,15 @@
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.management.EndpointMetrics;
import org.jboss.wsf.spi.metadata.config.EndpointConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.wsf.spi.security.SecurityDomainContext;
/**
* A general abstract JAXWS endpoint.
*
* @author Thomas.Diesler(a)jboss.com
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
* @since 20-Apr-2007
*/
public class AbstractDefaultEndpoint extends AbstractExtensible
@@ -72,6 +77,7 @@
protected volatile SecurityDomainContext securityDomainContext;
protected volatile InstanceProvider instanceProvider;
protected volatile EndpointConfig endpointConfig;
+ protected Map<String, String> configsMap = new HashMap<String, String>(64);
AbstractDefaultEndpoint(String targetBean)
{
@@ -100,6 +106,7 @@
{
assertEndpointSetterAccess();
this.targetBean = targetBean;
+ configsMap.put(Endpoint.TARGETBEAN, targetBean);
}
public synchronized Class<?> getTargetBeanClass()
@@ -146,6 +153,7 @@
{
assertEndpointSetterAccess();
this.name = name;
+ configsMap.put(Endpoint.NAME, name.toString());
}
public String getShortName()
@@ -157,6 +165,7 @@
{
assertEndpointSetterAccess();
this.shortName = shortName;
+ configsMap.put(Endpoint.SHORTNAME, shortName);
}
@@ -178,6 +187,7 @@
public void setType(EndpointType type)
{
this.type = type;
+ configsMap.put(Endpoint.TYPE, type.name());
}
public RequestHandler getRequestHandler()
@@ -189,6 +199,7 @@
{
assertEndpointSetterAccess();
this.requestHandler = handler;
+ configsMap.put(Endpoint.REQUESTHANDLER, handler.getClass().getName());
}
public LifecycleHandler getLifecycleHandler()
@@ -200,6 +211,7 @@
{
assertEndpointSetterAccess();
this.lifecycleHandler = handler;
+ configsMap.put(Endpoint.LIFECYCLEHANDLER, handler.getClass().getName());
}
public InvocationHandler getInvocationHandler()
@@ -211,6 +223,7 @@
{
assertEndpointSetterAccess();
this.invocationHandler = handler;
+ configsMap.put(Endpoint.INVOCATIONHANDLER, handler.getClass().getName());
}
@Override
@@ -307,6 +320,7 @@
public void setSecurityDomainContext(SecurityDomainContext securityDomainContext)
{
this.securityDomainContext = securityDomainContext;
+ this.configsMap.put(Endpoint.SECURITY_DOMAIN, securityDomainContext.getSecurityDomain());
}
public InstanceProvider getInstanceProvider()
@@ -324,10 +338,31 @@
{
assertEndpointSetterAccess();
this.endpointConfig = endpointConfig;
+ StringBuffer preHandlerChains = new StringBuffer();
+ for (UnifiedHandlerChainMetaData uhcmd : endpointConfig.getPreHandlerChains()) {
+ for (UnifiedHandlerMetaData uhmd : uhcmd.getHandlers()) {
+ preHandlerChains.append(uhmd.getHandlerClass()).append(" ");
+ }
+ }
+ configsMap.put(Endpoint.PRE_HANDLERCHAIN, preHandlerChains.toString());
+ StringBuffer postHandlerChains = new StringBuffer();
+ for (UnifiedHandlerChainMetaData uhcmd : endpointConfig.getPostHandlerChains()) {
+ for (UnifiedHandlerMetaData uhmd : uhcmd.getHandlers()) {
+ postHandlerChains.append(uhmd.getHandlerClass()).append(" ");
+ }
+ }
+ configsMap.put(Endpoint.POST_HANDLERCHAIN, postHandlerChains.toString());
+ configsMap.putAll(endpointConfig.getProperties());
}
public EndpointConfig getEndpointConfig()
{
return endpointConfig;
}
+
+ public Map<String, String> getAllConfigsMap() {
+ configsMap.put(Endpoint.ADDRESS, this.getAddress());
+ configsMap.putAll(this.getRuntimeProperties());
+ return configsMap;
+ }
}
Modified: common/branches/management/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java
===================================================================
--- common/branches/management/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java 2015-03-10 09:02:06 UTC (rev 19546)
+++ common/branches/management/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java 2015-03-10 09:02:23 UTC (rev 19547)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -31,7 +31,7 @@
*/
public class DefaultHttpEndpoint extends AbstractDefaultEndpoint implements HttpEndpoint
{
-
+ protected static final String URL_PATTEN = "urlPattern";
DefaultHttpEndpoint(String targetBean)
{
super(targetBean);
@@ -60,6 +60,7 @@
{
assertEndpointSetterAccess();
this.urlPattern = urlPattern;
+ this.configsMap.put(URL_PATTEN, urlPattern);
}
}
Modified: common/branches/management/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
--- common/branches/management/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2015-03-10 09:02:06 UTC (rev 19546)
+++ common/branches/management/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2015-03-10 09:02:23 UTC (rev 19547)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -36,6 +36,7 @@
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
+import org.jboss.wsf.spi.deployment.AbstractExtensible;
import org.jboss.wsf.spi.management.CommonConfigStore;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.StackConfig;
@@ -57,9 +58,10 @@
* @author alessio.soldano(a)jboss.com
* @author Thomas.Diesler(a)jboss.org
* @author darran.lofthouse(a)jboss.com
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
* @since 08-May-2006
*/
-public abstract class AbstractServerConfig implements AbstractServerConfigMBean, ServerConfig
+public abstract class AbstractServerConfig extends AbstractExtensible implements AbstractServerConfigMBean, ServerConfig
{
private static final RuntimePermission LOOKUP_SERVER_INTEGRATION_SERVER_CONFIG = new RuntimePermission("org.jboss.ws.LOOKUP_SERVER_INTEGRATION_SERVER_CONFIG");
Added: common/branches/management/src/main/java/org/jboss/ws/common/utils/RuntimeConfigUtils.java
===================================================================
--- common/branches/management/src/main/java/org/jboss/ws/common/utils/RuntimeConfigUtils.java (rev 0)
+++ common/branches/management/src/main/java/org/jboss/ws/common/utils/RuntimeConfigUtils.java 2015-03-10 09:02:23 UTC (rev 19547)
@@ -0,0 +1,62 @@
+/*
+ * 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.ws.common.utils;
+
+import java.security.AccessController;
+
+import org.jboss.ws.common.management.AbstractServerConfig;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.ServerConfig;
+/**
+ * Utility class to compute the runtime configuration
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
+ *
+ */
+public class RuntimeConfigUtils
+{
+ public static boolean isEnabled(final Endpoint endpoint, final String property)
+ {
+ if (endpoint.getRuntimeProperty(property) != null)
+ {
+ return true;
+ }
+ if (endpoint.getService().getDeployment().getRuntimeProperty(property) != null)
+ {
+ return true;
+ }
+ if (getServerConfig().getRuntimeProperty(property) != null)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ private static ServerConfig getServerConfig()
+ {
+ if (System.getSecurityManager() == null)
+ {
+ return AbstractServerConfig.getServerIntegrationServerConfig();
+ }
+ return AccessController.doPrivileged(AbstractServerConfig.GET_SERVER_INTEGRATION_SERVER_CONFIG);
+ }
+
+}
Property changes on: common/branches/management/src/main/java/org/jboss/ws/common/utils/RuntimeConfigUtils.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: common/branches/management/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java
===================================================================
--- common/branches/management/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java 2015-03-10 09:02:06 UTC (rev 19546)
+++ common/branches/management/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java 2015-03-10 09:02:23 UTC (rev 19547)
@@ -35,6 +35,8 @@
import javax.management.ObjectName;
+import junit.framework.TestCase;
+
import org.jboss.ws.api.monitoring.Record;
import org.jboss.ws.api.monitoring.RecordProcessor;
import org.jboss.ws.common.management.DefaultEndpointRegistry;
@@ -51,8 +53,6 @@
import org.jboss.wsf.spi.metadata.config.EndpointConfig;
import org.jboss.wsf.spi.security.SecurityDomainContext;
-import junit.framework.TestCase;
-
/**
* Test the DefaultEndpointRegistry
*
@@ -417,6 +417,30 @@
// TODO Auto-generated method stub
}
+
+ @Override
+ public String getRuntimeProperty(String key) {
+ return null;
+ }
+
+ @Override
+ public void setRuntimeProperty(String key, String value) {
+ }
+
+ @Override
+ public void removeRuntimeProperty(String key) {
+ }
+
+ @Override
+ public Map<String, String> getRuntimeProperties() {
+ return null;
+ }
+
+ @Override
+ public Map<String, String> getAllConfigsMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
};
}
}
9 years, 9 months
JBossWS SVN: r19546 - in spi/branches/management/src/main/java/org/jboss/wsf/spi: management and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2015-03-10 05:02:06 -0400 (Tue, 10 Mar 2015)
New Revision: 19546
Added:
spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/RuntimeConfig.java
Modified:
spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java
spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/Extensible.java
spi/branches/management/src/main/java/org/jboss/wsf/spi/management/ServerConfig.java
Log:
[JBWS-3880]Add apis to allow get all configurations and runtime properties from Endpoint
Modified: spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java
===================================================================
--- spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java 2015-03-09 21:53:55 UTC (rev 19545)
+++ spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/AbstractExtensible.java 2015-03-10 09:02:06 UTC (rev 19546)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -37,23 +37,27 @@
*
* @author Thomas.Diesler(a)jboss.com
* @author alessio.soldano(a)jboss.com
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
* @since 20-Apr-2007
*/
public abstract class AbstractExtensible implements Extensible
{
private final Map<Class<?>, Object> attachments;
private final Map<String, Object> properties;
+ private final Map<String, String> runtimeProperties;
public AbstractExtensible()
{
this.attachments = new HashMap<Class<?>, Object>();
this.properties = new HashMap<String, Object>();
+ this.runtimeProperties = new HashMap<String, String>(10);
}
public AbstractExtensible(int initialAttachmentsSize, int initialPropertiesSize)
{
this.attachments = new HashMap<Class<?>, Object>(initialAttachmentsSize);
this.properties = new HashMap<String, Object>(initialPropertiesSize);
+ this.runtimeProperties = new HashMap<String, String>(10);
}
public Collection<Object> getAttachments()
@@ -103,5 +107,26 @@
{
properties.putAll(props);
}
+
+ /** Get runtime changeable property*/
+ public String getRuntimeProperty(String key) {
+ return this.runtimeProperties.get(key);
+ }
+
+ /** Set runtime changeable property*/
+ public void setRuntimeProperty(String key, String value) {
+ this.runtimeProperties.put(key, value);
+ }
+
+ /** Remove a runtime changeable property */
+ public void removeRuntimeProperty(String key) {
+ this.runtimeProperties.remove(key);
+ }
+
+ /** Get the set of runtime changeable property names */
+ public Map<String, String> getRuntimeProperties() {
+ return this.runtimeProperties;
+ }
+
}
Modified: spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
===================================================================
--- spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2015-03-09 21:53:55 UTC (rev 19545)
+++ spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2015-03-10 09:02:06 UTC (rev 19546)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -22,6 +22,7 @@
package org.jboss.wsf.spi.deployment;
import java.util.List;
+import java.util.Map;
import javax.management.ObjectName;
@@ -37,6 +38,7 @@
* A general JAXWS endpoint.
*
* @author Thomas.Diesler(a)jboss.com
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
* @since 20-Apr-2007
*/
public interface Endpoint extends Extensible
@@ -45,6 +47,19 @@
static final String SEPID_DOMAIN = "jboss.ws";
static final String SEPID_PROPERTY_CONTEXT = "context";
static final String SEPID_PROPERTY_ENDPOINT = "endpoint";
+ static final String SERVICE = "servce";
+ static final String NAME = "name";
+ static final String SHORTNAME="shortname";
+ static final String STATE = "state";
+ static final String TYPE = "type";
+ static final String TARGETBEAN = "targetBean";
+ static final String REQUESTHANDLER = "requestHandler";
+ static final String INVOCATIONHANDLER = "invocationHandler";
+ static final String LIFECYCLEHANDLER = "lifecyleHandler";
+ static final String ADDRESS = "address";
+ static final String PRE_HANDLERCHAIN = "preHandlerChain";
+ static final String POST_HANDLERCHAIN = "postHandlerChain";
+ static final String SECURITY_DOMAIN = "securityDomain";
static final String SEPID_DOMAIN_ENDPOINT = SEPID_DOMAIN + "." + SEPID_PROPERTY_ENDPOINT;
@@ -142,5 +157,8 @@
EndpointConfig getEndpointConfig();
/** Set endpoint config */
- void setEndpointConfig(EndpointConfig config);
+ void setEndpointConfig(EndpointConfig config);
+
+ Map<String, String> getAllConfigsMap();
+
}
Modified: spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/Extensible.java
===================================================================
--- spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/Extensible.java 2015-03-09 21:53:55 UTC (rev 19545)
+++ spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/Extensible.java 2015-03-10 09:02:06 UTC (rev 19546)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -29,9 +29,10 @@
* A general extendible artifact
*
* @author Thomas.Diesler(a)jboss.com
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
* @since 20-Apr-2007
*/
-public interface Extensible
+public interface Extensible extends RuntimeConfig
{
/** Add arbitrary attachments */
<T> T addAttachment(Class<T> key, Object value);
@@ -58,5 +59,5 @@
Set<String> getProperties();
/** Set a map of properties */
- void setProperties(Map<String, Object> props);
+ void setProperties(Map<String, Object> props);
}
Added: spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/RuntimeConfig.java
===================================================================
--- spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/RuntimeConfig.java (rev 0)
+++ spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/RuntimeConfig.java 2015-03-10 09:02:06 UTC (rev 19546)
@@ -0,0 +1,44 @@
+/*
+ * 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.util.Map;
+/**
+ * Runtime config interface to allow change various property in runtime
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
+ *
+ */
+public interface RuntimeConfig {
+ static final String STATISTICS_ENABLED = "statistics-enabled";
+ /** Get runtime changeable property */
+ String getRuntimeProperty(String key);
+
+ /** Set runtime changeable property */
+ void setRuntimeProperty(String key, String value);
+
+ /** Remove a runtime changeable property */
+ void removeRuntimeProperty(String key);
+
+ /** Get the set of runtime changeable property names */
+ Map<String, String> getRuntimeProperties();
+
+}
Property changes on: spi/branches/management/src/main/java/org/jboss/wsf/spi/deployment/RuntimeConfig.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: spi/branches/management/src/main/java/org/jboss/wsf/spi/management/ServerConfig.java
===================================================================
--- spi/branches/management/src/main/java/org/jboss/wsf/spi/management/ServerConfig.java 2015-03-09 21:53:55 UTC (rev 19545)
+++ spi/branches/management/src/main/java/org/jboss/wsf/spi/management/ServerConfig.java 2015-03-10 09:02:06 UTC (rev 19546)
@@ -24,6 +24,7 @@
import java.io.File;
import java.net.UnknownHostException;
+import org.jboss.wsf.spi.deployment.Extensible;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
import org.jboss.wsf.spi.metadata.config.EndpointConfig;
@@ -32,9 +33,10 @@
*
* @author Thomas.Diesler(a)jboss.org
* @author alessio.soldano(a)jboss.com
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
* @since 08-May-2006
*/
-public interface ServerConfig
+public interface ServerConfig extends Extensible
{
/** The host name that is returned if there is no other defined */
String UNDEFINED_HOSTNAME = "jbossws.undefined.host";
9 years, 9 months
JBossWS SVN: r19545 - in stack/cxf/trunk/modules/testsuite/cxf-tests/src/test: resources/jaxws/cxf/fastinfoset/META-INF and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-03-09 17:53:55 -0400 (Mon, 09 Mar 2015)
New Revision: 19545
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeature.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeatureImpl.java
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF/MANIFEST.MF
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml
Log:
Extending fastinfost tests to use CXF Features
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java 2015-03-09 17:40:15 UTC (rev 19544)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java 2015-03-09 21:53:55 UTC (rev 19545)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -57,8 +57,8 @@
WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-cxf-fastinfoset.war");
archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ "Dependencies: org.apache.cxf\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorld.class)
.addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFeatureImpl.class)
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/fastinfoset/WEB-INF/web.xml"));
return archive;
}
@@ -93,5 +93,34 @@
}
+ @Test
+ @RunAsClient
+ public void testInfosetUsingFeature() throws Exception
+ {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream in = new ByteArrayOutputStream();
+ PrintWriter pwIn = new PrintWriter(in);
+ PrintWriter pwOut = new PrintWriter(out);
+ Bus bus = BusFactory.newInstance().createBus();
+ BusFactory.setThreadDefaultBus(bus);
+ try {
+ bus.getInInterceptors().add(new LoggingInInterceptor(pwIn));
+ bus.getOutInterceptors().add(new LoggingOutInterceptor(pwOut));
+
+ URL wsdlURL = new URL(baseURL + "HelloWorldService/HelloWorldFeatureImpl?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldFeatureService");
+ Service service = Service.create(wsdlURL, serviceName, new UseThreadBusFeature());
+ QName portQName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldFeatureImplPort");
+ HelloWorldFeature port = (HelloWorldFeature) service.getPort(portQName, HelloWorldFeature.class);
+ assertEquals("helloworldFeature", port.echo("helloworldFeature"));
+ assertTrue("request is expected fastinfoset", out.toString().indexOf("application/fastinfoset") > -1);
+ assertTrue("response is expected fastinfoset", in.toString().indexOf("application/fastinfoset") > -1);
+ } finally {
+ bus.shutdown(true);
+ pwOut.close();
+ pwIn.close();
+ }
+ }
+
}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeature.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeature.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeature.java 2015-03-09 21:53:55 UTC (rev 19545)
@@ -0,0 +1,33 @@
+/*
+ * 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.test.ws.jaxws.cxf.fastinfoset;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.feature.Features;
+
+@WebService(targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset")
+@Features(features = {"org.apache.cxf.feature.FastInfosetFeature"})
+public interface HelloWorldFeature
+{
+ String echo(String input);
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeature.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeatureImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeatureImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeatureImpl.java 2015-03-09 21:53:55 UTC (rev 19545)
@@ -0,0 +1,41 @@
+/*
+ * 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.test.ws.jaxws.cxf.fastinfoset;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.feature.FastInfosetFeature;
+import org.apache.cxf.feature.Features;
+
+@WebService
+(
+ serviceName = "HelloWorldFeatureService",
+ targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset"
+)
+@Features(classes = FastInfosetFeature.class)
+public class HelloWorldFeatureImpl
+{
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeatureImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java 2015-03-09 17:40:15 UTC (rev 19544)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java 2015-03-09 21:53:55 UTC (rev 19545)
@@ -28,11 +28,10 @@
@WebService
(
serviceName = "HelloWorldService",
- endpointInterface = "org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorld",
targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset"
)
@FastInfoset(force = true)
-public class HelloWorldImpl implements HelloWorld
+public class HelloWorldImpl
{
public String echo(String input)
{
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF/MANIFEST.MF
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF/MANIFEST.MF 2015-03-09 17:40:15 UTC (rev 19544)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF/MANIFEST.MF 2015-03-09 21:53:55 UTC (rev 19545)
@@ -1,2 +1,2 @@
Manifest-Version: 1.0
-Dependencies: org.apache.cxf.impl
\ No newline at end of file
+Dependencies: org.apache.cxf
\ No newline at end of file
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml 2015-03-09 17:40:15 UTC (rev 19544)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml 2015-03-09 21:53:55 UTC (rev 19545)
@@ -8,9 +8,17 @@
<servlet-name>TestServlet</servlet-name>
<servlet-class>org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>FeatureServlet</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFeatureImpl</servlet-class>
+ </servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/HelloWorldService/HelloWorldImpl</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>FeatureServlet</servlet-name>
+ <url-pattern>/HelloWorldService/HelloWorldFeatureImpl</url-pattern>
+ </servlet-mapping>
</web-app>
\ No newline at end of file
9 years, 9 months
JBossWS SVN: r19544 - spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-03-09 13:40:15 -0400 (Mon, 09 Mar 2015)
New Revision: 19544
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
Log:
Removing deprecated stuff
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2015-03-09 17:39:49 UTC (rev 19543)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2015-03-09 17:40:15 UTC (rev 19544)
@@ -53,7 +53,7 @@
*/
private final String portComponentName;
// The required <wsdl-port> element
- private volatile QName wsdlPort;
+ private final QName wsdlPort;
// The required <service-endpoint-interface> element
private final String serviceEndpointInterface;
// The required <ejb-link> or <servlet-link> in the <service-impl-bean> element
@@ -100,11 +100,9 @@
UnifiedHandlerChainsMetaData handlerChains)
{
this.portComponentName = portComponentName;
- if (wsdlPort != null) {
- if (wsdlPort.getNamespaceURI().length() == 0)
- Loggers.METADATA_LOGGER.webservicesXmlElementNotNamespaceQualified(wsdlPort);
- this.wsdlPort = wsdlPort;
- }
+ if (wsdlPort != null && wsdlPort.getNamespaceURI().length() == 0)
+ Loggers.METADATA_LOGGER.webservicesXmlElementNotNamespaceQualified(wsdlPort);
+ this.wsdlPort = wsdlPort;
this.serviceEndpointInterface = serviceEndpointInterface;
this.ejbLink = ejbLink;
this.servletLink = servletLink;
@@ -155,16 +153,6 @@
return wsdlPort;
}
- /**
- * set the wsdlPort for this PortComponentMetaData. This is deprecated, the proper wsdlPort
- * should be provided when creating a new instance.
- */
- @Deprecated
- public void setWsdlPort(QName wsdlPort)
- {
- this.wsdlPort = wsdlPort;
- }
-
public String getEjbLink()
{
return ejbLink;
@@ -238,7 +226,6 @@
public String serialize()
{
- final QName wsdlPort = getWsdlPort();
StringBuilder builder = new StringBuilder("<port-component>");
builder.append("<port-component-name>").append(portComponentName).append("</port-component-name>");
if (wsdlPort != null) {
9 years, 9 months
JBossWS SVN: r19543 - container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/util.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-03-09 13:39:49 -0400 (Mon, 09 Mar 2015)
New Revision: 19543
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java
Log:
[JBWS-3877] EndpointRegistry cleanup
Modified: container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java
===================================================================
--- container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java 2015-03-09 17:39:31 UTC (rev 19542)
+++ container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java 2015-03-09 17:39:49 UTC (rev 19543)
@@ -79,17 +79,6 @@
return false;
}
- @Override
- public void register(Endpoint endpoint) {
- // TODO:Remove this interface
-
- }
-
- @Override
- public void unregister(Endpoint endpoint) {
- // TODO:Remove this interface
- }
-
private Set<Endpoint> getRegisteredEndpoints() {
Set<Endpoint> endpoints = new CopyOnWriteArraySet<Endpoint>();
for (ServiceName sname : currentServiceContainer().getServiceNames()) {
9 years, 9 months
JBossWS SVN: r19542 - container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-03-09 13:39:31 -0400 (Mon, 09 Mar 2015)
New Revision: 19542
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java
Log:
[JBWS-3877] EndpointRegistry cleanup
Modified: container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java
===================================================================
--- container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java 2015-03-09 17:39:19 UTC (rev 19541)
+++ container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java 2015-03-09 17:39:31 UTC (rev 19542)
@@ -79,17 +79,6 @@
return false;
}
- @Override
- public void register(Endpoint endpoint) {
- // TODO:Remove this interface
-
- }
-
- @Override
- public void unregister(Endpoint endpoint) {
- // TODO:Remove this interface
- }
-
private Set<Endpoint> getRegisteredEndpoints() {
Set<Endpoint> endpoints = new CopyOnWriteArraySet<Endpoint>();
for (ServiceName sname : currentServiceContainer().getServiceNames()) {
9 years, 9 months
JBossWS SVN: r19541 - container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/util.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-03-09 13:39:19 -0400 (Mon, 09 Mar 2015)
New Revision: 19541
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java
Log:
[JBWS-3877] EndpointRegistry cleanup
Modified: container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java
===================================================================
--- container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java 2015-03-09 17:39:11 UTC (rev 19540)
+++ container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java 2015-03-09 17:39:19 UTC (rev 19541)
@@ -79,17 +79,6 @@
return false;
}
- @Override
- public void register(Endpoint endpoint) {
- // TODO:Remove this interface
-
- }
-
- @Override
- public void unregister(Endpoint endpoint) {
- // TODO:Remove this interface
- }
-
private Set<Endpoint> getRegisteredEndpoints() {
Set<Endpoint> endpoints = new CopyOnWriteArraySet<Endpoint>();
for (ServiceName sname : currentServiceContainer().getServiceNames()) {
9 years, 9 months
JBossWS SVN: r19540 - in common/trunk/src: main/java/org/jboss/ws/common/deployment and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-03-09 13:39:11 -0400 (Mon, 09 Mar 2015)
New Revision: 19540
Removed:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRegistryDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistryFactory.java
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistryMBean.java
common/trunk/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java
Modified:
common/trunk/src/main/java/org/jboss/ws/common/Loggers.java
common/trunk/src/main/java/org/jboss/ws/common/Messages.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java
Log:
[JBWS-3877] EndpointRegistry cleanup
Modified: common/trunk/src/main/java/org/jboss/ws/common/Loggers.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/Loggers.java 2015-03-09 17:38:52 UTC (rev 19539)
+++ common/trunk/src/main/java/org/jboss/ws/common/Loggers.java 2015-03-09 17:39:11 UTC (rev 19540)
@@ -95,23 +95,23 @@
@Message(id = 22027, value = "Cannot delete published wsdl document: %s")
void cannotDeletePublishedWsdlDoc(URL url);
- @LogMessage(level = ERROR)
- @Message(id = 22038, value = "Cannot register endpoint %s with JMX server")
- void cannotRegisterEndpointWithJmxServer(ObjectName endpointName, @Cause Throwable cause);
+// @LogMessage(level = ERROR)
+// @Message(id = 22038, value = "Cannot register endpoint %s with JMX server")
+// void cannotRegisterEndpointWithJmxServer(ObjectName endpointName, @Cause Throwable cause);
+//
+// @LogMessage(level = ERROR)
+// @Message(id = 22039, value = "Cannot unregister endpoint %s with JMX server")
+// void cannotUnregisterEndpointWithJmxServer(ObjectName endpointName, @Cause Throwable cause);
+//
+// @LogMessage(level = WARN)
+// @Message(id = 22040, value = "MBeanServer not available, cannot unregister endpoint with JMX server")
+// void cannotUnregisterDueToMBeanServerUnavailable();
+//
+// @LogMessage(level = DEBUG)
+// @Message(id = 22041, value = "Destroying service endpoint manager")
+// void destroyingServiceEndpointManager();
- @LogMessage(level = ERROR)
- @Message(id = 22039, value = "Cannot unregister endpoint %s with JMX server")
- void cannotUnregisterEndpointWithJmxServer(ObjectName endpointName, @Cause Throwable cause);
-
- @LogMessage(level = WARN)
- @Message(id = 22040, value = "MBeanServer not available, cannot unregister endpoint with JMX server")
- void cannotUnregisterDueToMBeanServerUnavailable();
-
@LogMessage(level = DEBUG)
- @Message(id = 22041, value = "Destroying service endpoint manager")
- void destroyingServiceEndpointManager();
-
- @LogMessage(level = DEBUG)
@Message(id = 22042, value = "Cannot register processor %s with JMX server, will be trying using the default managed implementation. ")
void cannotRegisterProvidedProcessor(ObjectName processorName, @Cause Throwable cause);
@@ -123,15 +123,15 @@
@Message(id = 22044, value = "Cannot unregister processor %s with JMX server")
void cannotUnregisterProcessorWithJmxServer(ObjectName processorName, @Cause Throwable cause);
- @LogMessage(level = INFO)
- @Message(id = 22050, value = "Endpoint registered: %s")
- void endpointRegistered(ObjectName epName);
+// @LogMessage(level = INFO)
+// @Message(id = 22050, value = "Endpoint registered: %s")
+// void endpointRegistered(ObjectName epName);
+//
+// @LogMessage(level = INFO)
+// @Message(id = 22051, value = "Endpoint unregistered: %s")
+// void endpointUnregistered(ObjectName epName);
@LogMessage(level = INFO)
- @Message(id = 22051, value = "Endpoint unregistered: %s")
- void endpointUnregistered(ObjectName epName);
-
- @LogMessage(level = INFO)
@Message(id = 22052, value = "Starting %s %s")
void startingWSServerConfig(String implTitle, String implVersion);
Modified: common/trunk/src/main/java/org/jboss/ws/common/Messages.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/Messages.java 2015-03-09 17:38:52 UTC (rev 19539)
+++ common/trunk/src/main/java/org/jboss/ws/common/Messages.java 2015-03-09 17:39:11 UTC (rev 19540)
@@ -125,21 +125,21 @@
@Message(id = 22037, value = "Annotation class cannot be null")
IllegalArgumentException annotationClassCannotBeNull();
- @Message(id = 22045, value = "Cannot register / unregister null endpoint")
- IllegalArgumentException cannotRegisterUnregisterNullEndpoint();
+// @Message(id = 22045, value = "Cannot register / unregister null endpoint")
+// IllegalArgumentException cannotRegisterUnregisterNullEndpoint();
+//
+// @Message(id = 22046, value = "Looking for endpoints with null name in the endpoint registry is not supported")
+// IllegalArgumentException endpointNameCannotBeNull();
+//
+// @Message(id = 22047, value = "Cannot register endpoint with null name: %s")
+// IllegalArgumentException cannotRegisterEndpointWithNullName(ObjectName epName);
+//
+// @Message(id = 22048, value = "Endpoint already registered: %s")
+// IllegalStateException endpointAlreadyRegistered(ObjectName endpointName);
+//
+// @Message(id = 22049, value = "Endpoint not registered: %s")
+// IllegalStateException endpointNotRegistered(ObjectName endpointName);
- @Message(id = 22046, value = "Looking for endpoints with null name in the endpoint registry is not supported")
- IllegalArgumentException endpointNameCannotBeNull();
-
- @Message(id = 22047, value = "Cannot register endpoint with null name: %s")
- IllegalArgumentException cannotRegisterEndpointWithNullName(ObjectName epName);
-
- @Message(id = 22048, value = "Endpoint already registered: %s")
- IllegalStateException endpointAlreadyRegistered(ObjectName endpointName);
-
- @Message(id = 22049, value = "Endpoint not registered: %s")
- IllegalStateException endpointNotRegistered(ObjectName endpointName);
-
@Message(id = 22062, value = "Cannot find attachment %s in webservice deployment %s")
IllegalStateException cannotFindAttachmentInDeployment(Class<?> attachmentClass, String dep);
Deleted: common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRegistryDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRegistryDeploymentAspect.java 2015-03-09 17:38:52 UTC (rev 19539)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRegistryDeploymentAspect.java 2015-03-09 17:39:11 UTC (rev 19540)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.ws.common.deployment;
-
-import org.jboss.ws.common.integration.AbstractDeploymentAspect;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-
-/**
- * A deployer that registers the endpoints
- *
- * @author Thomas.Diesler(a)jboss.com
- */
-public class EndpointRegistryDeploymentAspect extends AbstractDeploymentAspect
-{
- private EndpointRegistryFactory factory;
-
- public void start(Deployment dep)
- {
- if (factory == null) {
- factory = SPIProvider.getInstance().getSPI(EndpointRegistryFactory.class);
- }
- EndpointRegistry registry = factory.getEndpointRegistry();
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- registry.register(ep);
- }
- }
-
- public void stop(Deployment dep)
- {
- if (factory == null) {
- factory = SPIProvider.getInstance().getSPI(EndpointRegistryFactory.class);
- }
- EndpointRegistry registry = factory.getEndpointRegistry();
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- registry.unregister(ep);
- }
- }
-
-}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java 2015-03-09 17:38:52 UTC (rev 19539)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java 2015-03-09 17:39:11 UTC (rev 19540)
@@ -46,6 +46,7 @@
private static final String META_INF_JAXB_INTROS_XML = "META-INF/jaxb-intros.xml";
private static final String WEB_INF_JAXB_INTROS_XML = "WEB-INF/jaxb-intros.xml";
+ @SuppressWarnings("unchecked")
public void start(Deployment deployment)
{
// assert ArchiveDeployment
Deleted: common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java 2015-03-09 17:38:52 UTC (rev 19539)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java 2015-03-09 17:39:11 UTC (rev 19540)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, 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.ws.common.management;
-
-import static org.jboss.ws.common.Loggers.MANAGEMENT_LOGGER;
-import static org.jboss.ws.common.Messages.MESSAGES;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.management.ObjectName;
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointResolver;
-
-/**
- * A general endpoint registry.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @author alessio.soldano(a)jboss.com
- *
- * @since 20-Apr-2007
- */
-public class DefaultEndpointRegistry implements EndpointRegistry
-{
- private final Map<ObjectName, Endpoint> endpoints = new ConcurrentHashMap<ObjectName, Endpoint>();
-
- public Endpoint getEndpoint(ObjectName epName)
- {
- if (epName == null)
- throw MESSAGES.endpointNameCannotBeNull();
-
- if (isRegistered(epName) == false)
- throw MESSAGES.endpointNotRegistered(epName);
-
- Endpoint endpoint = endpoints.get(epName);
- return endpoint;
- }
-
- public Endpoint resolve(EndpointResolver resolver)
- {
- return resolver.query(endpoints.values().iterator());
- }
-
- public boolean isRegistered(ObjectName epName)
- {
- if (epName == null)
- throw MESSAGES.endpointNameCannotBeNull();
-
- return endpoints.get(epName) != null;
- }
-
- public Set<ObjectName> getEndpoints()
- {
- return endpoints.keySet();
- }
-
- public void register(Endpoint endpoint)
- {
- if (endpoint == null)
- throw MESSAGES.cannotRegisterUnregisterNullEndpoint();
-
- ObjectName epName = endpoint.getName();
- if (epName == null)
- throw MESSAGES.cannotRegisterEndpointWithNullName(endpoint.getName());
-
- if (isRegistered(epName))
- throw MESSAGES.endpointAlreadyRegistered(epName);
-
- MANAGEMENT_LOGGER.endpointRegistered(epName);
- endpoints.put(epName, endpoint);
- }
-
- public void unregister(Endpoint endpoint)
- {
- if (endpoint == null)
- throw MESSAGES.cannotRegisterUnregisterNullEndpoint();
-
- ObjectName epName = endpoint.getName();
- if (isRegistered(epName) == false)
- throw MESSAGES.endpointNotRegistered(epName);
-
- MANAGEMENT_LOGGER.endpointUnregistered(epName);
- endpoints.remove(epName);
- }
-}
Deleted: common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistryFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistryFactory.java 2015-03-09 17:38:52 UTC (rev 19539)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistryFactory.java 2015-03-09 17:39:11 UTC (rev 19540)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, 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.ws.common.management;
-
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-
-/**
- * Retrieves default registry
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class DefaultEndpointRegistryFactory extends EndpointRegistryFactory
-{
-
- private static final EndpointRegistry ENDPOINT_REGISTRY = new DefaultEndpointRegistry();
-
- public EndpointRegistry getEndpointRegistry()
- {
- return ENDPOINT_REGISTRY;
- }
-
-}
Deleted: common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java 2015-03-09 17:38:52 UTC (rev 19539)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java 2015-03-09 17:39:11 UTC (rev 19540)
@@ -1,101 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.ws.common.management;
-
-import static org.jboss.ws.common.Loggers.MANAGEMENT_LOGGER;
-
-import javax.management.JMException;
-import javax.management.MBeanServer;
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-
-/**
- * A Service Endpoint Registry
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-May-2007
- */
-public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements ManagedEndpointRegistryMBean
-{
- // The MBeanServer
- private volatile MBeanServer mbeanServer;
-
- public MBeanServer getMbeanServer()
- {
- return mbeanServer;
- }
-
- public void setMbeanServer(MBeanServer mbeanServer)
- {
- this.mbeanServer = mbeanServer;
- }
-
- @Override
- public void register(Endpoint endpoint)
- {
- super.register(endpoint);
-
- try
- {
- ManagedEndpoint jmxEndpoint = new ManagedEndpoint(endpoint, mbeanServer);
- getMbeanServer().registerMBean(jmxEndpoint, endpoint.getName());
- }
- catch (Exception ex)
- {
- MANAGEMENT_LOGGER.cannotRegisterEndpointWithJmxServer(endpoint.getName(), ex);
- }
- }
-
- @Override
- public void unregister(Endpoint endpoint)
- {
- super.unregister(endpoint);
- try
- {
- if (getMbeanServer() != null)
- getMbeanServer().unregisterMBean(endpoint.getName());
- else
- MANAGEMENT_LOGGER.cannotUnregisterDueToMBeanServerUnavailable();
- }
- catch (JMException ex)
- {
- MANAGEMENT_LOGGER.cannotUnregisterEndpointWithJmxServer(endpoint.getName(), ex);
- }
- }
-
- public void create() throws Exception
- {
- if (mbeanServer != null)
- {
- getMbeanServer().registerMBean(this, OBJECT_NAME);
- }
- }
-
- public void destroy() throws Exception
- {
- MANAGEMENT_LOGGER.destroyingServiceEndpointManager();
- if (mbeanServer != null)
- {
- getMbeanServer().unregisterMBean(OBJECT_NAME);
- }
- }
-}
Deleted: common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistryMBean.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistryMBean.java 2015-03-09 17:38:52 UTC (rev 19539)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistryMBean.java 2015-03-09 17:39:11 UTC (rev 19540)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.ws.common.management;
-
-import javax.management.ObjectName;
-
-import org.jboss.ws.common.ObjectNameFactory;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-
-/**
- * MBean interface.
- * @since 15-April-2004
- */
-public interface ManagedEndpointRegistryMBean extends EndpointRegistry
-{
- /** The object name in the MBean server */
- ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=EndpointRegistry");
-}
Modified: common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java 2015-03-09 17:38:52 UTC (rev 19539)
+++ common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java 2015-03-09 17:39:11 UTC (rev 19540)
@@ -26,7 +26,6 @@
import org.jboss.ws.common.deployment.DefaultDeploymentModelFactory;
import org.jboss.ws.common.deployment.DefaultLifecycleHandlerFactory;
import org.jboss.ws.common.management.DefaultEndpointMetricsFactory;
-import org.jboss.ws.common.management.DefaultEndpointRegistryFactory;
import org.jboss.ws.common.management.DefaultJMSEndpointResolver;
import org.jboss.ws.common.security.DefaultSecurityAdapterFactory;
import org.jboss.wsf.spi.SPIProvider;
@@ -34,7 +33,6 @@
import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
import org.jboss.wsf.spi.management.EndpointMetricsFactory;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
import org.jboss.wsf.spi.management.JMSEndpointResolver;
/**
@@ -68,10 +66,6 @@
{
returnType = loadService(spiType, DefaultSecurityAdapterFactory.class, loader);
}
- else if (EndpointRegistryFactory.class.equals(spiType))
- {
- returnType = loadService(spiType, DefaultEndpointRegistryFactory.class, loader);
- }
else if (JMSEndpointResolver.class.equals(spiType))
{
returnType = loadService(spiType, DefaultJMSEndpointResolver.class, loader);
Deleted: common/trunk/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java
===================================================================
--- common/trunk/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java 2015-03-09 17:38:52 UTC (rev 19539)
+++ common/trunk/src/test/java/org/jboss/test/ws/common/management/DefaultEndpointRegistryTestCase.java 2015-03-09 17:39:11 UTC (rev 19540)
@@ -1,422 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, 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.test.ws.common.management;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-
-import javax.management.ObjectName;
-
-import org.jboss.ws.api.monitoring.Record;
-import org.jboss.ws.api.monitoring.RecordProcessor;
-import org.jboss.ws.common.management.DefaultEndpointRegistry;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.EndpointState;
-import org.jboss.wsf.spi.deployment.EndpointType;
-import org.jboss.wsf.spi.deployment.InstanceProvider;
-import org.jboss.wsf.spi.deployment.LifecycleHandler;
-import org.jboss.wsf.spi.deployment.Service;
-import org.jboss.wsf.spi.invocation.InvocationHandler;
-import org.jboss.wsf.spi.invocation.RequestHandler;
-import org.jboss.wsf.spi.management.EndpointMetrics;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.metadata.config.EndpointConfig;
-import org.jboss.wsf.spi.security.SecurityDomainContext;
-
-import junit.framework.TestCase;
-
-/**
- * Test the DefaultEndpointRegistry
- *
- * @author alessio.soldano(a)jboss.com
- * @since 23-Apr-2012
- */
-public class DefaultEndpointRegistryTestCase extends TestCase
-{
- public void testSingleThreadAccess() throws Exception {
- final int MAX = 10;
- DefaultEndpointRegistry reg = new DefaultEndpointRegistry();
- for (int i = 0; i < MAX; i++) {
- Endpoint ep = getTestEndpoint("Foo" + i, "prop", "v" + i);
- reg.register(ep);
- }
-
- Iterator<ObjectName> it = reg.getEndpoints().iterator();
- checkContents(it, MAX);
-
- reg.register(getTestEndpoint("Foo" + MAX, "prop", "v" + MAX));
-
- assertFalse(it.hasNext());
- checkContents(reg.getEndpoints().iterator(), MAX + 1);
- }
-
- public void testConcurrentAccess() throws Exception {
- DefaultEndpointRegistry reg = new DefaultEndpointRegistry();
- reg.register(getTestEndpoint("Test", "prop", "my-value"));
- ExecutorService es = Executors.newFixedThreadPool(2);
- List<Callable<Boolean>> callables = new LinkedList<Callable<Boolean>>();
- final int size = 10;
- for (int i = 1; i <= 10; i++) {
- callables.add(new Register(reg, "Foo", i * size, size));
- }
- callables.add(new Reader(reg, "my-value"));
- for (int i = 11; i <= 20; i++) {
- callables.add(new Register(reg, "Foo", i * size, size));
- }
- callables.add(new Reader(reg, "my-value"));
-
- List<Future<Boolean>> results = es.invokeAll(callables);
- for (Future<Boolean> f : results) {
- assertTrue(f.get(10, TimeUnit.SECONDS));
- }
- es.shutdown();
- }
-
- private class Register implements Callable<Boolean> {
- private final EndpointRegistry reg;
- private final String name;
- private final int base;
- private final int n;
-
- public Register(EndpointRegistry reg, String name, int base, int n) {
- this.reg = reg;
- this.name = name;
- this.base = base;
- this.n = n;
- }
-
- @Override
- public Boolean call() throws Exception
- {
- for (int i = base; i < (base + n); i++) {
- try {
- Endpoint ep = getTestEndpoint(name + i, "prop", "v" + i);
- reg.register(ep);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- return true;
- }
- }
-
- private class Reader implements Callable<Boolean> {
- private final EndpointRegistry reg;
- private final String value;
-
- public Reader(EndpointRegistry reg, String value) {
- this.reg = reg;
- this.value = value;
- }
-
- @Override
- public Boolean call() throws Exception
- {
- boolean result = false;
- //below is what org.jboss.wsf.stack.cxf.transport.ServletHelper does for instance
- for (ObjectName on : reg.getEndpoints()) {
- if (on.getKeyProperty("prop").equalsIgnoreCase(value)) {
- result = true; //do not early exit
- }
- }
- return result;
- }
-
- }
-
- private static void checkContents(Iterator<ObjectName> it, int n) {
- List<String> values = new LinkedList<String>();
- for (int i = 0; i < n; i++) {
- values.add("v" + i);
- }
- while (it.hasNext()) {
- String p = it.next().getKeyProperty("prop");
- if (values.contains(p)) {
- values.remove(p);
- }
- }
- assertTrue("Could not find " + values, values.isEmpty());
- }
-
- private static Endpoint getTestEndpoint(String name, String prop, String value) throws Exception {
- final ObjectName objName = new ObjectName(name, prop, value);
- return new Endpoint()
- {
-
- @Override
- public void setProperty(String key, Object value)
- {
-
- }
-
- @Override
- public void setProperties(Map<String, Object> props)
- {
-
- }
-
- @Override
- public void removeProperty(String key)
- {
-
- }
-
- @Override
- public <T> T removeAttachment(Class<T> key)
- {
- return null;
- }
-
- @Override
- public Object getProperty(String key)
- {
- return null;
- }
-
- @Override
- public Set<String> getProperties()
- {
- return null;
- }
-
- @Override
- public <T> Collection<T> getAttachments()
- {
- return null;
- }
-
- @Override
- public <T> T getAttachment(Class<T> key)
- {
- return null;
- }
-
- @Override
- public <T> T addAttachment(Class<T> key, Object value)
- {
- return null;
- }
-
- @Override
- public void setType(EndpointType type)
- {
-
- }
-
- @Override
- public void setTargetBeanName(String epImpl)
- {
-
- }
-
- @Override
- public void setState(EndpointState state)
- {
-
- }
-
- @Override
- public void setShortName(String shortName)
- {
-
- }
-
- @Override
- public void setService(Service service)
- {
-
- }
-
- @Override
- public void setSecurityDomainContext(SecurityDomainContext context)
- {
-
- }
-
- @Override
- public void setRequestHandler(RequestHandler handler)
- {
-
- }
-
- @Override
- public void setRecordProcessors(List<RecordProcessor> recordProcessors)
- {
-
- }
-
- @Override
- public void setName(ObjectName epName)
- {
-
- }
-
- @Override
- public void setLifecycleHandler(LifecycleHandler handler)
- {
-
- }
-
- @Override
- public void setInvocationHandler(InvocationHandler invoker)
- {
-
- }
-
- @Override
- public void setInstanceProvider(InstanceProvider provider)
- {
-
- }
-
- @Override
- public void setEndpointMetrics(EndpointMetrics metrics)
- {
-
- }
-
- @Override
- public void setAddress(String address)
- {
-
- }
-
- @Override
- public void processRecord(Record record)
- {
-
- }
-
- @Override
- public EndpointType getType()
- {
- return null;
- }
-
- @Override
- public String getTargetBeanName()
- {
- return null;
- }
-
- @Override
- public Class getTargetBeanClass()
- {
- return null;
- }
-
- @Override
- public EndpointState getState()
- {
- return null;
- }
-
- @Override
- public String getShortName()
- {
- return null;
- }
-
- @Override
- public Service getService()
- {
- return null;
- }
-
- @Override
- public SecurityDomainContext getSecurityDomainContext()
- {
- return null;
- }
-
- @Override
- public RequestHandler getRequestHandler()
- {
- return null;
- }
-
- @Override
- public List<RecordProcessor> getRecordProcessors()
- {
- return null;
- }
-
- @Override
- public ObjectName getName()
- {
- return objName;
- }
-
- @Override
- public LifecycleHandler getLifecycleHandler()
- {
- return null;
- }
-
- @Override
- public InvocationHandler getInvocationHandler()
- {
- return null;
- }
-
- @Override
- public InstanceProvider getInstanceProvider()
- {
- return null;
- }
-
- @Override
- public EndpointMetrics getEndpointMetrics()
- {
- return null;
- }
-
- @Override
- public String getAddress()
- {
- return null;
- }
-
- @Override
- public EndpointConfig getEndpointConfig()
- {
- return null;
- }
-
- @Override
- public void setEndpointConfig(EndpointConfig config)
- {
- // TODO Auto-generated method stub
-
- }
- };
- }
-}
9 years, 9 months