javax.xml.ws.spi
Class Invoker

java.lang.Object
  extended by javax.xml.ws.spi.Invoker

public abstract class Invoker
extends java.lang.Object

Invoker hides the detail of calling into application endpoint implementation. Container hands over an implementation of Invoker to JAX-WS runtime, and jax-ws runtime calls invoke(java.lang.reflect.Method, java.lang.Object...) for a web service invocation. Finally, Invoker does the actual invocation of web service on endpoint instance. Container also injects the provided WebServiceContext and takes care of invoking javax.annotation.PostConstruct methods, if present, on the endpoint implementation.

Since:
JAX-WS 2.2
Author:
Jitendra Kotamraju
See Also:
Provider#createEndpoint(String, Class, Invoker, WebServiceFeature...)

Constructor Summary
Invoker()
           
 
Method Summary
abstract  void inject(WebServiceContext webServiceContext)
          JAX-WS runtimes calls this method to ask container to inject WebServiceContext on the endpoint instance.
abstract  java.lang.Object invoke(java.lang.reflect.Method m, java.lang.Object... args)
          JAX-WS runtime calls this method to do the actual web service invocation on endpoint instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Invoker

public Invoker()
Method Detail

inject

public abstract void inject(WebServiceContext webServiceContext)
                     throws java.lang.IllegalAccessException,
                            java.lang.IllegalArgumentException,
                            java.lang.reflect.InvocationTargetException
JAX-WS runtimes calls this method to ask container to inject WebServiceContext on the endpoint instance. The WebServiceContext object uses thread-local information to return the correct information during the actual endpoint invocation regardless of how many threads are concurrently being used to serve requests.

Parameters:
webServiceContext - a holder for MessageContext
Throws:
java.lang.IllegalAccessException - if the injection done by reflection API throws this exception
IllegalArgumentException - if the injection done by reflection API throws this exception
java.lang.reflect.InvocationTargetException - if the injection done by reflection API throws this exception

invoke

public abstract java.lang.Object invoke(java.lang.reflect.Method m,
                                        java.lang.Object... args)
                                 throws java.lang.IllegalAccessException,
                                        java.lang.IllegalArgumentException,
                                        java.lang.reflect.InvocationTargetException
JAX-WS runtime calls this method to do the actual web service invocation on endpoint instance. The injected WebServiceContext.getMessageContext() gives the correct information for this invocation.

Parameters:
m - Method to be invoked on the service
args - Method arguments
Returns:
return value of the method
Throws:
java.lang.IllegalAccessException - if the invocation done by reflection API throws this exception
IllegalArgumentException - if the invocation done by reflection API throws this exception
java.lang.reflect.InvocationTargetException - if the invocation done by reflection API throws this exception
See Also:
Method.invoke(java.lang.Object, java.lang.Object...)


Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41

Scripting on this page tracks web page traffic, but does not change the content in any way.