ServiceRef (Apache Tomcat 9.0.120 API Documentation)
Description: declaration: package: org.apache.naming, class: ServiceRef

# Class ServiceRef

java.lang.Object
javax.naming.Reference
org.apache.naming.AbstractRef
org.apache.naming.ServiceRef

All Implemented Interfaces:
  `Serializable, Cloneable`

public class ServiceRef extends AbstractRef
Represents a reference web service.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `DEFAULT_FACTORY`
  Default factory for this reference.
  `static final String`
  `JAXRPCMAPPING`
  Jaxrpcmapping address type.
  `static final String`
  `PORTCOMPONENTLINK`
  port-component-ref/port-component-link address type.
  `static final String`
  `SERVICE_INTERFACE`
  Service Classname address type.
  `static final String`
  `SERVICE_LOCAL_PART`
  Service local part address type.
  `static final String`
  `SERVICE_NAMESPACE`
  ServiceQname address type.
  `static final String`
  `SERVICEENDPOINTINTERFACE`
  port-component-ref/service-endpoint-interface address type.
  `static final String`
  `WSDL`
  Wsdl Location address type.

  ### Fields inherited from class Reference

  `addrs, classFactory, classFactoryLocation, className`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ServiceRef(String refname, String serviceInterface, String[] serviceQname, String wsdl, String jaxrpcmapping)`
  Creates a ServiceRef with the given parameters and no factory information.
  `ServiceRef(String refname, String serviceInterface, String[] serviceQname, String wsdl, String jaxrpcmapping, String factory, String factoryLocation)`
  Creates a ServiceRef with the given parameters and factory information.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addHandler(HandlerRef handler)`
  Adds a handler reference to the list.
  `protected String`
  `getDefaultFactoryClassName()`
  Returns the default factory class name.
  `HandlerRef`
  `getHandler()`
  Add and Get Handlers classes.
  `int`
  `getHandlersSize()`
  Returns the number of handlers in the list.

  ### Methods inherited from class AbstractRef

  `getFactoryClassName, toString`

  ### Methods inherited from class Reference

  `add, add, clear, clone, equals, get, get, getAll, getClassName, getFactoryClassLocation, hashCode, remove, size`

  ### Methods inherited from class Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### DEFAULT_FACTORY

    public static final String DEFAULT_FACTORY
    Default factory for this reference.
    See Also:
      - Constant Field Values

  - ### SERVICE_INTERFACE

    public static final String SERVICE_INTERFACE
    Service Classname address type.
    See Also:
      - Constant Field Values

  - ### SERVICE_NAMESPACE

    public static final String SERVICE_NAMESPACE
    ServiceQname address type.
    See Also:
      - Constant Field Values

  - ### SERVICE_LOCAL_PART

    public static final String SERVICE_LOCAL_PART
    Service local part address type.
    See Also:
      - Constant Field Values

  - ### WSDL

    public static final String WSDL
    Wsdl Location address type.
    See Also:
      - Constant Field Values

  - ### JAXRPCMAPPING

    public static final String JAXRPCMAPPING
    Jaxrpcmapping address type.
    See Also:
      - Constant Field Values

  - ### PORTCOMPONENTLINK

    public static final String PORTCOMPONENTLINK
    port-component-ref/port-component-link address type.
    See Also:
      - Constant Field Values

  - ### SERVICEENDPOINTINTERFACE

    public static final String SERVICEENDPOINTINTERFACE
    port-component-ref/service-endpoint-interface address type.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ServiceRef

    public ServiceRef(String refname, String serviceInterface, String[] serviceQname, String wsdl, String jaxrpcmapping)
    Creates a ServiceRef with the given parameters and no factory information.
    Parameters:
      `refname` - the reference name
      `serviceInterface` - the service interface class name
      `serviceQname` - the service QName (namespace and local part)
      `wsdl` - the WSDL location
      `jaxrpcmapping` - the JAX-RPC mapping

  - ### ServiceRef

    public ServiceRef(String refname, String serviceInterface, String[] serviceQname, String wsdl, String jaxrpcmapping, String factory, String factoryLocation)
    Creates a ServiceRef with the given parameters and factory information.
    Parameters:
      `refname` - the reference name - unused
      `serviceInterface` - the service interface class name
      `serviceQname` - the service QName (namespace and local part)
      `wsdl` - the WSDL location
      `jaxrpcmapping` - the JAX-RPC mapping
      `factory` - the factory class name
      `factoryLocation` - the factory location

- ## Method Details

  - ### getHandler

    public HandlerRef getHandler()
    Add and Get Handlers classes.
    Returns:
      the handler

  - ### getHandlersSize

    public int getHandlersSize()
    Returns the number of handlers in the list.
    Returns:
      the number of handlers

  - ### addHandler

    public void addHandler(HandlerRef handler)
    Adds a handler reference to the list.
    Parameters:
      `handler` - the handler reference to add

  - ### getDefaultFactoryClassName

    protected String getDefaultFactoryClassName()
    Description copied from class: `AbstractRef`
    Returns the default factory class name.
    Specified by:
      `getDefaultFactoryClassName` in class `AbstractRef`
    Returns:
      the default factory class name