axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashut...@apache.org
Subject svn commit: r208748 - in /webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler: GenericHandler.java HandlerInfo.java
Date Fri, 01 Jul 2005 11:50:44 GMT
Author: ashutosh
Date: Fri Jul  1 04:50:42 2005
New Revision: 208748

URL: http://svn.apache.org/viewcvs?rev=208748&view=rev
Log:
HandlerInfo and GenericHandler implementation

Modified:
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/GenericHandler.java
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/HandlerInfo.java

Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/GenericHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/GenericHandler.java?rev=208748&r1=208747&r2=208748&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/GenericHandler.java
(original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/GenericHandler.java
Fri Jul  1 04:50:42 2005
@@ -37,7 +37,7 @@
  * @author shaas02
  *
  */
-public class GenericHandler implements Handler, HandlerLifecycle {
+public abstract class GenericHandler implements Handler, HandlerLifecycle {
 
 	protected GenericHandler(){
 		
@@ -64,8 +64,7 @@
 	 */
 	public boolean handleRequest(MessageContext context)
 			throws JAXRPCException, SOAPFaultException {
-		// TODO Auto-generated method stub
-		return false;
+		return true;
 	}
 
 	/**
@@ -83,8 +82,7 @@
 	 */
 	public boolean handleResponse(MessageContext context)
 			throws JAXRPCException {
-		// TODO Auto-generated method stub
-		return false;
+		return true;
 	}
 
 	/**
@@ -100,8 +98,7 @@
 	 * @see javax.xml.rpc.handler.Handler#handleFault(javax.xml.rpc.handler.MessageContext)
 	 */
 	public boolean handleFault(MessageContext context) throws JAXRPCException {
-		// TODO Auto-generated method stub
-		return false;
+		return true;
 	}
 
 	/**
@@ -110,10 +107,7 @@
 	 * outermost element of the Header block.
 	 * @see javax.xml.rpc.handler.Handler#getHeaders()
 	 */
-	public QName[] getHeaders() {
-		// TODO Auto-generated method stub
-		return null;
-	}
+	public abstract QName[] getHeaders();
 
 	/**
 	 * The init method to enable the Handler instance to initialize itself. This method should
be overridden if the derived
@@ -121,19 +115,13 @@
 	 * @param config - Configuration for the initialization of this handler
 	 * @see javax.xml.rpc.handler.HandlerLifecycle#init(null)
 	 */
-	public void init(HandlerInfo config) throws JAXRPCException {
-		// TODO Auto-generated method stub
-
-	}
+	public abstract void init(HandlerInfo config) throws JAXRPCException;
 
 	/**
 	 * The destroy method indicates the end of lifecycle for a Handler instance. This method
should be overridden if the
 	 * derived Handler class needs to specialize implementation of this method.
 	 * @see javax.xml.rpc.handler.HandlerLifecycle#destroy()
 	 */
-	public void destroy() throws JAXRPCException {
-		// TODO Auto-generated method stub
-
-	}
+	public abstract void destroy() throws JAXRPCException ;
 
 }

Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/HandlerInfo.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/HandlerInfo.java?rev=208748&r1=208747&r2=208748&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/HandlerInfo.java
(original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/HandlerInfo.java
Fri Jul  1 04:50:42 2005
@@ -17,6 +17,12 @@
 package javax.xml.rpc.handler;
 
 import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
 
 /**
  * public class HandlerInfo
@@ -31,11 +37,18 @@
  */
 public class HandlerInfo implements Serializable {
 	
+	private Class handlerClass;
+	private Map config;
+	private List<QName> headers;
+	
+	
 	/**
 	 * Default constructor
 	 */
 	HandlerInfo(){
-		
+		handlerClass = null;
+		config = new HashMap();
+		headers = new ArrayList<QName>();
 	}
 
 	/**
@@ -47,7 +60,15 @@
 	 */
 	HandlerInfo(java.lang.Class handlerClass, java.util.Map config,
 			javax.xml.namespace.QName[] headers){
-		
+		this.handlerClass = handlerClass;
+		this.config = config;
+		if(headers != null){
+			for(int i = 0; i < headers.length; i++){
+				if(headers[i] != null){
+					this.headers.add(headers[i]);
+				}
+			}
+		}
 	}
 	
 	/**
@@ -55,7 +76,7 @@
 	 * @param handlerClass - Class for the Handler
 	 */
 	public void setHandlerClass(java.lang.Class handlerClass){
-		
+		this.handlerClass = handlerClass;
 	}
 	
 	/**
@@ -63,7 +84,7 @@
 	 * @return Returns null if no Handler class has been set; otherwise the set handler class
 	 */
 	public java.lang.Class getHandlerClass(){
-		return null;
+		return handlerClass;
 	}
 	
 	/**
@@ -71,7 +92,7 @@
 	 * @param config - Configuration map
 	 */
 	public void setHandlerConfig(java.util.Map config){
-		
+		this.config = config;
 	}
 	
 	/**
@@ -79,7 +100,7 @@
 	 * @return Returns empty Map if no configuration map has been set; otherwise returns the
set configuration map
 	 */
 	public java.util.Map getHandlerConfig(){
-		return null;
+		return config;
 	}
 	
 	/**
@@ -88,7 +109,13 @@
 	 * header block
 	 */
 	public void setHeaders(javax.xml.namespace.QName[] headers){
-		
+		if(headers != null){
+			for(int i = 0; i < headers.length; i++){
+				if(headers[i] != null){
+					this.headers.add(headers[i]);
+				}
+			}
+		}
 	}
 	
 	/**
@@ -97,6 +124,14 @@
 	 * method.
 	 */
 	public javax.xml.namespace.QName[] getHeaders(){
-		return null;
+		if(headers == null || headers.size() == 0){
+			return null;
+		}else{
+			QName[] elements = new QName[headers.size()];
+			for(int i = 0; i < headers.size(); i++){
+				elements[i] = headers.get(i);
+			}
+			return elements;
+		}
 	}
 }



Mime
View raw message