xsul.xbeans_document_dispatcher
Class XBeansDocumentDispatcher

java.lang.Object
  extended byxsul.xbeans_document_dispatcher.XBeansDocumentDispatcher
All Implemented Interfaces:
MessageProcessor

public class XBeansDocumentDispatcher
extends java.lang.Object
implements MessageProcessor

Maps document QName to a method in a java target. Invokes target when message with document qname arrives.

Version:
$Revision: 1.5 $
Author:
Yogesh L. Simmhan [mailto:ysimmhan@cs.indiana.edu]

Constructor Summary
XBeansDocumentDispatcher()
           
 
Method Summary
 XmlElement processMessage(XmlElement requestMsg)
          Return xml element to indicate that processingis finished.
 boolean setTarget(QName docQName, java.lang.Object targetObject, java.lang.String targetMethodName, boolean overwrite)
          Method addDocumentHandler.
 boolean setTarget(java.lang.String namespace, java.lang.Object targetObject, java.lang.Class targetInterface, boolean overwrite)
          creates an invocation target to match the incoming doc QName against each method name in the target interface and with the given NS.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XBeansDocumentDispatcher

public XBeansDocumentDispatcher()
Method Detail

setTarget

public boolean setTarget(java.lang.String namespace,
                         java.lang.Object targetObject,
                         java.lang.Class targetInterface,
                         boolean overwrite)
                  throws XsulException
creates an invocation target to match the incoming doc QName against each method name in the target interface and with the given NS.

Parameters:
namespace - the namespace of incoming doc to match
targetObject - the impl on which to invoke the method
targetInterface - the methods in the IMPL which are being exposed
overwrite - forces overwrite of existing target object and method with the same method name as one present in given interface.
Returns:
true if this was a unique mapping and no invokation target was overwritten -- i.e. no mapping NS+methodname combination already existed. false if there was already a target for the NS+methodname combination. If overwrite was false, this means that the operation was not performed.
Throws:
XsulException

setTarget

public boolean setTarget(QName docQName,
                         java.lang.Object targetObject,
                         java.lang.String targetMethodName,
                         boolean overwrite)
Method addDocumentHandler. doc's qname matches with given qname causes handler method to be called. method must have input arg as XmlElement or XmlObject and similar output arg.

Parameters:
docQName - a QName
targetObject - an Object
overwrite - forces overwrite of existing target object and method
Returns:
true if this was a unique mapping and no invokation target was overwritten. false if there was already a target for the qname. If overwrite was false, this means that the operation was not performed.

processMessage

public XmlElement processMessage(XmlElement requestMsg)
                          throws XsulException
Return xml element to indicate that processingis finished. else return null (no more links inchains will be called).

Specified by:
processMessage in interface MessageProcessor
Throws:
XsulException


IU Extreme! Lab (http://www.extreme.indiana.edu)