Author: alessio.soldano(a)jboss.com
Date: 2007-12-07 21:00:07 -0500 (Fri, 07 Dec 2007)
New Revision: 5240
Added:
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/Record.java
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordFilter.java
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordGroupAssociation.java
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordProcessor.java
Modified:
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
Log:
Recording system based on JAX-WS handler, first implementation
Modified:
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
===================================================================
---
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2007-12-07
15:18:26 UTC (rev 5239)
+++
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2007-12-08
02:00:07 UTC (rev 5240)
@@ -23,11 +23,15 @@
// $Id$
+import java.util.List;
+
import javax.management.ObjectName;
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.RecordProcessor;
/**
* A general JAXWS endpoint.
@@ -116,4 +120,13 @@
/** Set the endpoint metrics for this endpoint */
void setEndpointMetrics(EndpointMetrics metrics);
+
+ List<RecordProcessor> getRecordProcessors();
+ void setRecordProcessors(List<RecordProcessor> recordProcessors);
+
+ boolean isRecording();
+
+ void setRecording(boolean value);
+
+ void processRecord(Record record);
}
Added:
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/Record.java
===================================================================
---
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/Record.java
(rev 0)
+++
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/Record.java 2007-12-08
02:00:07 UTC (rev 5240)
@@ -0,0 +1,105 @@
+/*
+ * 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.spi.management.recording;
+
+//$Id$
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public interface Record
+{
+ public enum MessageType {INBOUND, OUTBOUND};
+
+ public Long getGroupID();
+
+ public void setGroupID(Long groupID);
+
+ public Date getDate();
+
+ public void setDate(Date date);
+
+ /**
+ * Gets the source (message sender) host. The result format conforms to RFC2732
+ *
+ * @return source host
+ */
+ public String getSourceHost();
+
+ public void setSourceHost(String host);
+
+ /**
+ * Gets the source (message sender) host. The result format conforms to RFC2732
+ *
+ * @return the source host
+ */
+ public String getDestinationHost();
+
+ public void setDestinationHost(String host);
+
+ /**
+ * Gets the message type, i.e. MessageType.INBOUND or MessageType.OUTBOUND
+ *
+ * @return the message type
+ */
+ public MessageType getMessageType();
+
+ public void setMessageType(MessageType type);
+
+ /**
+ * Gets the message payload contents as a byte[].
+ *
+ * @return the payload
+ */
+ public byte[] getPayload();
+
+ public void setPayload(byte[] payload);
+
+ public void setEnvelope(String envelope);
+ public String getEnvelope();
+
+ /**
+ * Gets the HTTP headers
+ *
+ * @return the headers
+ */
+ public Map<String, List<String>> getHeaders();
+
+ public void addHeaders(String key, List<String> value);
+
+ public void setHeaders(Map<String, List<String>> headers);
+
+ /**
+ * Gets the invoked operation
+ *
+ * @return the operation
+ */
+ public String getOperation();
+
+ public void setOperation(String operation);
+}
Property changes on:
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/Record.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordFilter.java
===================================================================
---
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordFilter.java
(rev 0)
+++
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordFilter.java 2007-12-08
02:00:07 UTC (rev 5240)
@@ -0,0 +1,34 @@
+/*
+ * 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.spi.management.recording;
+
+//$Id$
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public interface RecordFilter
+{
+ public boolean match(Record record);
+}
Property changes on:
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordGroupAssociation.java
===================================================================
---
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordGroupAssociation.java
(rev 0)
+++
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordGroupAssociation.java 2007-12-08
02:00:07 UTC (rev 5240)
@@ -0,0 +1,79 @@
+/*
+ * 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.spi.management.recording;
+
+import java.util.Stack;
+
+import org.jboss.logging.Logger;
+
+//$Id$
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public class RecordGroupAssociation
+{
+ private static ThreadLocal<Stack<Long>> groupIDAssoc = new
ThreadLocal<Stack<Long>>();
+
+ // provide logging
+ private static Logger log = Logger.getLogger(RecordGroupAssociation.class);
+
+
+ public static void pushGroupID(Long groupID)
+ {
+ if(log.isDebugEnabled()) log.debug("pushGroupID: " + groupID + "
(Thread " +Thread.currentThread().getName()+ ")");
+ Stack<Long> stack = groupIDAssoc.get();
+ if (stack == null)
+ {
+ stack = new Stack<Long>();
+ groupIDAssoc.set(stack);
+ }
+ stack.push(groupID);
+ }
+
+ public static Long peekGroupID()
+ {
+ Long groupID = null;
+ Stack<Long> stack = groupIDAssoc.get();
+ if (stack != null && stack.isEmpty() == false)
+ {
+ groupID = stack.peek();
+ }
+ if(log.isDebugEnabled()) log.debug("peekGroupID: " + groupID + "
(Thread " +Thread.currentThread().getName()+ ")");
+ return groupID;
+ }
+
+ public static Long popGroupID()
+ {
+ Long groupID = null;
+ Stack<Long> stack = groupIDAssoc.get();
+ if (stack != null && stack.isEmpty() == false)
+ {
+ groupID = stack.pop();
+ }
+ if(log.isDebugEnabled()) log.debug("popGroupID: " + groupID +"
(Thread " +Thread.currentThread().getName()+ ")");
+ return groupID;
+ }
+
+}
Property changes on:
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordGroupAssociation.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordProcessor.java
===================================================================
---
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordProcessor.java
(rev 0)
+++
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordProcessor.java 2007-12-08
02:00:07 UTC (rev 5240)
@@ -0,0 +1,61 @@
+/*
+ * 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.spi.management.recording;
+
+//$Id$
+
+import java.util.List;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public interface RecordProcessor
+{
+ /**
+ * To be used to have this processor process the specified record
+ *
+ * @param record
+ */
+ public void processRecord(Record record);
+
+ /** Filters: a record is processed only if it matches all the processor's filters
**/
+ public List<RecordFilter> getFilters();
+ public void addFilter(RecordFilter filter);
+ public void setFilters(List<RecordFilter> filters);
+
+ /** Fine grained management of records' field to be processed **/
+ 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 isProcessMessage();
+ public void setProcessMessage(boolean value);
+ public boolean isProcessHeaders();
+ public void setProcessHeaders(boolean value);
+ public boolean isProcessOperation();
+ public void setProcessOperation(boolean value);
+
+}
Property changes on:
spi/branches/asoldano/trunk/src/main/java/org/jboss/wsf/spi/management/recording/RecordProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF