Java Doc for Service.java in  » 6.0-JDK-Core » xml » javax » xml » ws » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » xml » javax.xml.ws 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.xml.ws.Service

Service
public class Service (Code)
Service objects provide the client view of a Web service.

Service acts as a factory of the following:

  • Proxies for a target service endpoint.
  • Instances of javax.xml.ws.Dispatch for dynamic message-oriented invocation of a remote operation.
  • The ports available on a service can be enumerated using the getPorts method. Alternatively, you can pass a service endpoint interface to the unary getPort method and let the runtime select a compatible port.

    Handler chains for all the objects created by a Service can be set by means of a HandlerResolver.

    An Executor may be set on the service in order to gain better control over the threads used to dispatch asynchronous callbacks. For instance, thread pooling with certain parameters can be enabled by creating a ThreadPoolExecutor and registering it with the service.
    since:
       JAX-WS 2.0
    See Also:   javax.xml.ws.spi.Provider
    See Also:   javax.xml.ws.handler.HandlerResolver
    See Also:   java.util.concurrent.Executor


Inner Class :public enum Mode


Constructor Summary
protected  Service(java.net.URL wsdlDocumentLocation, QName serviceName)
    

Method Summary
public  voidaddPort(QName portName, String bindingId, String endpointAddress)
     Creates a new port for the service.
public static  Servicecreate(java.net.URL wsdlDocumentLocation, QName serviceName)
     Create a Service instance.
public static  Servicecreate(QName serviceName)
     Create a Service instance.
public  Dispatch<T>createDispatch(QName portName, Class<T> type, Mode mode)
     Creates a Dispatch instance for use with objects of the users choosing.
Parameters:
  portName - Qualified name for the target service endpoint
Parameters:
  type - The class of object used to messages or messagepayloads.
public  Dispatch<Object>createDispatch(QName portName, JAXBContext context, Mode mode)
     Creates a Dispatch instance for use with JAXB generated objects.
Parameters:
  portName - Qualified name for the target service endpoint
Parameters:
  context - The JAXB context used to marshall and unmarshallmessages or message payloads.
Parameters:
  mode - Controls whether the created dispatch instance is messageor payload oriented, i.e.
public  java.util.concurrent.ExecutorgetExecutor()
     Returns the executor for this Serviceinstance.
public  HandlerResolvergetHandlerResolver()
     Returns the configured handler resolver.
public  TgetPort(QName portName, Class<T> serviceEndpointInterface)
     The getPort method returns a stub.
public  TgetPort(Class<T> serviceEndpointInterface)
     The getPort method returns a stub.
public  Iterator<javax.xml.namespace.QName>getPorts()
    
public  QNamegetServiceName()
     Gets the name of this service.
public  java.net.URLgetWSDLDocumentLocation()
     Gets the location of the WSDL document for this Service.
public  voidsetExecutor(java.util.concurrent.Executor executor)
     Sets the executor for this Service instance. The executor is used for all asynchronous invocations that require callbacks.
Parameters:
  executor - The java.util.concurrent.Executorto be used to invoke a callback.
throws:
  SecurityException - If the instance does not supportsetting an executor for security reasons (e.g.
public  voidsetHandlerResolver(HandlerResolver handlerResolver)
     Sets the HandlerResolver for this Service instance.


Constructor Detail
Service
protected Service(java.net.URL wsdlDocumentLocation, QName serviceName)(Code)




Method Detail
addPort
public void addPort(QName portName, String bindingId, String endpointAddress)(Code)
Creates a new port for the service. Ports created in this way contain no WSDL port type information and can only be used for creating Dispatchinstances.
Parameters:
  portName - Qualified name for the target service endpoint
Parameters:
  bindingId - A String identifier of a binding.
Parameters:
  endpointAddress - Address of the target service endpoint as a URI
throws:
  WebServiceException - If any error in the creation ofthe port
See Also:   javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING
See Also:   javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING
See Also:   javax.xml.ws.http.HTTPBinding.HTTP_BINDING



create
public static Service create(java.net.URL wsdlDocumentLocation, QName serviceName)(Code)
Create a Service instance. The specified WSDL document location and service qualified name must uniquely identify a wsdl:service element.
Parameters:
  wsdlDocumentLocation - URL for the WSDL document locationfor the service
Parameters:
  serviceName - QName for the service
throws:
  WebServiceException - If any error in creation of thespecified service



create
public static Service create(QName serviceName)(Code)
Create a Service instance.
Parameters:
  serviceName - QName for the service
throws:
  WebServiceException - If any error in creation of thespecified service



createDispatch
public Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode)(Code)
Creates a Dispatch instance for use with objects of the users choosing.
Parameters:
  portName - Qualified name for the target service endpoint
