org.apache.axis.client

Class ServiceFactory

Implemented Interfaces:
ObjectFactory

public class ServiceFactory
extends ServiceFactory
implements ObjectFactory

Helper class for obtaining Services from JNDI. !!! WORK IN PROGRESS

Author:
Glen Daniels (gdaniels@apache.org)

Field Summary

static String
MAINTAIN_SESSION
static String
SERVICE_CLASSNAME
static String
SERVICE_IMPLEMENTATION_NAME_PROPERTY
static String
SERVICE_LOCAL_PART
static String
SERVICE_NAMESPACE
static String
WSDL_LOCATION

Fields inherited from class javax.xml.rpc.ServiceFactory

SERVICEFACTORY_PROPERTY

Method Summary

Service
createService(URL wsdlDocumentLocation, QName serviceName)
Create a Service instance.
Service
createService(QName serviceName)
Create a Service instance.
Object
getObjectInstance(Object refObject, Name name, Context nameCtx, Hashtable environment)
static Service
getService(Map environment)
Obtain an AxisClient reference, using JNDI if possible, otherwise creating one using the standard Axis configuration pattern.
Service
loadService(Class serviceInterface)
Create an instance of the generated service implementation class for a given service interface, if available.
Service
loadService(URL wsdlDocumentLocation, Class serviceInterface, Properties properties)
Create an instance of the generated service implementation class for a given service interface, if available.
Service
loadService(URL wsdlDocumentLocation, QName serviceName, Properties properties)
Create an instance of the generated service implementation class for a given service, if available.
static void
setThreadDefaultConfig(EngineConfiguration config)

Methods inherited from class javax.xml.rpc.ServiceFactory

createService, createService, loadService, loadService, loadService, newInstance

Field Details

MAINTAIN_SESSION

public static final String MAINTAIN_SESSION


SERVICE_CLASSNAME

public static final String SERVICE_CLASSNAME


SERVICE_IMPLEMENTATION_NAME_PROPERTY

public static final String SERVICE_IMPLEMENTATION_NAME_PROPERTY


SERVICE_LOCAL_PART

public static final String SERVICE_LOCAL_PART


SERVICE_NAMESPACE

public static final String SERVICE_NAMESPACE


WSDL_LOCATION

public static final String WSDL_LOCATION

Method Details

createService

public Service createService(URL wsdlDocumentLocation,
                             QName serviceName)
            throws ServiceException
Create a Service instance.
Overrides:
createService in interface ServiceFactory

Parameters:
wsdlDocumentLocation - URL for the WSDL document location for the service
serviceName - QName for the service.

Returns:
Service.

Throws:
ServiceException - If any error in creation of the specified service


createService

public Service createService(QName serviceName)
            throws ServiceException
Create a Service instance. Since the WSDL file is not provided here, the Service object returned is quite simpleminded. Likewise, the Call object that service.createCall will return will also be simpleminded. The caller must explicitly fill in all the info on the Call object (ie., endpoint address, etc.).
Overrides:
createService in interface ServiceFactory

Parameters:
serviceName - QName for the service

Returns:
Service.

Throws:
ServiceException - If any error in creation of the specified service


getObjectInstance

public Object getObjectInstance(Object refObject,
                                Name name,
                                Context nameCtx,
                                Hashtable environment)
            throws Exception


getService

public static Service getService(Map environment)
Obtain an AxisClient reference, using JNDI if possible, otherwise creating one using the standard Axis configuration pattern. If we end up creating one and do have JNDI access, bind it to the passed name so we find it next time.

Parameters:
environment -

Returns:
a service


loadService

public Service loadService(Class serviceInterface)
            throws ServiceException
Create an instance of the generated service implementation class for a given service interface, if available.

Parameters:
serviceInterface - Service interface

Returns:
Service.

Throws:
ServiceException - If there is any error while creating the specified service, including the case where a generated service implementation class cannot be located


loadService

public Service loadService(URL wsdlDocumentLocation,
                           Class serviceInterface,
                           Properties properties)
            throws ServiceException
Create an instance of the generated service implementation class for a given service interface, if available. An implementation may use the provided wsdlDocumentLocation and properties to help locate the generated implementation class. If no such class is present, a ServiceException will be thrown.

Parameters:
wsdlDocumentLocation - URL for the WSDL document location for the service or null
serviceInterface - Service interface
properties - A set of implementation-specific properties to help locate the generated service implementation class

Returns:
Service.

Throws:
ServiceException - If there is any error while creating the specified service, including the case where a generated service implementation class cannot be located


loadService

public Service loadService(URL wsdlDocumentLocation,
                           QName serviceName,
                           Properties properties)
            throws ServiceException
Create an instance of the generated service implementation class for a given service, if available. The service is uniquely identified by the wsdlDocumentLocation and serviceName arguments. An implementation may use the provided properties to help locate the generated implementation class. If no such class is present, a ServiceException will be thrown.

Parameters:
wsdlDocumentLocation - URL for the WSDL document location for the service or null
serviceName - Qualified name for the service
properties - A set of implementation-specific properties to help locate the generated service implementation class

Returns:
Service.

Throws:
ServiceException - If there is any error while creating the specified service, including the case where a generated service implementation class cannot be located


setThreadDefaultConfig

public static void setThreadDefaultConfig(EngineConfiguration config)


Copyright B) 2005 Apache Web Services Project. All Rights Reserved.