- java.lang.Object
-
- com.sun.xml.ws.xmlfilter.Invocation
-
public final class Invocation extends Object
The class represents a wrapper aroundXMLStreamWriterinvocations.- Author:
- Marek Potociar (marek.potociar at sun.com)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringargsToString()Method returnsStringrepresentation of arguments stored in theInvocationinstance.static InvocationcreateInvocation(Method method, Object[] args)Factory method that createsInvocationinstance according to input argumentsObjectexecute(XMLStreamWriter target)Executes the method ontargetXMLStreamWriterinstance.static voidexecuteBatch(XMLStreamWriter target, Queue<Invocation> batch)Method executes queue of invocations.ObjectgetArgument(int index)Returns single invocation argument for thisInvocationinstance that is stored in the invocation arguments array at position determined byindexargument.intgetArgumentsCount()Returns information about the number of arguments stored in thisInvocationinstanceStringgetMethodName()Returns information about the name of the method represented by thisInvocationinstanceXmlStreamWriterMethodTypegetMethodType()Returns information about the type of the method represented by thisInvocationinstanceStringtoString()Method returnsStringrepresentation of theInvocationinstance.
-
-
-
Method Detail
-
createInvocation
public static Invocation createInvocation(Method method, Object[] args)
Factory method that createsInvocationinstance according to input arguments- Parameters:
method- method represented by theInvocationinstance returned as a result of this factory method callargs- invocation arguments to be passed to the method when#executeBatch()method is invoked on theInvocationinstance.- Returns:
- the
Invocationinstance representing invocation of method defined by value ofmethodargument.
-
executeBatch
public static void executeBatch(XMLStreamWriter target, Queue<Invocation> batch) throws InvocationProcessingException
Method executes queue of invocations. All invocations must represent methods withvoidreturn type. After succesful invocation of the whole batch, the batch queue is fully consumed and empty.- Parameters:
target- {@link http://java.sun.com/javase/6/docs/api/javax/xml/stream/XMLStreamWriter.html|XmlStreamWriter} used for invocation queue executionbatch- queue of invocations to be executed on the targeted {@link http://java.sun.com/javase/6/docs/api/javax/xml/stream/XMLStreamWriter.html|XmlStreamWriter}. After succesful invocation of the whole batch, the batch queue is fully consumed and empty.- Throws:
IllegalAccessExceptionIllegalArgumentExceptioncom.sun.xml.ws.policy.jaxws.xmlstreamwriter.InvocationProcessingExceptionInvocationProcessingException
-
getMethodName
public String getMethodName()
Returns information about the name of the method represented by thisInvocationinstance- Returns:
- method name represented by this
Invocationinstance
-
getMethodType
public XmlStreamWriterMethodType getMethodType()
Returns information about the type of the method represented by thisInvocationinstance- Returns:
- method type represented by this
Invocationinstance - See Also:
XmlStreamWriterMethodType
-
getArgument
public Object getArgument(int index) throws ArrayIndexOutOfBoundsException
Returns single invocation argument for thisInvocationinstance that is stored in the invocation arguments array at position determined byindexargument.- Returns:
- single invocation argument for this
Invocationinstance at position determined byindexargument - Throws:
ArrayIndexOutOfBoundsException- if there are no arguments in the array or if the index parameter is out of bounds of invocation arguments array
-
getArgumentsCount
public int getArgumentsCount()
Returns information about the number of arguments stored in thisInvocationinstance- Returns:
- number of arguments stored in this
Invocationinstance
-
execute
public Object execute(XMLStreamWriter target) throws InvocationProcessingException
Executes the method ontargetXMLStreamWriterinstance.- Returns:
- execution result.
- Throws:
InvocationProcessingException- wraps underlying exception - seeMethod.invoke().
-
toString
public String toString()
Method returnsStringrepresentation of theInvocationinstance.- Overrides:
toStringin classObject- Returns:
Stringrepresentation of theInvocationinstance.
-
argsToString
public String argsToString()
Method returnsStringrepresentation of arguments stored in theInvocationinstance.- Returns:
Stringrepresentation of arguments stored in theInvocationinstance.
-
-