com.sun.xml.ws.xmlfilter
Class Invocation

java.lang.Object
  extended by com.sun.xml.ws.xmlfilter.Invocation

public final class Invocation
extends Object

The class represents a wrapper around XMLStreamWriter invocations.

Author:
Marek Potociar (marek.potociar at sun.com)

Method Summary
 String argsToString()
          Method returns String representation of arguments stored in the Invocation instance.
static Invocation createInvocation(Method method, Object[] args)
          Factory method that creates Invocation instance according to input arguments
 Object execute(XMLStreamWriter target)
          Executes the method on target XMLStreamWriter instance.
static void executeBatch(XMLStreamWriter target, Queue<Invocation> batch)
          Method executes queue of invocations.
 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
 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
 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(Method method,
                                          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(XMLStreamWriter target,
                                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:
IllegalAccessException
IllegalArgumentException
com.sun.xml.ws.policy.jaxws.xmlstreamwriter.InvocationProcessingException
InvocationProcessingException

getMethodName

public 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 Object getArgument(int index)
                   throws 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:
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 Object execute(XMLStreamWriter target)
               throws InvocationProcessingException
Executes the method on target XMLStreamWriter instance.

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

toString

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

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

argsToString

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

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


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.