JBossWS SVN: r18156 - in stack/cxf/branches/jbossws-cxf-4.2.x/modules: server/src/main/java/org/jboss/wsf/stack/cxf/deployment and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2013-12-09 13:43:51 -0500 (Mon, 09 Dec 2013)
New Revision: 18156
Modified:
stack/cxf/branches/jbossws-cxf-4.2.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
stack/cxf/branches/jbossws-cxf-4.2.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java
stack/cxf/branches/jbossws-cxf-4.2.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
Log:
bz-1032593: added method to remove app's wsdl directory
Modified: stack/cxf/branches/jbossws-cxf-4.2.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-4.2.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2013-12-09 11:35:52 UTC (rev 18155)
+++ stack/cxf/branches/jbossws-cxf-4.2.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2013-12-09 18:43:51 UTC (rev 18156)
@@ -208,4 +208,20 @@
@LogMessage(level = WARN)
@Message(id = 24095, value = "Unknown strategy '%s' requested for selecting the Apache CXF Bus to be used for building JAXWS clients; default strategy will be used.")
void unknownJAXWSClientBusStrategy(String strategy);
+
+ @LogMessage(level = WARN)
+ @Message(id = 24097, value = "Could not delete wsdl file %s")
+ void couldNotDeleteWsdlFile(String filename);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24098, value = "Deleted wsdl file %s")
+ void deletedWsdlFile(String filename);
+
+ @LogMessage(level = WARN)
+ @Message(id = 24099, value = "Could not create wsdl data path.")
+ void couldNotCreateWsdlDataPath();
+
+ @LogMessage(level = WARN)
+ @Message(id = 24100, value = "Could not delete wsdl directory %s")
+ void couldNotDeleteWsdlDirectory(String filename);
}
Modified: stack/cxf/branches/jbossws-cxf-4.2.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-4.2.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java 2013-12-09 11:35:52 UTC (rev 18155)
+++ stack/cxf/branches/jbossws-cxf-4.2.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java 2013-12-09 18:43:51 UTC (rev 18156)
@@ -90,6 +90,8 @@
// Publish XMLSchema imports
publishSchemaImports(wsdlPublishURL, doc.getDocumentElement(), published, expLocation);
+
+ dep.addAttachment(WSDLFilePublisher.class, this);
}
else
{
@@ -105,7 +107,48 @@
throw Messages.MESSAGES.cannotPublishWSDLTo(serviceName, wsdlFile, e);
}
}
-
+
+ public void unpublishWsdlFiles()
+ {
+ String deploymentName = dep.getCanonicalName();
+
+ if (deploymentName.startsWith("http://"))
+ {
+ deploymentName = deploymentName.replace("http://", "http-");
+ }
+
+ try {
+
+ File publishDir = new File(serverConfig.getServerDataDir().getCanonicalPath()
+ + "/wsdl/" + deploymentName);
+ if (publishDir.exists())
+ {
+ File[] wsdlFileList = publishDir.listFiles();
+ if (wsdlFileList != null)
+ {
+ for (int i = 0; i < wsdlFileList.length; i++)
+ {
+ File f = wsdlFileList[i];
+ if (f.delete())
+ {
+ Loggers.DEPLOYMENT_LOGGER.deletedWsdlFile(f.getAbsolutePath());
+ } else {
+ Loggers.DEPLOYMENT_LOGGER.couldNotDeleteWsdlFile(f.getAbsolutePath());
+ }
+ }
+ }
+ }
+
+ if (!publishDir.delete())
+ {
+ Loggers.DEPLOYMENT_LOGGER.couldNotDeleteWsdlDirectory(publishDir.getAbsolutePath());
+ }
+
+ } catch (IOException e) {
+ Loggers.DEPLOYMENT_LOGGER.couldNotCreateWsdlDataPath();
+ }
+ }
+
private static Document getWsdlDocument(Bus bus, Definition def) throws WSDLException
{
WSDLWriter wsdlWriter = bus.getExtension(WSDLManager.class).getWSDLFactory().newWSDLWriter();
Modified: stack/cxf/branches/jbossws-cxf-4.2.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-4.2.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2013-12-09 11:35:52 UTC (rev 18155)
+++ stack/cxf/branches/jbossws-cxf-4.2.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2013-12-09 18:43:51 UTC (rev 18156)
@@ -74,6 +74,12 @@
if (holder != null)
{
holder.close();
+
+ WSDLFilePublisher wsdlFilePublisher = dep.getAttachment(WSDLFilePublisher.class);
+ if (wsdlFilePublisher != null)
+ {
+ wsdlFilePublisher.unpublishWsdlFiles();
+ }
}
}
11 years
JBossWS SVN: r18155 - in stack/cxf/branches/jaspi/modules: server/src/main/java/org/jboss/wsf/stack/cxf/jaspi and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-12-09 06:35:52 -0500 (Mon, 09 Dec 2013)
New Revision: 18155
Added:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/jboss-webservices.xml
Modified:
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
Log:
Configure jaspi security domain in jboss-webservices.xml
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2013-12-09 11:04:23 UTC (rev 18154)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2013-12-09 11:35:52 UTC (rev 18155)
@@ -138,7 +138,7 @@
epConfigFile = wsmd.getConfigFile();
}
- JaspiServerAuthenticator jaspiAuthenticator = getJaspiAuthenticator(dep);
+ JaspiServerAuthenticator jaspiAuthenticator = getJaspiAuthenticator(dep, wsmd);
Configurer configurer = holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class),
new WSDLFilePublisher(aDep), dep.getService().getEndpoints(), aDep.getRootFile(), epConfigName, epConfigFile);
@@ -152,9 +152,14 @@
}
}
- private JaspiServerAuthenticator getJaspiAuthenticator(Deployment dep) {
- //TODO: get security-domain from jboss-webservices.xml and get hostname
- String securityDomain = "jaspi";
+ private JaspiServerAuthenticator getJaspiAuthenticator(Deployment dep, JBossWebservicesMetaData wsmd) {
+ String securityDomain = null;
+ if (wsmd != null) {
+ securityDomain = wsmd.getProperty(JaspiServerAuthenticator.JASPI_SECURITY_DOMAIN);
+ }
+ if (securityDomain == null) {
+ return null;
+ }
ApplicationPolicy appPolicy = SecurityConfiguration.getApplicationPolicy(securityDomain);
if (appPolicy == null) {
Loggers.ROOT_LOGGER.noApplicationPolicy(securityDomain);
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java 2013-12-09 11:04:23 UTC (rev 18154)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java 2013-12-09 11:35:52 UTC (rev 18155)
@@ -49,6 +49,7 @@
*/
public class JaspiServerAuthenticator
{
+ public static final String JASPI_SECURITY_DOMAIN = "jaspi.security.domain";
private ServerAuthConfig serverConfig;
private String securityDomain;
private JASPIAuthenticationInfo jpi;
Modified: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-12-09 11:04:23 UTC (rev 18154)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-12-09 11:35:52 UTC (rev 18155)
@@ -298,7 +298,7 @@
</classes>
<webinf dir="${tests.output.dir}/test-resources//jaxws/cxf/jaspi/WEB-INF">
- <include name="jboss-web.xml"/>
+ <include name="jboss-*.xml"/>
</webinf>
</war>
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/jboss-webservices.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/jboss-webservices.xml (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/jboss-webservices.xml 2013-12-09 11:35:52 UTC (rev 18155)
@@ -0,0 +1,13 @@
+<?xml version="1.1" encoding="UTF-8"?>
+<webservices
+ xmlns="http://www.jboss.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="1.2"
+ xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee">
+
+ <property>
+ <name>jaspi.security.domain</name>
+ <value>jaspi</value>
+ </property>
+
+</webservices>
\ No newline at end of file
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/jboss-webservices.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
11 years
JBossWS SVN: r18154 - stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-09 06:04:23 -0500 (Mon, 09 Dec 2013)
New Revision: 18154
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
Log:
[JBWS-3743] Block HTTP GET requests with no query string
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2013-12-09 07:56:52 UTC (rev 18153)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2013-12-09 11:04:23 UTC (rev 18154)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
@@ -64,7 +65,7 @@
*/
public class RequestHandlerImpl implements RequestHandler
{
- private static RequestHandlerImpl me = new RequestHandlerImpl();
+ private static final RequestHandlerImpl me = new RequestHandlerImpl();
RequestHandlerImpl()
{
@@ -191,7 +192,7 @@
* @throws ServletException if some problem occurs
*/
private final boolean handleQuery(HttpServletRequest req, HttpServletResponse res, AbstractHTTPDestination dest, Bus bus)
- throws ServletException
+ throws ServletException, IOException
{
final String queryString = req.getQueryString();
if ((null != queryString) && (queryString.length() > 0))
@@ -226,6 +227,16 @@
}
}
}
+ else if ("GET".equals(req.getMethod()))
+ {
+ //reject HTTP GET without query string (only support messages sent w/ POST)
+ res.setStatus(405);
+ res.setContentType("text/plain");
+ Writer out = res.getWriter();
+ out.write("HTTP GET not supported");
+ out.close();
+ return true;
+ }
return false;
}
11 years
JBossWS SVN: r18153 - stack/cxf/branches/jaspi.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-12-09 02:56:52 -0500 (Mon, 09 Dec 2013)
New Revision: 18153
Modified:
stack/cxf/branches/jaspi/
stack/cxf/branches/jaspi/pom.xml
Log:
Sync with trunk
Property changes on: stack/cxf/branches/jaspi
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/cxf/branches/asoldano:14032-14050,14068
/stack/cxf/branches/ropalka:16301-16305,16966-17008
/stack/cxf/branches/ropalka_JBWS-3550:16747-16757
/stack/cxf/trunk:18054-18096
+ /stack/cxf/branches/asoldano:14032-14050,14068
/stack/cxf/branches/ropalka:16301-16305,16966-17008
/stack/cxf/branches/ropalka_JBWS-3550:16747-16757
/stack/cxf/trunk:18054-18152
Modified: stack/cxf/branches/jaspi/pom.xml
===================================================================
--- stack/cxf/branches/jaspi/pom.xml 2013-12-06 16:20:30 UTC (rev 18152)
+++ stack/cxf/branches/jaspi/pom.xml 2013-12-09 07:56:52 UTC (rev 18153)
@@ -65,14 +65,14 @@
<jbossws.common.tools.version>1.2.0.Final</jbossws.common.tools.version>
<jbossws.jboss712.version>4.2.1.Final</jbossws.jboss712.version>
<jbossws.jboss713.version>4.2.1.Final</jbossws.jboss713.version>
- <jbossws.jboss720.version>4.2.2.Final</jbossws.jboss720.version>
+ <jbossws.jboss720.version>4.3.0-SNAPSHOT</jbossws.jboss720.version>
<jbossws.native.version>4.1.2.Final</jbossws.native.version>
<jboss712.version>7.1.2.Final</jboss712.version>
<jboss713.version>7.1.3.Final</jboss713.version>
<jboss720.version>7.2.0.Final</jboss720.version>
<wildfly800.version>8.0.0.Beta2-SNAPSHOT</wildfly800.version>
<ejb.api.version>1.0.2.Final</ejb.api.version>
- <cxf.version>2.7.8-SNAPSHOT</cxf.version>
+ <cxf.version>2.7.8</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>2.6.1</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
@@ -103,8 +103,8 @@
<jms.api.version>1.0.1.Final</jms.api.version>
<velocity.version>1.7</velocity.version>
<xerces.version>2.9.1</xerces.version>
- <xmlsec.version>1.5.5</xmlsec.version>
- <wss4j.version>1.6.13-SNAPSHOT</wss4j.version>
+ <xmlsec.version>1.5.6</xmlsec.version>
+ <wss4j.version>1.6.13</wss4j.version>
<wstx.version>4.2.0</wstx.version>
<spring.version>3.0.7.RELEASE</spring.version>
<shrinkwrap.version>1.1.3</shrinkwrap.version>
11 years
JBossWS SVN: r18152 - common/trunk/src/main/java/org/jboss/ws/common/management.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-06 11:20:30 -0500 (Fri, 06 Dec 2013)
New Revision: 18152
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java
Log:
[JBWS-3742] Prevent / by 0
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java 2013-12-06 15:53:33 UTC (rev 18151)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java 2013-12-06 16:20:30 UTC (rev 18152)
@@ -144,7 +144,8 @@
{
w.lock();
try {
- return totalProcessingTime.get() / (responseCount.get() + faultCount.get());
+ final long totResponses = responseCount.get() + faultCount.get();
+ return totResponses != 0 ? totalProcessingTime.get() / totResponses : 0;
} finally {
w.unlock();
}
11 years
JBossWS SVN: r18151 - in common/trunk/src/main/java/org/jboss/ws/common: management and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-06 10:53:33 -0500 (Fri, 06 Dec 2013)
New Revision: 18151
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointMBean.java
Log:
[JBWS-3742] Making EndpointMetricsImpl thread-safe and pruning useless stuff in it
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java 2013-12-06 15:52:39 UTC (rev 18150)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java 2013-12-06 15:53:33 UTC (rev 18151)
@@ -45,7 +45,6 @@
public void setEndpointMetrics(EndpointMetrics metrics)
{
assertEndpointSetterAccess();
- metrics.setEndpoint(this);
this.metrics = metrics;
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java 2013-12-06 15:52:39 UTC (rev 18150)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java 2013-12-06 15:53:33 UTC (rev 18151)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -21,149 +21,163 @@
*/
package org.jboss.ws.common.management;
-import java.util.Date;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
-import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.management.EndpointMetrics;
/**
* Service Endpoint Metrics
*
+ * @author alessio.soldano(a)jboss.com
* @author Thomas.Diesler(a)jboss.org
* @since 14-Dec-2005
*/
public class EndpointMetricsImpl implements EndpointMetrics
{
- private Endpoint endpoint;
+ private volatile boolean started = false;
+
+ //read-write lock for average calculation (there's no CAS function for
+ //atomically computing the average, so we do that on-demand within a
+ //write lock; the updates to sum and response/fault counts, which are
+ //used to compute the average, are updated within read locks)
+ private final ReadWriteLock lock = new ReentrantReadWriteLock();
+ private final Lock r = lock.readLock();
+ private final Lock w = lock.writeLock();
+
+ private final AtomicLong requestCount = new AtomicLong(0);
+ private final AtomicLong responseCount = new AtomicLong(0);
+ private final AtomicLong faultCount = new AtomicLong(0);
+ private final AtomicLong maxProcessingTime = new AtomicLong(0);
+ private final AtomicLong minProcessingTime = new AtomicLong(0);
+ private final AtomicLong totalProcessingTime = new AtomicLong(0);
- private Date startTime;
- private Date stopTime;
- private long requestCount;
- private long responseCount;
- private long faultCount;
- private long maxProcessingTime;
- private long minProcessingTime;
- private long avgProcessingTime;
- private long totalProcessingTime;
-
- public Endpoint getEndpoint()
- {
- return endpoint;
- }
-
- public void setEndpoint(Endpoint endpoint)
- {
- this.endpoint = endpoint;
- }
-
public void start()
{
- startTime = new Date();
- stopTime = null;
- requestCount = 0;
- responseCount = 0;
- faultCount = 0;
- maxProcessingTime = 0;
- minProcessingTime = 0;
- avgProcessingTime = 0;
- totalProcessingTime = 0;
+ started = true;
}
public void stop()
{
- stopTime = new Date();
+ started = false;
}
public long processRequestMessage()
{
- requestCount++;
+ if (!started)
+ {
+ return 0;
+ }
+ requestCount.incrementAndGet();
return System.currentTimeMillis();
}
public void processResponseMessage(long beginTime)
{
- responseCount++;
- processAnyMessage(beginTime);
+ if (beginTime > 0) {
+ final long procTime = System.currentTimeMillis() - beginTime;
+ r.lock();
+ try {
+ responseCount.incrementAndGet();
+ totalProcessingTime.addAndGet(procTime);
+ } finally {
+ r.unlock();
+ }
+ minProcessingTime.compareAndSet(0, procTime);
+ updateMax(maxProcessingTime, procTime);
+ updateMin(minProcessingTime, procTime);
+ }
}
public void processFaultMessage(long beginTime)
{
- faultCount++;
- processAnyMessage(beginTime);
+ if (beginTime > 0) {
+ final long procTime = System.currentTimeMillis() - beginTime;
+ r.lock();
+ try {
+ faultCount.incrementAndGet();
+ totalProcessingTime.addAndGet(procTime);
+ } finally {
+ r.unlock();
+ }
+ minProcessingTime.compareAndSet(0, procTime);
+ updateMax(maxProcessingTime, procTime);
+ updateMin(minProcessingTime, procTime);
+ }
}
- private void processAnyMessage(long beginTime)
+ private void updateMin(AtomicLong min, long value)
{
- if (beginTime > 0)
+ long oldValue = min.get();
+ while (value < oldValue)
{
- long procTime = System.currentTimeMillis() - beginTime;
-
- if (minProcessingTime == 0)
- minProcessingTime = procTime;
-
- maxProcessingTime = Math.max(maxProcessingTime, procTime);
- minProcessingTime = Math.min(minProcessingTime, procTime);
- totalProcessingTime = totalProcessingTime + procTime;
- avgProcessingTime = totalProcessingTime / (responseCount + faultCount);
+ if (min.compareAndSet(oldValue, value))
+ break;
+ oldValue = min.get();
}
}
- public Date getStartTime()
+ private void updateMax(AtomicLong max, long value)
{
- return startTime;
+ long oldValue = max.get();
+ while (value > oldValue)
+ {
+ if (max.compareAndSet(oldValue, value))
+ break;
+ oldValue = max.get();
+ }
}
- public Date getStopTime()
- {
- return stopTime;
- }
-
public long getMinProcessingTime()
{
- return minProcessingTime;
+ return minProcessingTime.longValue();
}
public long getMaxProcessingTime()
{
- return maxProcessingTime;
+ return maxProcessingTime.longValue();
}
public long getAverageProcessingTime()
{
- return avgProcessingTime;
+ w.lock();
+ try {
+ return totalProcessingTime.get() / (responseCount.get() + faultCount.get());
+ } finally {
+ w.unlock();
+ }
}
public long getTotalProcessingTime()
{
- return totalProcessingTime;
+ return totalProcessingTime.get();
}
public long getRequestCount()
{
- return requestCount;
+ return requestCount.get();
}
public long getFaultCount()
{
- return faultCount;
+ return faultCount.get();
}
public long getResponseCount()
{
- return responseCount;
+ return responseCount.get();
}
public String toString()
{
- StringBuilder buffer = new StringBuilder("\nEndpoint Metrics: " + endpoint.getName());
- buffer.append("\n startTime=" + startTime);
- buffer.append("\n stopTime=" + stopTime);
- buffer.append("\n requestCount=" + requestCount);
+ StringBuilder buffer = new StringBuilder("requestCount=" + requestCount);
buffer.append("\n responseCount=" + responseCount);
buffer.append("\n faultCount=" + faultCount);
buffer.append("\n maxProcessingTime=" + maxProcessingTime);
buffer.append("\n minProcessingTime=" + minProcessingTime);
- buffer.append("\n avgProcessingTime=" + avgProcessingTime);
+ buffer.append("\n avgProcessingTime=" + getAverageProcessingTime());
buffer.append("\n totalProcessingTime=" + totalProcessingTime);
return buffer.toString();
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java 2013-12-06 15:52:39 UTC (rev 18150)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java 2013-12-06 15:53:33 UTC (rev 18151)
@@ -23,7 +23,6 @@
import static org.jboss.ws.common.Loggers.MANAGEMENT_LOGGER;
-import java.util.Date;
import java.util.List;
import javax.management.JMException;
@@ -45,8 +44,8 @@
*/
public class ManagedEndpoint implements ManagedEndpointMBean
{
- private Endpoint endpoint;
- private MBeanServer mbeanServer;
+ private final Endpoint endpoint;
+ private final MBeanServer mbeanServer;
public ManagedEndpoint(Endpoint endpoint, MBeanServer mbeanServer)
{
@@ -95,18 +94,6 @@
return metrics != null ? metrics.getResponseCount() : 0;
}
- public Date getStartTime()
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- return metrics != null ? metrics.getStartTime() : null;
- }
-
- public Date getStopTime()
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- return metrics != null ? metrics.getStopTime() : null;
- }
-
public long getTotalProcessingTime()
{
EndpointMetrics metrics = endpoint.getEndpointMetrics();
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointMBean.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointMBean.java 2013-12-06 15:52:39 UTC (rev 18150)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointMBean.java 2013-12-06 15:53:33 UTC (rev 18151)
@@ -21,7 +21,6 @@
*/
package org.jboss.ws.common.management;
-import java.util.Date;
import java.util.List;
import org.jboss.ws.api.monitoring.Record;
@@ -39,10 +38,6 @@
String getAddress();
- Date getStartTime();
-
- Date getStopTime();
-
long getMinProcessingTime();
long getMaxProcessingTime();
11 years
JBossWS SVN: r18150 - common/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-06 10:52:39 -0500 (Fri, 06 Dec 2013)
New Revision: 18150
Modified:
common/trunk/pom.xml
Log:
Use latest spi snapshot
Modified: common/trunk/pom.xml
===================================================================
--- common/trunk/pom.xml 2013-12-06 15:52:14 UTC (rev 18149)
+++ common/trunk/pom.xml 2013-12-06 15:52:39 UTC (rev 18150)
@@ -27,7 +27,7 @@
<!-- Properties -->
<properties>
- <jbossws.spi.version>2.2.1.Final</jbossws.spi.version>
+ <jbossws.spi.version>2.3.0-SNAPSHOT</jbossws.spi.version>
<jboss.jaxbintros.version>1.0.2.GA</jboss.jaxbintros.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
<jboss-logging.version>3.1.2.GA</jboss-logging.version>
11 years
JBossWS SVN: r18149 - spi/trunk/src/main/java/org/jboss/wsf/spi/management.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-06 10:52:14 -0500 (Fri, 06 Dec 2013)
New Revision: 18149
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/management/EndpointMetrics.java
Log:
[JBWS-3742] Minor pruning of useless EndpointMetric interface methods
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/management/EndpointMetrics.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/management/EndpointMetrics.java 2013-12-06 10:28:25 UTC (rev 18148)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/management/EndpointMetrics.java 2013-12-06 15:52:14 UTC (rev 18149)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -21,17 +21,9 @@
*/
package org.jboss.wsf.spi.management;
-import java.util.Date;
-import org.jboss.wsf.spi.deployment.Endpoint;
-
public interface EndpointMetrics
{
-
- Endpoint getEndpoint();
-
- void setEndpoint(Endpoint endpoint);
-
void start();
void stop();
@@ -42,10 +34,6 @@
void processFaultMessage(long beginTime);
- Date getStartTime();
-
- Date getStopTime();
-
long getMinProcessingTime();
long getMaxProcessingTime();
11 years
JBossWS SVN: r18148 - spi/trunk/src/main/java/org/jboss/wsf/spi/deployment.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-06 05:28:25 -0500 (Fri, 06 Dec 2013)
New Revision: 18148
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java
Log:
Removing imprecise comment
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java 2013-12-06 00:47:17 UTC (rev 18147)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java 2013-12-06 10:28:25 UTC (rev 18148)
@@ -45,10 +45,6 @@
public static final String STACK_SERVLET_DELEGATE_CLASS = "org.jboss.wsf.spi.deployment.stackServletDelegateClass";
public static final String INTEGRATION_CLASSLOADER = "org.jboss.wsf.spi.deployment.integrationClassLoader";
- //Besides for the obvious visibility consequence on the actual field, the 'volatile' keyword here also
- //establishes a "happens-before" relationship between what happened on the WS model during deployment
- //and the model usage for serving requests. Everything that is only written during deployment, can be
- //safely read after this point without visibility issues related to different threads serving requests.
private volatile ServletDelegate delegate = null;
@Override
11 years
JBossWS SVN: r18147 - common/trunk/src/main/java/org/jboss/ws/common/deployment.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-05 19:47:17 -0500 (Thu, 05 Dec 2013)
New Revision: 18147
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java
Log:
Making few fields final
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java 2013-12-06 00:46:54 UTC (rev 18146)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java 2013-12-06 00:47:17 UTC (rev 18147)
@@ -42,7 +42,7 @@
public class DefaultService extends AbstractExtensible implements Service
{
private Deployment dep;
- private List<Endpoint> endpoints = new LinkedList<Endpoint>();
+ private final List<Endpoint> endpoints = new LinkedList<Endpoint>();
private String contextRoot;
private String virtualHost;
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java 2013-12-06 00:46:54 UTC (rev 18146)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java 2013-12-06 00:47:17 UTC (rev 18147)
@@ -45,9 +45,9 @@
*/
public class ResourceResolverImpl implements ResourceResolver
{
- private UnifiedVirtualFile rootFile;
- private Collection<UnifiedVirtualFile> metadataFiles;
- private ArchiveDeployment deployment;
+ private final UnifiedVirtualFile rootFile;
+ private final Collection<UnifiedVirtualFile> metadataFiles;
+ private final ArchiveDeployment deployment;
public ResourceResolverImpl(final ArchiveDeployment deployment)
{
11 years