Author: jim.ma
Date: 2015-03-25 05:53:57 -0400 (Wed, 25 Mar 2015)
New Revision: 19602
Modified:
common/branches/management/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
common/branches/management/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java
common/branches/management/src/main/java/org/jboss/ws/common/monitoring/OperationFilter.java
Log:
[JBWS-3895]:Refactor work for enable RecordProcessor in runtime
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-25
09:51:59 UTC (rev 19601)
+++
common/branches/management/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2015-03-25
09:53:57 UTC (rev 19602)
@@ -23,7 +23,6 @@
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -33,7 +32,6 @@
import javax.management.ObjectName;
import org.jboss.ws.api.monitoring.Record;
-import org.jboss.ws.api.monitoring.RecordFilter;
import org.jboss.ws.api.monitoring.RecordProcessor;
import org.jboss.ws.common.Messages;
import org.jboss.ws.common.injection.PreDestroyHolder;
@@ -84,6 +82,7 @@
protected Map<String, String> configsMap = new HashMap<String,
String>(64);
static {
RUNTIME_CONFIG_FLAGS.add(RuntimeConfig.STATISTICS_ENABLED);
+ RUNTIME_CONFIG_FLAGS.add(RuntimeConfig.RECORD_ENABLED);
}
AbstractDefaultEndpoint(String targetBean)
@@ -291,20 +290,9 @@
{
for (RecordProcessor processor : recordProcessors)
{
- if (processor.isRecording())
+ if (processor.isRecording() ||
("true".equals(getRuntimeProperty(RuntimeConfig.RECORD_ENABLED)) &&
processor.getName().equals(getRuntimeProperty(RuntimeConfig.PROCESSOR))))
{
- boolean match = true;
- if (processor.getFilters() != null)
- {
- for (Iterator<RecordFilter> it = processor.getFilters().iterator();
it.hasNext() && match;)
- {
- match = it.next().match(record);
- }
- }
- if (match)
- {
- processor.processRecord(record);
- }
+ processor.processRecord(record);
}
}
}
@@ -370,10 +358,11 @@
return endpointConfig;
}
- public Map<String, String> getAllConfigsMap() {
- configsMap.put(Endpoint.ADDRESS, this.getAddress());
- configsMap.putAll(this.getRuntimeProperties());
- return configsMap;
+ public Map<String, String> getAllConfigsMap()
+ {
+ configsMap.put(Endpoint.ADDRESS, this.getAddress());
+ configsMap.putAll(this.getRuntimeProperties());
+ return configsMap;
}
@Override
Modified:
common/branches/management/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java
===================================================================
---
common/branches/management/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java 2015-03-25
09:51:59 UTC (rev 19601)
+++
common/branches/management/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java 2015-03-25
09:53:57 UTC (rev 19602)
@@ -44,6 +44,7 @@
import org.jboss.ws.common.DOMWriter;
import org.jboss.ws.common.monitoring.RecordFactory;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.RuntimeConfig;
import org.jboss.wsf.spi.invocation.EndpointAssociation;
/**
@@ -162,9 +163,12 @@
{
return false;
}
+
for (RecordProcessor processor : processors)
{
- if (processor.isRecording())
+ if (processor.isRecording()
+ ||
("true".equals(endpoint.getRuntimeProperty(RuntimeConfig.RECORD_ENABLED))
&& processor.getName().equals(
+ endpoint.getRuntimeProperty(RuntimeConfig.PROCESSOR))))
{
return true;
}
Modified:
common/branches/management/src/main/java/org/jboss/ws/common/monitoring/OperationFilter.java
===================================================================
---
common/branches/management/src/main/java/org/jboss/ws/common/monitoring/OperationFilter.java 2015-03-25
09:51:59 UTC (rev 19601)
+++
common/branches/management/src/main/java/org/jboss/ws/common/monitoring/OperationFilter.java 2015-03-25
09:53:57 UTC (rev 19602)
@@ -37,7 +37,13 @@
private static final long serialVersionUID = -726794729964445956L;
private QName operation;
+
+ private String opeationName;
+ public OperationFilter(String operation) {
+ opeationName = operation;
+ }
+
public OperationFilter(QName operation)
{
this.operation = operation;
@@ -51,7 +57,7 @@
{
return true;
}
- else if (operation != null && operation.equals(record.getOperation()))
+ else if ((operation != null && operation.equals(record.getOperation()))
|| (opeationName != null &&
opeationName.equalsIgnoreCase(record.getOperation().getLocalPart())))
{
return true;
}
Show replies by date