You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by er...@apache.org on 2009/03/09 21:56:14 UTC

svn commit: r751828 - in /cxf/trunk/api/src/main/java/org/apache/cxf: message/MessageUtils.java phase/AbstractPhaseInterceptor.java

Author: ericjohnson
Date: Mon Mar  9 20:56:14 2009
New Revision: 751828

URL: http://svn.apache.org/viewvc?rev=751828&view=rev
Log:
added javadoc to AbstractPhaseInterceptor
fixed some typos in MessageUtils javadoc

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java
    cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java?rev=751828&r1=751827&r2=751828&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageUtils.java Mon Mar  9 20:56:14 2009
@@ -37,7 +37,7 @@
      * Determine if message is outbound.
      * 
      * @param message the current Message
-     * @return true iff the message direction is outbound
+     * @return true if the message direction is outbound
      */
     public static boolean isOutbound(Message message) {
         Exchange exchange = message.getExchange();
@@ -49,7 +49,7 @@
      * Determine if message is fault.
      * 
      * @param message the current Message
-     * @return true iff the message is a fault
+     * @return true if the message is a fault
      */
     public static boolean isFault(Message message) {
         return message != null
@@ -83,7 +83,7 @@
      * Determine if current messaging role is that of requestor.
      * 
      * @param message the current Message
-     * @return true iff the current messaging role is that of requestor
+     * @return true if the current messaging role is that of requestor
      */
     public static boolean isRequestor(Message message) {
         Boolean requestor = (Boolean)message.get(Message.REQUESTOR_ROLE);
@@ -94,7 +94,7 @@
      * Determine if the current message is a partial response.
      * 
      * @param message the current message
-     * @return true iff the current messags is a partial response
+     * @return true if the current messags is a partial response
      */
     public static boolean isPartialResponse(Message message) {
         return Boolean.TRUE.equals(message.get(Message.PARTIAL_RESPONSE_MESSAGE));
@@ -103,7 +103,7 @@
     /**
      * Returns true if a value is either the String "true" (regardless of case)  or Boolean.TRUE.
      * @param value
-     * @return true iff value is either the String "true" or Boolean.TRUE
+     * @return true if value is either the String "true" or Boolean.TRUE
      */
     public static boolean isTrue(Object value) {
         if (value == null) {

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java?rev=751828&r1=751827&r2=751828&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java Mon Mar  9 20:56:14 2009
@@ -28,21 +28,63 @@
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageUtils;
 
+/**
+ * Provides a starting point implementation for a interceptors that 
+ * participate in phased message processing. Developers should extend from 
+ * this class when implementing custom interceptors.
+ * Developers need to provide an implementation for handleMessage() and 
+ * can overide the handleFault() implementation. They should not overide 
+ * the other methods.
+ */
 public abstract class AbstractPhaseInterceptor<T extends Message> implements PhaseInterceptor<T> {
     private final String id;
     private final String phase;
     private final Set<String> before = new SortedArraySet<String>();
     private final Set<String> after = new SortedArraySet<String>();
 
-    public AbstractPhaseInterceptor(String phase) {
+    /**
+	 * Instantiates the interceptor to live in a specified phase. The 
+	 * interceptor's id will be set to the name of the implementing class.
+	 *
+	 * @param phase the interceptor's phase
+	 */
+	public AbstractPhaseInterceptor(String phase) {
         this(null, phase, false);
     }
+
+    /**
+	 * Instantiates the interceptor with a specified id.
+	 *
+	 * @param i the interceptor's id
+	 * @param p the interceptor's phase
+	 */
     public AbstractPhaseInterceptor(String i, String p) {
         this(i, p, false);
     }
+
+    /**
+	 * Instantiates the interceptor and specifies if it gets a system 
+	 * determined unique id. If <code>uniqueId</code> is set to true the 
+	 * interceptor's id will be determined by the runtime. If 
+	 * <code>uniqueId</code> is set to false, the implementing class' name 
+	 * is used as the id.
+	 *
+	 * @param p the interceptor's phase
+	 * @param uniqueId
+	 */
     public AbstractPhaseInterceptor(String phase, boolean uniqueId) {
         this(null, phase, uniqueId);
     }
+
+    /**
+	 * Instantiates the interceptor with a specified id or with a system 
+	 * determined unique id. The specified id will be used unless 
+	 * <code>uniqueId</code> is set to true.
+	 *
+	 * @param i the interceptor's id
+	 * @param p the interceptor's phase
+	 * @param uniqueId
+	 */
     public AbstractPhaseInterceptor(String i, String p, boolean uniqueId) {
         if (i == null) {
             i = getClass().getName();
@@ -103,7 +145,13 @@
         return "GET".equals(method) && message.getContent(XMLStreamReader.class) == null;
     }
     
-    protected boolean isRequestor(T message) {
+    /**
+     * Determine if current messaging role is that of requestor.
+     * 
+     * @param message the current Message
+     * @return true if the current messaging role is that of requestor
+     */
+	protected boolean isRequestor(T message) {
         return MessageUtils.isRequestor(message);
     }