1 package org.codehaus.xfire.service.object; 2 3 import java.lang.reflect.Method; 4 import java.util.Collection; 5 import java.util.Hashtable; 6 import javax.xml.namespace.QName; 7 8 /*** 9 * An operation that be performed on a service. 10 * 11 * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a> 12 * @since Feb 20, 2004 13 */ 14 public class Operation 15 { 16 private Hashtable inParams; 17 18 private Hashtable outParams; 19 20 private Method method; 21 22 public Operation( final Method method ) 23 { 24 inParams = new Hashtable(); 25 outParams = new Hashtable(); 26 27 this.method = method; 28 } 29 30 public Class getInParameterClass( final String paramName ) 31 { 32 return (Class) inParams.get( paramName ); 33 } 34 35 public void addInParameter( final Parameter p ) 36 { 37 inParams.put( p.getName(), p ); 38 } 39 40 public Parameter getInParameter( final QName q ) 41 { 42 return (Parameter) inParams.get(q); 43 } 44 45 public Collection getInParameters() 46 { 47 return inParams.values(); 48 } 49 50 public Class getOutParameterClass( final String paramName ) 51 { 52 return (Class) outParams.get( paramName ); 53 } 54 55 public void addOutParameter( final Parameter p ) 56 { 57 outParams.put( p.getName(), p ); 58 } 59 60 public Parameter getOutParameter( final QName q ) 61 { 62 return (Parameter) outParams.get(q); 63 } 64 65 public Collection getOutParameters() 66 { 67 return outParams.values(); 68 } 69 70 public Method getMethod() 71 { 72 return method; 73 } 74 75 public String getName() 76 { 77 return method.getName(); 78 } 79 }