com.sun.xml.ws.policy.jaxws.xmlstreamwriter
Class Invocation

java.lang.Object
  extended by com.sun.xml.ws.policy.jaxws.xmlstreamwriter.Invocation

public final class Invocation
extends java.lang.Object

The class represents a wrapper around XMLStreamWriter invocations.


Method Summary
 java.lang.String argsToString()
          Method returns String representation of arguments stored in the Invocation instance.
static Invocation createInvocation(java.lang.reflect.Method method, java.lang.Object[] args)
          Factory method that creates Invocation instance according to input arguments
 java.lang.Object execute(javax.xml.stream.XMLStreamWriter target)
          Executes the method on target XMLStreamWriter instance.
static void executeBatch(javax.xml.stream.XMLStreamWriter target, java.util.Queue<Invocation> batch)
          Method executes queue of invocations.
 java.lang.Object getArgument(int index)
          Returns single invocation argument for this Invocation instance that is stored in the invocation arguments array at position determined by index argument.
 int getArgumentsCount()
          Returns information about the number of arguments stored in this Invocation instance
 java.lang.String getMethodName()
          Returns information about the name of the method represented by this Invocation instance
 XmlStreamWriterMethodType getMethodType()
          Returns information about the type of the method represented by this Invocation instance
 java.lang.String toString()
          Method returns String representation of the Invocation instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createInvocation

public static Invocation createInvocation(java.lang.reflect.Method method,
                                          java.lang.Object[] args)
Factory method that creates Invocation instance according to input arguments

Parameters:
method - method represented by the Invocation instance returned as a result of this factory method call
args - invocation arguments to be passed to the method when #executeBatch() method is invoked on the Invocation instance.
Returns:
the Invocation instance representing invocation of method defined by value of method argument.

executeBatch

public static void executeBatch(javax.xml.stream.XMLStreamWriter target,
                                java.util.Queue<Invocation> batch)
                         throws InvocationProcessingException
Method executes queue of invocations. All invocations must represent methods with void return type. After succesful invocation of the whole batch, the batch queue is fully consumed and empty.

Parameters:
target - http://java.sun.com/javase/6/docs/api/javax/xml/stream/XMLStreamWriter.html|XmlStreamWriter used for invocation queue execution
batch - queue of invocations to be executed on the targeted 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:
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
InvocationProcessingException

getMethodName

public java.lang.String getMethodName()
Returns information about the name of the method represented by this Invocation instance

Returns:
method name represented by this Invocation instance

getMethodType

public XmlStreamWriterMethodType getMethodType()
Returns information about the type of the method represented by this Invocation instance

Returns:
method type represented by this Invocation instance
See Also:
XmlStreamWriterMethodType

getArgument

public java.lang.Object getArgument(int index)
                             throws java.lang.ArrayIndexOutOfBoundsException
Returns single invocation argument for this Invocation instance that is stored in the invocation arguments array at position determined by index argument.

Returns:
single invocation argument for this Invocation instance at position determined by index argument
Throws:
java.lang.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 this Invocation instance

Returns:
number of arguments stored in this Invocation instance

execute

public java.lang.Object execute(javax.xml.stream.XMLStreamWriter target)
                         throws InvocationProcessingException
Executes the method on target XMLStreamWriter instance.

Returns:
execution result.
Throws:
InvocationProcessingException - wraps underlying exception - see Method.invoke().

toString

public java.lang.String toString()
Method returns String representation of the Invocation instance.

Overrides:
toString in class java.lang.Object
Returns:
String representation of the Invocation instance.

argsToString

public java.lang.String argsToString()
Method returns String representation of arguments stored in the Invocation instance.

Returns:
String representation of arguments stored in the Invocation instance.