Author: richard.opalka(a)jboss.com
Date: 2011-05-06 07:25:03 -0400 (Fri, 06 May 2011)
New Revision: 14272
Added:
api/trunk/src/main/java/org/jboss/ws/api/monitoring/
api/trunk/src/main/java/org/jboss/ws/api/monitoring/Record.java
api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordFilter.java
api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordGroupAssociation.java
api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordProcessor.java
Removed:
api/trunk/src/main/java/org/jboss/wsf/spi/management/
Log:
[JBWS-3289] refactoring packages: org.jboss.wsf.spi.management.record ->
org.jboss.ws.api.monitoring
Added: api/trunk/src/main/java/org/jboss/ws/api/monitoring/Record.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/monitoring/Record.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/monitoring/Record.java 2011-05-06 11:25:03
UTC (rev 14272)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.api.monitoring;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public interface Record extends Serializable
+{
+ public enum MessageType {INBOUND, OUTBOUND};
+
+ /**
+ * Gets the group ID corresponding to the current message exchange flow
+ *
+ * @return
+ */
+ public String getGroupID();
+
+ public void setGroupID(String groupID);
+
+ /**
+ * Gets the date of this record
+ *
+ * @return
+ */
+ 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 SOAP message envelope
+ *
+ * @return
+ */
+ public String getEnvelope();
+
+ public void setEnvelope(String envelope);
+
+ /**
+ * 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 QName getOperation();
+
+ public void setOperation(QName operation);
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordFilter.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordFilter.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordFilter.java 2011-05-06
11:25:03 UTC (rev 14272)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.api.monitoring;
+
+import java.io.Serializable;
+
+/**
+ * A record filter
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public interface RecordFilter extends Cloneable, Serializable
+{
+ /**
+ * Returns true if the filter matches the given record.
+ */
+ boolean match(Record record);
+
+ /**
+ * RecordFilters must override Object.clone()
+ */
+ Object clone() throws CloneNotSupportedException;
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordGroupAssociation.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordGroupAssociation.java
(rev 0)
+++
api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordGroupAssociation.java 2011-05-06
11:25:03 UTC (rev 14272)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.api.monitoring;
+
+import java.util.Stack;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Associates the record group ID with the current thread.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public class RecordGroupAssociation
+{
+ private static ThreadLocal<Stack<String>> groupIDAssoc = new
ThreadLocal<Stack<String>>();
+
+ // provide logging
+ private static Logger log = Logger.getLogger(RecordGroupAssociation.class);
+
+
+ public static void pushGroupID(String groupID)
+ {
+ if(log.isTraceEnabled()) log.trace("pushGroupID: " + groupID + "
(Thread " +Thread.currentThread().getName()+ ")");
+ Stack<String> stack = groupIDAssoc.get();
+ if (stack == null)
+ {
+ stack = new Stack<String>();
+ groupIDAssoc.set(stack);
+ }
+ stack.push(groupID);
+ }
+
+ public static String peekGroupID()
+ {
+ String groupID = null;
+ Stack<String> stack = groupIDAssoc.get();
+ if (stack != null && stack.isEmpty() == false)
+ {
+ groupID = stack.peek();
+ }
+ if(log.isTraceEnabled()) log.trace("peekGroupID: " + groupID + "
(Thread " +Thread.currentThread().getName()+ ")");
+ return groupID;
+ }
+
+ public static String popGroupID()
+ {
+ String groupID = null;
+ Stack<String> stack = groupIDAssoc.get();
+ if (stack != null && stack.isEmpty() == false)
+ {
+ groupID = stack.pop();
+ }
+ if(log.isTraceEnabled()) log.trace("popGroupID: " + groupID +"
(Thread " +Thread.currentThread().getName()+ ")");
+ return groupID;
+ }
+
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordProcessor.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordProcessor.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/monitoring/RecordProcessor.java 2011-05-06
11:25:03 UTC (rev 14272)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.api.monitoring;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Processes a record. A RecordProcessor may have filters to allow processing
+ * of records matching given criteria. It also gives users fine management of
+ * record's attributes to processed.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public interface RecordProcessor extends Cloneable, Serializable
+{
+ String getName();
+
+ void setName(String name);
+
+ boolean isRecording();
+
+ void setRecording(boolean value);
+
+ void processRecord(Record record);
+
+ List<RecordFilter> getFilters();
+
+ void addFilter(RecordFilter filter);
+
+ void setFilters(List<RecordFilter> filters);
+
+ boolean isProcessSourceHost();
+
+ void setProcessSourceHost(boolean value);
+
+ boolean isProcessDestinationHost();
+
+ void setProcessDestinationHost(boolean value);
+
+ boolean isProcessMessageType();
+
+ void setProcessMessageType(boolean value);
+
+ boolean isProcessEnvelope();
+
+ void setProcessEnvelope(boolean value);
+
+ boolean isProcessHeaders();
+
+ void setProcessHeaders(boolean value);
+
+ boolean isProcessOperation();
+
+ void setProcessOperation(boolean value);
+
+ boolean isProcessDate();
+
+ void setProcessDate(boolean value);
+
+ /**
+ * RecordFilters must override Object.clone()
+ */
+ Object clone() throws CloneNotSupportedException;
+}