Author: alessio.soldano(a)jboss.com
Date: 2007-12-20 13:38:09 -0500 (Thu, 20 Dec 2007)
New Revision: 5380
Added:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java
Removed:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java
Log:
Merging asoldano branch to trunk, svn merge -r 5187:HEAD
Records management:
- [JBWS-1897]
- [JBWS-1898]
- [JBWS-1899]
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2007-12-20
18:37:26 UTC (rev 5379)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -22,7 +22,9 @@
package org.jboss.wsf.framework.deployment;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
+import java.util.Vector;
import javax.management.ObjectName;
@@ -35,6 +37,9 @@
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.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
/**
* A general JAXWS endpoint.
@@ -56,7 +61,8 @@
private EndpointMetrics metrics;
private List<BindingCustomization> bindingCustomizsations = new
ArrayList<BindingCustomization>();
private String address;
-
+ private List<RecordProcessor> recordProcessors = new
Vector<RecordProcessor>();
+
DefaultEndpoint(String targetBean)
{
this.targetBean = targetBean;
@@ -244,4 +250,36 @@
if (state == EndpointState.STARTED)
throw new IllegalStateException("Cannot modify endpoint properties in
state: " + state);
}
+
+ public List<RecordProcessor> getRecordProcessors()
+ {
+ return recordProcessors;
+ }
+
+ public void setRecordProcessors(List<RecordProcessor> recordProcessors)
+ {
+ this.recordProcessors = new Vector<RecordProcessor>(recordProcessors);
+ }
+
+ public void processRecord(Record record)
+ {
+ for (RecordProcessor processor : recordProcessors)
+ {
+ if (processor.isRecording())
+ {
+ 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);
+ }
+ }
+ }
+ }
}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java 2007-12-20
18:37:26 UTC (rev 5379)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -70,6 +70,7 @@
InvocationHandler invocationHandler = getInvocationHandler(ep);
if (invocationHandler != null)
ep.setInvocationHandler(invocationHandler);
+
}
}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.deployment;
+
+//$Id$
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.framework.management.recording.LogRecorder;
+import org.jboss.wsf.framework.management.recording.ManagedRecordProcessor;
+import org.jboss.wsf.framework.management.recording.MemoryBufferRecorder;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+
+/**
+ * A deployer that sets the record processors for each endpoint
+ *
+ * @author alessio.soldano(a)jboss.org
+ * @since 12-Dec-2007
+ */
+public class EndpointRecordProcessorDeploymentAspect extends DeploymentAspect
+{
+ private MBeanServer mbeanServer;
+
+ @Override
+ public void create(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ /** Memory buffer recorder **/
+ MemoryBufferRecorder memoryRecorder = new MemoryBufferRecorder();
+ memoryRecorder.setName("MemoryBufferRecorder");
+ this.registerRecordProcessor(memoryRecorder, ep);
+ /** Log recorder **/
+ LogRecorder logRecorder = new LogRecorder();
+ logRecorder.setName("LogRecorder");
+ this.registerRecordProcessor(logRecorder, ep);
+
+ List<RecordProcessor> recordProcessorList = new
LinkedList<RecordProcessor>();
+ recordProcessorList.add(memoryRecorder);
+ recordProcessorList.add(logRecorder);
+ ep.setRecordProcessors(recordProcessorList);
+ }
+ }
+
+ @Override
+ public void destroy(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ List<RecordProcessor> processors = ep.getRecordProcessors();
+ for (RecordProcessor processor : processors)
+ {
+ this.unregisterRecordProcessor(processor, ep);
+ }
+ }
+ }
+
+ private void registerRecordProcessor(RecordProcessor processor, Endpoint ep)
+ {
+ try
+ {
+ mbeanServer.registerMBean(processor, ObjectNameFactory.create(ep.getName() +
",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException ex)
+ {
+ log.debug("Cannot register endpoint with JMX server, trying with the
default ManagedRecordProcessor: " + ex.getMessage());
+ try
+ {
+ mbeanServer.registerMBean(new ManagedRecordProcessor(processor),
ObjectNameFactory.create(ep.getName() + ",recordProcessor=" +
processor.getName()));
+ }
+ catch (JMException innerEx)
+ {
+ log.error("Cannot register endpoint with JMX server", innerEx);
+ }
+ }
+ }
+
+ private void unregisterRecordProcessor(RecordProcessor processor, Endpoint ep)
+ {
+ try
+ {
+ mbeanServer.unregisterMBean(ObjectNameFactory.create(ep.getName() +
",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException ex)
+ {
+ log.error("Cannot unregister record processor with JMX server", ex);
+ }
+ }
+
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+}
\ No newline at end of file
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,181 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.framework.invocation;
+
+
+import java.net.URL;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.framework.management.recording.RecordFactory;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.EndpointAssociation;
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordGroupAssociation;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+import org.jboss.wsf.spi.management.recording.Record.MessageType;
+import org.jboss.wsf.test.GenericSOAPHandler;
+
+/**
+ * This handler is responsible for collecting the information about the
+ * messages being exchanged and recording them on the server side. This
+ * is performed delegating to the RecordProcessors installed into the
+ * current endpoint.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public class RecordingServerHandler extends GenericSOAPHandler
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(RecordingServerHandler.class);
+
+ @SuppressWarnings("unchecked")
+ protected boolean handleInbound(MessageContext ctx)
+ {
+ Endpoint endpoint = EndpointAssociation.getEndpoint();
+ if (this.isRecording(endpoint))
+ {
+ Record record = RecordFactory.newRecord();
+ RecordGroupAssociation.pushGroupID(record.getGroupID());
+ record.setDate(new Date());
+ HttpServletRequest httpServletRequest =
(HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
+ if (httpServletRequest != null)
+ {
+ try
+ {
+ record.setDestinationHost(new
URL(httpServletRequest.getRequestURL().toString()).getHost());
+ record.setSourceHost(httpServletRequest.getRemoteHost());
+ }
+ catch (Exception e)
+ {
+ log.warn("Unable to read from the http servlet request! " +
e.getMessage());
+ }
+ }
+
record.setHeaders((Map<String,List<String>>)(ctx.get(MessageContext.HTTP_REQUEST_HEADERS)));
+ record.setMessageType(MessageType.INBOUND);
+ record.setOperation((QName)ctx.get(MessageContext.WSDL_OPERATION));
+ boolean processEnvelope = false;
+ for (Iterator<RecordProcessor> it =
endpoint.getRecordProcessors().iterator(); it.hasNext() && !processEnvelope; )
+ {
+ processEnvelope = it.next().isProcessEnvelope();
+ }
+ if (processEnvelope) //skip message processing if not required since it's
very time-consuming
+ {
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+ try
+ {
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null)
+ {
+ record.setEnvelope(DOMWriter.printNode(soapEnv, true));
+ }
+ }
+ catch (SOAPException ex)
+ {
+ log.error("Cannot trace SOAPMessage", ex);
+ }
+ }
+ endpoint.processRecord(record);
+ }
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ protected boolean handleOutbound(MessageContext ctx)
+ {
+ Endpoint endpoint = EndpointAssociation.getEndpoint();
+ if (this.isRecording(endpoint))
+ {
+ String groupID = RecordGroupAssociation.popGroupID();
+ Record record = RecordFactory.newRecord(groupID);
+ record.setDate(new Date());
+
record.setHeaders((Map<String,List<String>>)(ctx.get(MessageContext.HTTP_RESPONSE_HEADERS)));
+ record.setMessageType(MessageType.OUTBOUND);
+ record.setOperation((QName)ctx.get(MessageContext.WSDL_OPERATION));
+ boolean processEnvelope = false;
+ for (Iterator<RecordProcessor> it =
endpoint.getRecordProcessors().iterator(); it.hasNext() && !processEnvelope; )
+ {
+ processEnvelope = it.next().isProcessEnvelope();
+ }
+ if (processEnvelope) //skip message processing if not required since it's
very time-consuming
+ {
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+ try
+ {
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null)
+ {
+ record.setEnvelope(DOMWriter.printNode(soapEnv, true));
+ }
+ }
+ catch (SOAPException ex)
+ {
+ log.error("Cannot trace SOAPMessage", ex);
+ }
+ }
+ endpoint.processRecord(record);
+ }
+ return true;
+ }
+
+ public boolean handleFault(MessageContext ctx)
+ {
+ return handleOutbound(ctx);
+ }
+
+ /**
+ * Returns true if there's at least a record processor in recording mode
+ *
+ * @param endpoint
+ * @return
+ */
+ private boolean isRecording(Endpoint endpoint)
+ {
+ List<RecordProcessor> processors = endpoint.getRecordProcessors();
+ if (processors == null || processors.isEmpty())
+ {
+ return false;
+ }
+ for (RecordProcessor processor : processors)
+ {
+ if (processor.isRecording())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java 2007-12-20
18:37:26 UTC (rev 5379)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -24,9 +24,18 @@
// $Id: ManagedEndpointRegistry.java 3146 2007-05-18 22:55:26Z thomas.diesler(a)jboss.com
$
import java.util.Date;
+import java.util.List;
+import javax.management.JMException;
+import javax.management.MBeanServer;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.framework.management.recording.ManagedRecordProcessor;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.management.EndpointMetrics;
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
/**
* The endpoint MBean representation
@@ -37,10 +46,13 @@
public class ManagedEndpoint implements ManagedEndpointMBean
{
private Endpoint endpoint;
+ private MBeanServer mbeanServer;
+ private Logger log = Logger.getLogger(this.getClass());
- public ManagedEndpoint(Endpoint endpoint)
+ public ManagedEndpoint(Endpoint endpoint, MBeanServer mbeanServer)
{
this.endpoint = endpoint;
+ this.mbeanServer = mbeanServer;
}
public long getAverageProcessingTime()
@@ -106,4 +118,72 @@
{
endpoint.getLifecycleHandler().stop(endpoint);
}
+
+ public void processRecord(Record record)
+ {
+ endpoint.processRecord(record);
+ }
+
+ public void addRecordProcessor(RecordProcessor processor)
+ {
+ this.getRecordProcessors().add(processor);
+ try
+ {
+ mbeanServer.registerMBean(processor, ObjectNameFactory.create(endpoint.getName()
+ ",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException ex)
+ {
+ log.debug("Cannot register endpoint with JMX server, trying with the
default ManagedRecordProcessor: " + ex.getMessage());
+ try
+ {
+ mbeanServer.registerMBean(new ManagedRecordProcessor(processor),
ObjectNameFactory.create(endpoint.getName() + ",recordProcessor=" +
processor.getName()));
+ }
+ catch (JMException innerEx)
+ {
+ log.error("Cannot register endpoint with JMX server", innerEx);
+ }
+ }
+ }
+
+ public List<RecordProcessor> getRecordProcessors()
+ {
+ return endpoint.getRecordProcessors();
+ }
+
+ public void setRecordProcessors(List<RecordProcessor> processors)
+ {
+ //unregister current processors
+ for (RecordProcessor processor : processors)
+ {
+ try
+ {
+ mbeanServer.unregisterMBean(ObjectNameFactory.create(endpoint.getName() +
",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException ex)
+ {
+ log.error("Cannot unregister record processor with JMX server",
ex);
+ }
+ }
+ //set and register the new processors
+ endpoint.setRecordProcessors(processors);
+ for (RecordProcessor processor : processors)
+ {
+ try
+ {
+ mbeanServer.registerMBean(processor,
ObjectNameFactory.create(endpoint.getName() + ",recordProcessor=" +
processor.getName()));
+ }
+ catch (JMException ex)
+ {
+ log.debug("Cannot register endpoint with JMX server, trying with the
default ManagedRecordProcessor: " + ex.getMessage());
+ try
+ {
+ mbeanServer.registerMBean(new ManagedRecordProcessor(processor),
ObjectNameFactory.create(endpoint.getName() + ",recordProcessor=" +
processor.getName()));
+ }
+ catch (JMException innerEx)
+ {
+ log.error("Cannot register endpoint with JMX server", innerEx);
+ }
+ }
+ }
+ }
}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java 2007-12-20
18:37:26 UTC (rev 5379)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -22,7 +22,11 @@
package org.jboss.wsf.framework.management;
import java.util.Date;
+import java.util.List;
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+
/**
* MBean interface.
* @since 15-April-2004
@@ -50,4 +54,13 @@
long getFaultCount();
long getResponseCount();
+
+ void processRecord(Record record);
+
+ void addRecordProcessor(RecordProcessor processor);
+
+ List<RecordProcessor> getRecordProcessors();
+
+ void setRecordProcessors(List<RecordProcessor> processors);
+
}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java 2007-12-20
18:37:26 UTC (rev 5379)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -60,7 +60,7 @@
try
{
- ManagedEndpoint jmxEndpoint = new ManagedEndpoint(endpoint);
+ ManagedEndpoint jmxEndpoint = new ManagedEndpoint(endpoint, mbeanServer);
getMbeanServer().registerMBean(jmxEndpoint, endpoint.getName());
}
catch (JMException ex)
Copied: framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording (from
rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording)
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,184 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import java.util.List;
-import java.util.Vector;
-
-import org.jboss.wsf.spi.management.recording.Record;
-import org.jboss.wsf.spi.management.recording.RecordFilter;
-import org.jboss.wsf.spi.management.recording.RecordProcessor;
-
-/**
- * An abstract record processor providing basic implementation
- * of the processor configuration and filter's management
- *
- * @author alessio.soldano(a)jboss.com
- * @since 8-Dec-2007
- */
-public abstract class AbstractRecordProcessor implements RecordProcessor
-{
-
- protected List<RecordFilter> filters = new Vector<RecordFilter>();
- protected boolean processDestinationHost = true;
- protected boolean processSourceHost = true;
- protected boolean processHeaders = true;
- protected boolean processEnvelope = true;
- protected boolean processMessageType = true;
- protected boolean processOperation = true;
- protected boolean processDate = true;
- protected String name;
- protected boolean recording = false;
-
- public abstract void processRecord(Record record);
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void addFilter(RecordFilter filter)
- {
- filters.add(filter);
- }
-
- public List<RecordFilter> getFilters()
- {
- return filters;
- }
-
- public void setFilters(List<RecordFilter> filters)
- {
- this.filters = new Vector<RecordFilter>(filters);
- }
-
- public boolean isProcessDestinationHost()
- {
- return processDestinationHost;
- }
-
- public void setProcessDestinationHost(boolean processDestinationHost)
- {
- this.processDestinationHost = processDestinationHost;
- }
-
- public boolean isProcessSourceHost()
- {
- return processSourceHost;
- }
-
- public void setProcessSourceHost(boolean processSourceHost)
- {
- this.processSourceHost = processSourceHost;
- }
-
- public boolean isProcessHeaders()
- {
- return processHeaders;
- }
-
- public void setProcessHeaders(boolean processHeaders)
- {
- this.processHeaders = processHeaders;
- }
-
- public boolean isProcessEnvelope()
- {
- return processEnvelope;
- }
-
- public void setProcessEnvelope(boolean processEnvelope)
- {
- this.processEnvelope = processEnvelope;
- }
-
- public boolean isProcessMessageType()
- {
- return processMessageType;
- }
-
- public void setProcessMessageType(boolean processMessageType)
- {
- this.processMessageType = processMessageType;
- }
-
- public boolean isProcessOperation()
- {
- return processOperation;
- }
-
- public void setProcessOperation(boolean processOperation)
- {
- this.processOperation = processOperation;
- }
-
- public boolean isProcessDate()
- {
- return processDate;
- }
-
- public void setProcessDate(boolean processDate)
- {
- this.processDate = processDate;
- }
-
- public boolean isRecording()
- {
- return recording;
- }
-
- public void setRecording(boolean recording)
- {
- this.recording = recording;
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
- sb.append(super.toString());
- sb.append(" (recording = ");
- sb.append(recording);
- sb.append(", processDestinationHost = ");
- sb.append(processDestinationHost);
- sb.append(", processSourceHost = ");
- sb.append(processSourceHost);
- sb.append(", processHeaders = ");
- sb.append(processHeaders);
- sb.append(", processEnvelope = ");
- sb.append(processEnvelope);
- sb.append(", processMessageType = ");
- sb.append(processMessageType);
- sb.append(", processOperation = ");
- sb.append(processOperation);
- sb.append(", processDate = ");
- sb.append(processDate);
- sb.append(")");
- return sb.toString();
- }
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,184 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import java.util.List;
+import java.util.Vector;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+
+/**
+ * An abstract record processor providing basic implementation
+ * of the processor configuration and filter's management
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public abstract class AbstractRecordProcessor implements RecordProcessor
+{
+
+ protected List<RecordFilter> filters = new Vector<RecordFilter>();
+ protected boolean processDestinationHost = true;
+ protected boolean processSourceHost = true;
+ protected boolean processHeaders = true;
+ protected boolean processEnvelope = true;
+ protected boolean processMessageType = true;
+ protected boolean processOperation = true;
+ protected boolean processDate = true;
+ protected String name;
+ protected boolean recording = false;
+
+ public abstract void processRecord(Record record);
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void addFilter(RecordFilter filter)
+ {
+ filters.add(filter);
+ }
+
+ public List<RecordFilter> getFilters()
+ {
+ return filters;
+ }
+
+ public void setFilters(List<RecordFilter> filters)
+ {
+ this.filters = new Vector<RecordFilter>(filters);
+ }
+
+ public boolean isProcessDestinationHost()
+ {
+ return processDestinationHost;
+ }
+
+ public void setProcessDestinationHost(boolean processDestinationHost)
+ {
+ this.processDestinationHost = processDestinationHost;
+ }
+
+ public boolean isProcessSourceHost()
+ {
+ return processSourceHost;
+ }
+
+ public void setProcessSourceHost(boolean processSourceHost)
+ {
+ this.processSourceHost = processSourceHost;
+ }
+
+ public boolean isProcessHeaders()
+ {
+ return processHeaders;
+ }
+
+ public void setProcessHeaders(boolean processHeaders)
+ {
+ this.processHeaders = processHeaders;
+ }
+
+ public boolean isProcessEnvelope()
+ {
+ return processEnvelope;
+ }
+
+ public void setProcessEnvelope(boolean processEnvelope)
+ {
+ this.processEnvelope = processEnvelope;
+ }
+
+ public boolean isProcessMessageType()
+ {
+ return processMessageType;
+ }
+
+ public void setProcessMessageType(boolean processMessageType)
+ {
+ this.processMessageType = processMessageType;
+ }
+
+ public boolean isProcessOperation()
+ {
+ return processOperation;
+ }
+
+ public void setProcessOperation(boolean processOperation)
+ {
+ this.processOperation = processOperation;
+ }
+
+ public boolean isProcessDate()
+ {
+ return processDate;
+ }
+
+ public void setProcessDate(boolean processDate)
+ {
+ this.processDate = processDate;
+ }
+
+ public boolean isRecording()
+ {
+ return recording;
+ }
+
+ public void setRecording(boolean recording)
+ {
+ this.recording = recording;
+ }
+
+ public String toString()
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append(super.toString());
+ sb.append(" (recording = ");
+ sb.append(recording);
+ sb.append(", processDestinationHost = ");
+ sb.append(processDestinationHost);
+ sb.append(", processSourceHost = ");
+ sb.append(processSourceHost);
+ sb.append(", processHeaders = ");
+ sb.append(processHeaders);
+ sb.append(", processEnvelope = ");
+ sb.append(processEnvelope);
+ sb.append(", processMessageType = ");
+ sb.append(processMessageType);
+ sb.append(", processOperation = ");
+ sb.append(processOperation);
+ sb.append(", processDate = ");
+ sb.append(processDate);
+ sb.append(")");
+ return sb.toString();
+ }
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import org.jboss.wsf.spi.management.recording.Record;
-import org.jboss.wsf.spi.management.recording.RecordFilter;
-
-/**
- * A simple record filter acting like the AND operator
- *
- * @author alessio.soldano(a)jboss.com
- * @since 18-Dec-2007
- *
- */
-public class AndFilter implements RecordFilter
-{
-
- private RecordFilter filter1;
- private RecordFilter filter2;
-
- public AndFilter(RecordFilter filter1, RecordFilter filter2)
- {
- this.filter1 = filter1;
- this.filter2 = filter2;
- }
-
- public boolean match(Record record)
- {
- return filter1.match(record) && filter2.match(record);
- }
-
- public RecordFilter getFilter1()
- {
- return filter1;
- }
-
- public RecordFilter getFilter2()
- {
- return filter2;
- }
-
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * A simple record filter acting like the AND operator
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Dec-2007
+ *
+ */
+public class AndFilter implements RecordFilter
+{
+
+ private RecordFilter filter1;
+ private RecordFilter filter2;
+
+ public AndFilter(RecordFilter filter1, RecordFilter filter2)
+ {
+ this.filter1 = filter1;
+ this.filter2 = filter2;
+ }
+
+ public boolean match(Record record)
+ {
+ return filter1.match(record) && filter2.match(record);
+ }
+
+ public RecordFilter getFilter1()
+ {
+ return filter1;
+ }
+
+ public RecordFilter getFilter2()
+ {
+ return filter2;
+ }
+
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.jboss.wsf.spi.management.recording.Record;
-import org.jboss.wsf.spi.management.recording.RecordFilter;
-
-/**
- * This filter matches records having the source/destination host equal to
- * any of the provided hosts.
- *
- * @author alessio.soldano(a)jboss.com
- * @since 11-Dec-2007
- */
-public class HostFilter implements RecordFilter
-{
- private List<String> hosts = new LinkedList<String>();
- private boolean source;
-
- public HostFilter(String host, boolean source)
- {
- this.hosts.add(host);
- this.source = source;
- }
-
- public HostFilter(Collection<String> hosts, boolean source)
- {
- this.hosts.addAll(hosts);
- this.source = source;
- }
-
- public boolean match(Record record)
- {
- for (String host : hosts)
- {
- if ((source && host.equalsIgnoreCase(record.getSourceHost())) ||
(!source && host.equalsIgnoreCase(record.getDestinationHost())))
- {
- return true;
- }
- }
- return false;
- }
-
- public List<String> getHosts()
- {
- return hosts;
- }
-
- public boolean isSource()
- {
- return source;
- }
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * This filter matches records having the source/destination host equal to
+ * any of the provided hosts.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 11-Dec-2007
+ */
+public class HostFilter implements RecordFilter
+{
+ private List<String> hosts = new LinkedList<String>();
+ private boolean source;
+
+ public HostFilter(String host, boolean source)
+ {
+ this.hosts.add(host);
+ this.source = source;
+ }
+
+ public HostFilter(Collection<String> hosts, boolean source)
+ {
+ this.hosts.addAll(hosts);
+ this.source = source;
+ }
+
+ public boolean match(Record record)
+ {
+ for (String host : hosts)
+ {
+ if ((source && host.equalsIgnoreCase(record.getSourceHost())) ||
(!source && host.equalsIgnoreCase(record.getDestinationHost())))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public List<String> getHosts()
+ {
+ return hosts;
+ }
+
+ public boolean isSource()
+ {
+ return source;
+ }
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,123 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.management.recording.Record;
-import org.jboss.wsf.spi.management.recording.Record.MessageType;
-
-/**
- * A simple record processor that writes records to the configured log.
- *
- * @author alessio.soldano(a)jboss.com
- * @since 8-Dec-2007
- */
-public class LogRecorder extends AbstractRecordProcessor
-{
- private Logger log = Logger.getLogger(this.getClass());
-
- @Override
- public void processRecord(Record record)
- {
- StringBuffer sb = new StringBuffer();
- if (this.isProcessMessageType())
- {
- if (record.getMessageType() == MessageType.INBOUND)
- {
- sb.append("INBOUND MESSAGE ");
- if (this.isProcessSourceHost() && record.getSourceHost() != null)
- {
- sb.append("from ");
- sb.append(record.getSourceHost());
- }
- }
- else if (record.getMessageType() == MessageType.OUTBOUND)
- {
- sb.append("OUTBOUND MESSAGE ");
- if (this.isProcessDestinationHost() && record.getDestinationHost() !=
null)
- {
- sb.append("to ");
- sb.append(record.getDestinationHost());
- }
- }
- else
- {
- log.warn("Unknown message type: " + record.getMessageType());
- if (this.isProcessSourceHost() && record.getSourceHost() != null)
- {
- sb.append("from ");
- sb.append(record.getSourceHost());
- }
- if (this.isProcessDestinationHost() && record.getDestinationHost() !=
null)
- {
- sb.append("to ");
- sb.append(record.getDestinationHost());
- }
- }
- }
- else
- {
- sb.append("MESSAGE");
- }
- sb.append(":");
- if (this.isProcessDate())
- {
- sb.append("\nDate: ");
- sb.append(record.getDate());
- }
- sb.append("\nGroupID: ");
- sb.append(record.getGroupID());
- if (this.isProcessOperation())
- {
- sb.append("\nOperation: ");
- sb.append(record.getOperation());
- }
- sb.append("\n");
- Map<String, List<String>> headers = record.getHeaders();
- if (this.isProcessHeaders() && headers != null)
- {
- for (String key : headers.keySet())
- {
- sb.append(key);
- sb.append(": ");
- for (String h : headers.get(key))
- {
- sb.append(h);
- sb.append("; ");
- }
- sb.append("\n");
- }
- sb.append("\n");
- }
- sb.append("\n");
- if (this.isProcessEnvelope())
- {
- sb.append(record.getEnvelope());
- }
- log.debug(sb.toString());
- }
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.Record.MessageType;
+
+/**
+ * A simple record processor that writes records to the configured log.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public class LogRecorder extends AbstractRecordProcessor
+{
+ private Logger log = Logger.getLogger(this.getClass());
+
+ @Override
+ public void processRecord(Record record)
+ {
+ StringBuffer sb = new StringBuffer();
+ if (this.isProcessMessageType())
+ {
+ if (record.getMessageType() == MessageType.INBOUND)
+ {
+ sb.append("INBOUND MESSAGE ");
+ if (this.isProcessSourceHost() && record.getSourceHost() != null)
+ {
+ sb.append("from ");
+ sb.append(record.getSourceHost());
+ }
+ }
+ else if (record.getMessageType() == MessageType.OUTBOUND)
+ {
+ sb.append("OUTBOUND MESSAGE ");
+ if (this.isProcessDestinationHost() && record.getDestinationHost() !=
null)
+ {
+ sb.append("to ");
+ sb.append(record.getDestinationHost());
+ }
+ }
+ else
+ {
+ log.warn("Unknown message type: " + record.getMessageType());
+ if (this.isProcessSourceHost() && record.getSourceHost() != null)
+ {
+ sb.append("from ");
+ sb.append(record.getSourceHost());
+ }
+ if (this.isProcessDestinationHost() && record.getDestinationHost() !=
null)
+ {
+ sb.append("to ");
+ sb.append(record.getDestinationHost());
+ }
+ }
+ }
+ else
+ {
+ sb.append("MESSAGE");
+ }
+ sb.append(":");
+ if (this.isProcessDate())
+ {
+ sb.append("\nDate: ");
+ sb.append(record.getDate());
+ }
+ sb.append("\nGroupID: ");
+ sb.append(record.getGroupID());
+ if (this.isProcessOperation())
+ {
+ sb.append("\nOperation: ");
+ sb.append(record.getOperation());
+ }
+ sb.append("\n");
+ Map<String, List<String>> headers = record.getHeaders();
+ if (this.isProcessHeaders() && headers != null)
+ {
+ for (String key : headers.keySet())
+ {
+ sb.append(key);
+ sb.append(": ");
+ for (String h : headers.get(key))
+ {
+ sb.append(h);
+ sb.append("; ");
+ }
+ sb.append("\n");
+ }
+ sb.append("\n");
+ }
+ sb.append("\n");
+ if (this.isProcessEnvelope())
+ {
+ sb.append(record.getEnvelope());
+ }
+ log.debug(sb.toString());
+ }
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,146 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import java.util.List;
-
-import org.jboss.wsf.spi.management.recording.Record;
-import org.jboss.wsf.spi.management.recording.RecordFilter;
-import org.jboss.wsf.spi.management.recording.RecordProcessor;
-
-/**
- * The record processor MBean representation
- *
- * @author alessio.soldano(a)jboss.org
- * @since 12-Dec-2007
- */
-public class ManagedRecordProcessor implements ManagedRecordProcessorMBean
-{
- private RecordProcessor processor;
-
- public ManagedRecordProcessor(RecordProcessor processor)
- {
- this.processor = processor;
- }
-
- public void addFilter(RecordFilter filter)
- {
- processor.addFilter(filter);
- }
-
- public List<RecordFilter> getFilters()
- {
- return processor.getFilters();
- }
-
- public boolean isProcessDate()
- {
- return processor.isProcessDate();
- }
-
- public boolean isProcessDestinationHost()
- {
- return processor.isProcessDestinationHost();
- }
-
- public boolean isProcessHeaders()
- {
- return processor.isProcessHeaders();
- }
-
- public boolean isProcessEnvelope()
- {
- return processor.isProcessEnvelope();
- }
-
- public boolean isProcessMessageType()
- {
- return processor.isProcessMessageType();
- }
-
- public boolean isProcessOperation()
- {
- return processor.isProcessOperation();
- }
-
- public boolean isProcessSourceHost()
- {
- return processor.isProcessSourceHost();
- }
-
- public void processRecord(Record record)
- {
- processor.processRecord(record);
- }
-
- public void setFilters(List<RecordFilter> filters)
- {
- processor.setFilters(filters);
- }
-
- public void setProcessDate(boolean value)
- {
- processor.setProcessDate(value);
- }
-
- public void setProcessDestinationHost(boolean value)
- {
- processor.setProcessDestinationHost(value);
- }
-
- public void setProcessHeaders(boolean value)
- {
- processor.setProcessHeaders(value);
- }
-
- public void setProcessEnvelope(boolean value)
- {
- processor.setProcessEnvelope(value);
- }
-
- public void setProcessMessageType(boolean value)
- {
- processor.setProcessMessageType(value);
- }
-
- public void setProcessOperation(boolean value)
- {
- processor.setProcessOperation(value);
- }
-
- public void setProcessSourceHost(boolean value)
- {
- processor.setProcessSourceHost(value);
- }
-
- public boolean isRecording()
- {
- return processor.isRecording();
- }
-
- public void setRecording(boolean value)
- {
- processor.setRecording(value);
- }
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,146 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import java.util.List;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+
+/**
+ * The record processor MBean representation
+ *
+ * @author alessio.soldano(a)jboss.org
+ * @since 12-Dec-2007
+ */
+public class ManagedRecordProcessor implements ManagedRecordProcessorMBean
+{
+ private RecordProcessor processor;
+
+ public ManagedRecordProcessor(RecordProcessor processor)
+ {
+ this.processor = processor;
+ }
+
+ public void addFilter(RecordFilter filter)
+ {
+ processor.addFilter(filter);
+ }
+
+ public List<RecordFilter> getFilters()
+ {
+ return processor.getFilters();
+ }
+
+ public boolean isProcessDate()
+ {
+ return processor.isProcessDate();
+ }
+
+ public boolean isProcessDestinationHost()
+ {
+ return processor.isProcessDestinationHost();
+ }
+
+ public boolean isProcessHeaders()
+ {
+ return processor.isProcessHeaders();
+ }
+
+ public boolean isProcessEnvelope()
+ {
+ return processor.isProcessEnvelope();
+ }
+
+ public boolean isProcessMessageType()
+ {
+ return processor.isProcessMessageType();
+ }
+
+ public boolean isProcessOperation()
+ {
+ return processor.isProcessOperation();
+ }
+
+ public boolean isProcessSourceHost()
+ {
+ return processor.isProcessSourceHost();
+ }
+
+ public void processRecord(Record record)
+ {
+ processor.processRecord(record);
+ }
+
+ public void setFilters(List<RecordFilter> filters)
+ {
+ processor.setFilters(filters);
+ }
+
+ public void setProcessDate(boolean value)
+ {
+ processor.setProcessDate(value);
+ }
+
+ public void setProcessDestinationHost(boolean value)
+ {
+ processor.setProcessDestinationHost(value);
+ }
+
+ public void setProcessHeaders(boolean value)
+ {
+ processor.setProcessHeaders(value);
+ }
+
+ public void setProcessEnvelope(boolean value)
+ {
+ processor.setProcessEnvelope(value);
+ }
+
+ public void setProcessMessageType(boolean value)
+ {
+ processor.setProcessMessageType(value);
+ }
+
+ public void setProcessOperation(boolean value)
+ {
+ processor.setProcessOperation(value);
+ }
+
+ public void setProcessSourceHost(boolean value)
+ {
+ processor.setProcessSourceHost(value);
+ }
+
+ public boolean isRecording()
+ {
+ return processor.isRecording();
+ }
+
+ public void setRecording(boolean value)
+ {
+ processor.setRecording(value);
+ }
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import java.util.List;
-
-import org.jboss.wsf.spi.management.recording.Record;
-import org.jboss.wsf.spi.management.recording.RecordFilter;
-
-/**
- * The record processor MBean interface
- *
- * @author alessio.soldano(a)jboss.com
- * @since 12-Dec-2007
- */
-public interface ManagedRecordProcessorMBean
-{
- public void processRecord(Record record);
-
- public void setRecording(boolean value);
-
- public boolean isRecording();
-
- public List<RecordFilter> getFilters();
-
- public void addFilter(RecordFilter filter);
-
- public void setFilters(List<RecordFilter> filters);
-
- public boolean isProcessSourceHost();
-
- public void setProcessSourceHost(boolean value);
-
- public boolean isProcessDestinationHost();
-
- public void setProcessDestinationHost(boolean value);
-
- public boolean isProcessMessageType();
-
- public void setProcessMessageType(boolean value);
-
- public boolean isProcessEnvelope();
-
- public void setProcessEnvelope(boolean value);
-
- public boolean isProcessHeaders();
-
- public void setProcessHeaders(boolean value);
-
- public boolean isProcessOperation();
-
- public void setProcessOperation(boolean value);
-
- public boolean isProcessDate();
-
- public void setProcessDate(boolean value);
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import java.util.List;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * The record processor MBean interface
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Dec-2007
+ */
+public interface ManagedRecordProcessorMBean
+{
+ public void processRecord(Record record);
+
+ public void setRecording(boolean value);
+
+ public boolean isRecording();
+
+ public List<RecordFilter> getFilters();
+
+ public void addFilter(RecordFilter filter);
+
+ public void setFilters(List<RecordFilter> filters);
+
+ public boolean isProcessSourceHost();
+
+ public void setProcessSourceHost(boolean value);
+
+ public boolean isProcessDestinationHost();
+
+ public void setProcessDestinationHost(boolean value);
+
+ public boolean isProcessMessageType();
+
+ public void setProcessMessageType(boolean value);
+
+ public boolean isProcessEnvelope();
+
+ public void setProcessEnvelope(boolean value);
+
+ public boolean isProcessHeaders();
+
+ public void setProcessHeaders(boolean value);
+
+ public boolean isProcessOperation();
+
+ public void setProcessOperation(boolean value);
+
+ public boolean isProcessDate();
+
+ public void setProcessDate(boolean value);
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,173 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.wsf.spi.management.recording.Record;
-import org.jboss.wsf.spi.management.recording.RecordFilter;
-import org.jboss.wsf.spi.management.recording.Record.MessageType;
-
-/**
- * Keeps the last received records in memory and allows user to
- * search / get statistics on them.
- *
- * @author alessio.soldano(a)jboss.com
- * @since 12-Dec-2007
- */
-public class MemoryBufferRecorder extends AbstractRecordProcessor implements
MemoryBufferRecorderMBean
-{
-
- private Map<String, List<Record>> recentRecords =
Collections.synchronizedMap(new HashMap<String, List<Record>>());
- private ConcurrentLinkedQueue<String> recentRecordGroups = new
ConcurrentLinkedQueue<String>();
- private int size = 0;
-
- private int maxSize = 50;
-
- @Override
- public void processRecord(Record record)
- {
- synchronized (recentRecords)
- {
- List<Record> list = recentRecords.get(record.getGroupID());
- if (list == null)
- {
- list = new LinkedList<Record>();
- recentRecords.put(record.getGroupID(), list);
- while (size > maxSize)
- {
- this.deleteOldestRecord();
- }
- recentRecordGroups.offer(record.getGroupID());
- size++;
- }
- list.add(record);
- }
- }
-
-
- private void deleteOldestRecord()
- {
- String id = recentRecordGroups.poll();
- if (id != null)
- {
- recentRecords.remove(id);
- size--;
- }
- }
-
- private Map<String, List<Record>> getRecentRecords()
- {
- synchronized (recentRecords)
- {
- return new HashMap<String, List<Record>>(recentRecords);
- }
- }
-
- public Set<String> getClientHosts()
- {
- Map<String, List<Record>> map = this.getRecentRecords();
- Set<String> hosts = new HashSet<String>();
- for (List<Record> list : map.values())
- {
- for (Record record : list)
- {
- if (MessageType.INBOUND.equals(record.getMessageType()) &&
record.getSourceHost() != null)
- {
- hosts.add(record.getSourceHost());
- }
- }
- }
- return hosts;
- }
-
- public Map<String, List<Record>> getMatchingRecords(RecordFilter[]
filters)
- {
- Map<String, List<Record>> map = this.getRecentRecords();
- Map<String, List<Record>> result = new HashMap<String,
List<Record>>();
- for (List<Record> list : map.values())
- {
- for (Record record : list)
- {
- boolean match = true;
- for (int i = 0; i < filters.length && match; i++)
- {
- match = match && filters[i].match(record);
- }
- if (match)
- {
- result.put(record.getGroupID(), list);
- break;
- }
- }
- }
- return result;
- }
-
- public Map<String, List<Record>> getRecordsByClientHost(String
clientHost)
- {
- RecordFilter[] filters = new RecordFilter[1];
- filters[0] = new HostFilter(clientHost, true);
- return this.getMatchingRecords(filters);
- }
-
- public Map<String, List<Record>> getRecordsByOperation(String namespace,
String localPart)
- {
- RecordFilter[] filters = new RecordFilter[1];
- filters[0] = new OperationFilter(new QName(namespace, localPart));
- return this.getMatchingRecords(filters);
- }
-
- public int getMaxSize()
- {
- return maxSize;
- }
-
- public void setMaxSize(int maxSize)
- {
- synchronized (recentRecords)
- {
- while (maxSize < size)
- {
- this.deleteOldestRecord();
- }
- this.maxSize = maxSize;
- }
- }
-
- public int getSize()
- {
- return size;
- }
-
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,173 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+import org.jboss.wsf.spi.management.recording.Record.MessageType;
+
+/**
+ * Keeps the last received records in memory and allows user to
+ * search / get statistics on them.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Dec-2007
+ */
+public class MemoryBufferRecorder extends AbstractRecordProcessor implements
MemoryBufferRecorderMBean
+{
+
+ private Map<String, List<Record>> recentRecords =
Collections.synchronizedMap(new HashMap<String, List<Record>>());
+ private ConcurrentLinkedQueue<String> recentRecordGroups = new
ConcurrentLinkedQueue<String>();
+ private int size = 0;
+
+ private int maxSize = 50;
+
+ @Override
+ public void processRecord(Record record)
+ {
+ synchronized (recentRecords)
+ {
+ List<Record> list = recentRecords.get(record.getGroupID());
+ if (list == null)
+ {
+ list = new LinkedList<Record>();
+ recentRecords.put(record.getGroupID(), list);
+ while (size > maxSize)
+ {
+ this.deleteOldestRecord();
+ }
+ recentRecordGroups.offer(record.getGroupID());
+ size++;
+ }
+ list.add(record);
+ }
+ }
+
+
+ private void deleteOldestRecord()
+ {
+ String id = recentRecordGroups.poll();
+ if (id != null)
+ {
+ recentRecords.remove(id);
+ size--;
+ }
+ }
+
+ private Map<String, List<Record>> getRecentRecords()
+ {
+ synchronized (recentRecords)
+ {
+ return new HashMap<String, List<Record>>(recentRecords);
+ }
+ }
+
+ public Set<String> getClientHosts()
+ {
+ Map<String, List<Record>> map = this.getRecentRecords();
+ Set<String> hosts = new HashSet<String>();
+ for (List<Record> list : map.values())
+ {
+ for (Record record : list)
+ {
+ if (MessageType.INBOUND.equals(record.getMessageType()) &&
record.getSourceHost() != null)
+ {
+ hosts.add(record.getSourceHost());
+ }
+ }
+ }
+ return hosts;
+ }
+
+ public Map<String, List<Record>> getMatchingRecords(RecordFilter[]
filters)
+ {
+ Map<String, List<Record>> map = this.getRecentRecords();
+ Map<String, List<Record>> result = new HashMap<String,
List<Record>>();
+ for (List<Record> list : map.values())
+ {
+ for (Record record : list)
+ {
+ boolean match = true;
+ for (int i = 0; i < filters.length && match; i++)
+ {
+ match = match && filters[i].match(record);
+ }
+ if (match)
+ {
+ result.put(record.getGroupID(), list);
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ public Map<String, List<Record>> getRecordsByClientHost(String
clientHost)
+ {
+ RecordFilter[] filters = new RecordFilter[1];
+ filters[0] = new HostFilter(clientHost, true);
+ return this.getMatchingRecords(filters);
+ }
+
+ public Map<String, List<Record>> getRecordsByOperation(String namespace,
String localPart)
+ {
+ RecordFilter[] filters = new RecordFilter[1];
+ filters[0] = new OperationFilter(new QName(namespace, localPart));
+ return this.getMatchingRecords(filters);
+ }
+
+ public int getMaxSize()
+ {
+ return maxSize;
+ }
+
+ public void setMaxSize(int maxSize)
+ {
+ synchronized (recentRecords)
+ {
+ while (maxSize < size)
+ {
+ this.deleteOldestRecord();
+ }
+ this.maxSize = maxSize;
+ }
+ }
+
+ public int getSize()
+ {
+ return size;
+ }
+
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.wsf.spi.management.recording.Record;
-import org.jboss.wsf.spi.management.recording.RecordFilter;
-
-/**
- * The MemoryBufferRecorder's MBean view
- *
- * @author alessio.soldano(a)jboss.com
- * @since 18-Dec-2007
- */
-public interface MemoryBufferRecorderMBean extends ManagedRecordProcessorMBean
-{
- /**
- * Gets the records matching the provided filters. Records having the
- * same group ID are returned together.
- *
- * @param filters
- * @return The matching records as a map GroupID->List<Record>
- */
- public Map<String, List<Record>> getMatchingRecords(RecordFilter[]
filters);
-
- /**
- * Gets the records with the given operation. Records having the
- * same group ID are returned together.
- *
- * @param namespace
- * @param localPart
- * @return The matching records as a map GroupID->List<Record>
- */
- public Map<String, List<Record>> getRecordsByOperation(String namespace,
String localPart);
-
- /**
- * Gets the records with the given client host. Records having the
- * same group ID are returned together.
- *
- * @param clientHost
- * @return The matching records as a map GroupID->List<Record>
- */
- public Map<String, List<Record>> getRecordsByClientHost(String
clientHost);
-
- /**
- * Gets a set containing the client hosts of the last saved records.
- *
- * @return
- */
- public Set<String> getClientHosts();
-
- /**
- * Gets the current buffer max size (i.e. the number of record groups stored at the
same time)
- *
- * @return
- */
- public int getMaxSize();
-
- public void setMaxSize(int maxSize);
-
- /**
- * Gets the buffer's current size
- * @return
- */
- public int getSize();
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * The MemoryBufferRecorder's MBean view
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Dec-2007
+ */
+public interface MemoryBufferRecorderMBean extends ManagedRecordProcessorMBean
+{
+ /**
+ * Gets the records matching the provided filters. Records having the
+ * same group ID are returned together.
+ *
+ * @param filters
+ * @return The matching records as a map GroupID->List<Record>
+ */
+ public Map<String, List<Record>> getMatchingRecords(RecordFilter[]
filters);
+
+ /**
+ * Gets the records with the given operation. Records having the
+ * same group ID are returned together.
+ *
+ * @param namespace
+ * @param localPart
+ * @return The matching records as a map GroupID->List<Record>
+ */
+ public Map<String, List<Record>> getRecordsByOperation(String namespace,
String localPart);
+
+ /**
+ * Gets the records with the given client host. Records having the
+ * same group ID are returned together.
+ *
+ * @param clientHost
+ * @return The matching records as a map GroupID->List<Record>
+ */
+ public Map<String, List<Record>> getRecordsByClientHost(String
clientHost);
+
+ /**
+ * Gets a set containing the client hosts of the last saved records.
+ *
+ * @return
+ */
+ public Set<String> getClientHosts();
+
+ /**
+ * Gets the current buffer max size (i.e. the number of record groups stored at the
same time)
+ *
+ * @return
+ */
+ public int getMaxSize();
+
+ public void setMaxSize(int maxSize);
+
+ /**
+ * Gets the buffer's current size
+ * @return
+ */
+ public int getSize();
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import org.jboss.wsf.spi.management.recording.Record;
-import org.jboss.wsf.spi.management.recording.RecordFilter;
-
-/**
- * A simple record filter acting like the negation operator
- *
- * @author alessio.soldano(a)jboss.com
- * @since 18-Dec-2007
- *
- */
-public class NotFilter implements RecordFilter
-{
-
- private RecordFilter filter;
-
- public NotFilter(RecordFilter filter)
- {
- this.filter = filter;
- }
-
- public boolean match(Record record)
- {
- return !filter.match(record);
- }
-
- public RecordFilter getFilter()
- {
- return filter;
- }
-
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * A simple record filter acting like the negation operator
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Dec-2007
+ *
+ */
+public class NotFilter implements RecordFilter
+{
+
+ private RecordFilter filter;
+
+ public NotFilter(RecordFilter filter)
+ {
+ this.filter = filter;
+ }
+
+ public boolean match(Record record)
+ {
+ return !filter.match(record);
+ }
+
+ public RecordFilter getFilter()
+ {
+ return filter;
+ }
+
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import javax.xml.namespace.QName;
-
-import org.jboss.wsf.spi.management.recording.Record;
-import org.jboss.wsf.spi.management.recording.RecordFilter;
-
-/**
- * This filter matches records having a given operation QName value.
- *
- * @author alessio.soldano(a)jboss.com
- * @since 11-Dec-2007
- */
-public class OperationFilter implements RecordFilter
-{
-
- private QName operation;
-
- public OperationFilter(QName operation)
- {
- this.operation = operation;
- }
-
- public boolean match(Record record)
- {
- if (record != null)
- {
- if (record.getOperation() == null && operation == null)
- {
- return true;
- }
- else if (operation != null && operation.equals(record.getOperation()))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- return true;
- }
- }
-
- public QName getOperation()
- {
- return operation;
- }
-
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * This filter matches records having a given operation QName value.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 11-Dec-2007
+ */
+public class OperationFilter implements RecordFilter
+{
+
+ private QName operation;
+
+ public OperationFilter(QName operation)
+ {
+ this.operation = operation;
+ }
+
+ public boolean match(Record record)
+ {
+ if (record != null)
+ {
+ if (record.getOperation() == null && operation == null)
+ {
+ return true;
+ }
+ else if (operation != null && operation.equals(record.getOperation()))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ public QName getOperation()
+ {
+ return operation;
+ }
+
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import org.jboss.wsf.spi.management.recording.Record;
-import org.jboss.wsf.spi.management.recording.RecordFilter;
-
-/**
- * A simple record filter acting like the OR operator
- *
- * @author alessio.soldano(a)jboss.com
- * @since 18-Dec-2007
- *
- */
-public class OrFilter implements RecordFilter
-{
-
- private RecordFilter filter1;
- private RecordFilter filter2;
-
- public OrFilter(RecordFilter filter1, RecordFilter filter2)
- {
- this.filter1 = filter1;
- this.filter2 = filter2;
- }
-
- public boolean match(Record record)
- {
- return filter1.match(record) || filter2.match(record);
- }
-
- public RecordFilter getFilter1()
- {
- return filter1;
- }
-
- public RecordFilter getFilter2()
- {
- return filter2;
- }
-
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * A simple record filter acting like the OR operator
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Dec-2007
+ *
+ */
+public class OrFilter implements RecordFilter
+{
+
+ private RecordFilter filter1;
+ private RecordFilter filter2;
+
+ public OrFilter(RecordFilter filter1, RecordFilter filter2)
+ {
+ this.filter1 = filter1;
+ this.filter2 = filter2;
+ }
+
+ public boolean match(Record record)
+ {
+ return filter1.match(record) || filter2.match(record);
+ }
+
+ public RecordFilter getFilter1()
+ {
+ return filter1;
+ }
+
+ public RecordFilter getFilter2()
+ {
+ return filter2;
+ }
+
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import org.jboss.wsf.spi.management.recording.Record;
-
-/**
- * Simple record factory
- *
- * @author alessio.soldano(a)jboss.com
- * @since 8-Dec-2007
- */
-public class RecordFactory
-{
- private static long count = 0;
-
- public static String newGroupID()
- {
- long time = System.currentTimeMillis();
- StringBuilder sb = new StringBuilder();
- synchronized (RecordFactory.class)
- {
- count++;
- }
- sb.append(count);
- sb.append("-");
- sb.append(time);
- return sb.toString();
- }
-
- public static Record newRecord(String groupID)
- {
- Record record = new RecordImpl();
- record.setGroupID(groupID);
- return record;
- }
-
- public static Record newRecord()
- {
- return newRecord(newGroupID());
- }
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import org.jboss.wsf.spi.management.recording.Record;
+
+/**
+ * Simple record factory
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public class RecordFactory
+{
+ private static long count = 0;
+
+ public static String newGroupID()
+ {
+ long time = System.currentTimeMillis();
+ StringBuilder sb = new StringBuilder();
+ synchronized (RecordFactory.class)
+ {
+ count++;
+ }
+ sb.append(count);
+ sb.append("-");
+ sb.append(time);
+ return sb.toString();
+ }
+
+ public static Record newRecord(String groupID)
+ {
+ Record record = new RecordImpl();
+ record.setGroupID(groupID);
+ return record;
+ }
+
+ public static Record newRecord()
+ {
+ return newRecord(newGroupID());
+ }
+}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java 2007-12-20
14:55:37 UTC (rev 5376)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -1,142 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.framework.management.recording;
-
-//$Id$
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.wsf.spi.management.recording.Record;
-
-/**
- * Default Record implementation
- *
- * @author alessio.soldano(a)jboss.com
- * @since 8-Dec-2007
- */
-public class RecordImpl implements Record
-{
- private String sourceHost;
- private String destinationHost;
- private Map<String, List<String>> headers = new HashMap<String,
List<String>>();
- private MessageType messageType;
- private QName operation;
- private String groupID;
- private Date date;
- private String envelope;
-
- RecordImpl()
- {
-
- }
-
- public void addHeaders(String key, List<String> value)
- {
- headers.put(key, value);
- }
-
- public Map<String, List<String>> getHeaders()
- {
- return headers;
- }
-
- public MessageType getMessageType()
- {
- return messageType;
- }
-
- public void setMessageType(MessageType messageType)
- {
- this.messageType = messageType;
- }
-
- public String getSourceHost()
- {
- return sourceHost;
- }
-
- public void setSourceHost(String sourceHost)
- {
- this.sourceHost = sourceHost;
- }
-
- public String getDestinationHost()
- {
- return destinationHost;
- }
-
- public void setDestinationHost(String destinationHost)
- {
- this.destinationHost = destinationHost;
- }
-
- public void setHeaders(Map<String, List<String>> headers)
- {
- this.headers = headers;
- }
-
- public String getGroupID()
- {
- return groupID;
- }
-
- public QName getOperation()
- {
- return operation;
- }
-
- public void setGroupID(String groupID)
- {
- this.groupID = groupID;
- }
-
- public void setOperation(QName operation)
- {
- this.operation = operation;
- }
-
- public Date getDate()
- {
- return date;
- }
-
- public void setDate(Date date)
- {
- this.date = date;
- }
-
- public void setEnvelope(String envelope)
- {
- this.envelope = envelope;
- }
-
- public String getEnvelope()
- {
- return envelope;
- }
-
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java
(from rev 5376,
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java 2007-12-20
18:38:09 UTC (rev 5380)
@@ -0,0 +1,142 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.framework.management.recording;
+
+//$Id$
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.wsf.spi.management.recording.Record;
+
+/**
+ * Default Record implementation
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public class RecordImpl implements Record
+{
+ private String sourceHost;
+ private String destinationHost;
+ private Map<String, List<String>> headers = new HashMap<String,
List<String>>();
+ private MessageType messageType;
+ private QName operation;
+ private String groupID;
+ private Date date;
+ private String envelope;
+
+ RecordImpl()
+ {
+
+ }
+
+ public void addHeaders(String key, List<String> value)
+ {
+ headers.put(key, value);
+ }
+
+ public Map<String, List<String>> getHeaders()
+ {
+ return headers;
+ }
+
+ public MessageType getMessageType()
+ {
+ return messageType;
+ }
+
+ public void setMessageType(MessageType messageType)
+ {
+ this.messageType = messageType;
+ }
+
+ public String getSourceHost()
+ {
+ return sourceHost;
+ }
+
+ public void setSourceHost(String sourceHost)
+ {
+ this.sourceHost = sourceHost;
+ }
+
+ public String getDestinationHost()
+ {
+ return destinationHost;
+ }
+
+ public void setDestinationHost(String destinationHost)
+ {
+ this.destinationHost = destinationHost;
+ }
+
+ public void setHeaders(Map<String, List<String>> headers)
+ {
+ this.headers = headers;
+ }
+
+ public String getGroupID()
+ {
+ return groupID;
+ }
+
+ public QName getOperation()
+ {
+ return operation;
+ }
+
+ public void setGroupID(String groupID)
+ {
+ this.groupID = groupID;
+ }
+
+ public void setOperation(QName operation)
+ {
+ this.operation = operation;
+ }
+
+ public Date getDate()
+ {
+ return date;
+ }
+
+ public void setDate(Date date)
+ {
+ this.date = date;
+ }
+
+ public void setEnvelope(String envelope)
+ {
+ this.envelope = envelope;
+ }
+
+ public String getEnvelope()
+ {
+ return envelope;
+ }
+
+}