Parameters:
  type - The class of object used to messages or messagepayloads. Implementations are required to supportjavax.xml.transform.Source, javax.xml.soap.SOAPMessageand javax.activation.DataSource, depending onthe binding in use.
Parameters:
  mode - Controls whether the created dispatch instance is messageor payload oriented, i.e. whether the user will work with completeprotocol messages or message payloads. E.g. when using the SOAPprotocol, this parameter controls whether the user will work withSOAP messages or the contents of a SOAP body. Mode must be MESSAGEwhen type is SOAPMessage. Dispatch instance
throws:
  WebServiceException - If any error in the creation ofthe Dispatch object
See Also:   javax.xml.transform.Source
See Also:   javax.xml.soap.SOAPMessage



createDispatch
public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Mode mode)(Code)
Creates a Dispatch instance for use with JAXB generated objects.
Parameters:
  portName - Qualified name for the target service endpoint
Parameters:
  context - The JAXB context used to marshall and unmarshallmessages or message payloads.
Parameters:
  mode - Controls whether the created dispatch instance is messageor payload oriented, i.e. whether the user will work with completeprotocol messages or message payloads. E.g. when using the SOAPprotocol, this parameter controls whether the user will work withSOAP messages or the contents of a SOAP body. Dispatch instance
throws:
  ServiceException - If any error in the creation ofthe Dispatch object
See Also:   javax.xml.bind.JAXBContext



getExecutor
public java.util.concurrent.Executor getExecutor()(Code)
Returns the executor for this Serviceinstance. The executor is used for all asynchronous invocations that require callbacks. The java.util.concurrent.Executor to beused to invoke a callback.
See Also:   java.util.concurrent.Executor



getHandlerResolver
public HandlerResolver getHandlerResolver()(Code)
Returns the configured handler resolver. HandlerResolver The HandlerResolver beingused by this Service instance, or nullif there isn't one.



getPort
public T getPort(QName portName, Class<T> serviceEndpointInterface)(Code)
The getPort method returns a stub. A service client uses this stub to invoke operations on the target service endpoint. The serviceEndpointInterface specifies the service endpoint interface that is supported by the created dynamic proxy or stub instance.
Parameters:
  portName - Qualified name of the service endpoint in the WSDL service description
Parameters:
  serviceEndpointInterface - Service endpoint interface supported by the dynamic proxy or stubinstance Object Proxy instance that supports the specified service endpoint interface
throws:
  WebServiceException - This exception is thrown in thefollowing cases:
  • If there is an error in creation of the proxy
  • If there is any missing WSDL metadataas required by this method
  • Optionally, if an illegal serviceEndpointInterfaceor portName is specified

See Also:   java.lang.reflect.Proxy
See Also:   java.lang.reflect.InvocationHandler



getPort
public T getPort(Class<T> serviceEndpointInterface)(Code)
The getPort method returns a stub. The parameter serviceEndpointInterface specifies the service endpoint interface that is supported by the returned proxy. In the implementation of this method, the JAX-WS runtime system takes the responsibility of selecting a protocol binding (and a port) and configuring the proxy accordingly. The returned proxy should not be reconfigured by the client.
Parameters:
  serviceEndpointInterface - Service endpoint interface Object instance that supports the specified service endpoint interface
throws:
  WebServiceException -
  • If there is an error during creationof the proxy
  • If there is any missing WSDL metadataas required by this method
  • Optionally, if an illegal serviceEndpointInterfaceis specified



getPorts
public Iterator<javax.xml.namespace.QName> getPorts()(Code)
Returns an Iterator for the list of QNames of service endpoints grouped by this service Returns java.util.Iterator with elementsof type javax.xml.namespace.QName
throws:
  WebServiceException - If this Service class does nothave access to the required WSDL metadata



getServiceName
public QName getServiceName()(Code)
Gets the name of this service. Qualified name of this service



getWSDLDocumentLocation
public java.net.URL getWSDLDocumentLocation()(Code)
Gets the location of the WSDL document for this Service. URL for the location of the WSDL document for this service



setExecutor
public void setExecutor(java.util.concurrent.Executor executor)(Code)
Sets the executor for this Service instance. The executor is used for all asynchronous invocations that require callbacks.
Parameters:
  executor - The java.util.concurrent.Executorto be used to invoke a callback.
throws:
  SecurityException - If the instance does not supportsetting an executor for security reasons (e.g. thenecessary permissions are missing).
See Also:   java.util.concurrent.Executor



setHandlerResolver
public void setHandlerResolver(HandlerResolver handlerResolver)(Code)
Sets the HandlerResolver for this Service instance.

The handler resolver, if present, will be called once for each proxy or dispatch instance that is created, and the handler chain returned by the resolver will be set on the instance.
Parameters:
  handlerResolver - The HandlerResolver to usefor all subsequently created proxy/dispatch objects.
See Also:   javax.xml.ws.handler.HandlerResolver




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.