org.apache.wsif.base
Class WSIFServiceFactoryImpl

java.lang.Object
  extended by org.apache.wsif.WSIFServiceFactory
      extended by org.apache.wsif.base.WSIFServiceFactoryImpl

public class WSIFServiceFactoryImpl
extends WSIFServiceFactory

Factory class used to create instances of WSIFService

Author:
Mark Whitlock, Owen Burroughs

Constructor Summary
WSIFServiceFactoryImpl()
           
 
Method Summary
 void cachingOn(boolean on)
          Deprecated. Use setFeature(WSIFConstants.WSIF_FEATURE_SERVICE_CACHING, new Boolean(true)) or setFeature(WSIFConstants.WSIF_FEATURE_SERVICE_CACHING, new Boolean(false)) instead
 void clearServiceCache()
          Clear out the service cache.
 java.lang.Object getFeature(java.lang.String name)
          Get the value for a feature currently being used by the factory.
 java.util.Map getFeatures()
          Get the map of features currently being used by the factory.
 WSIFService getService(javax.wsdl.Definition def)
          Returns a new WSIFService.
 WSIFService getService(javax.wsdl.Definition def, javax.wsdl.Service service)
          Returns a new WSIFService.
 WSIFService getService(javax.wsdl.Definition def, javax.wsdl.Service service, javax.wsdl.PortType portType)
          Returns a new WSIFService.
 WSIFService getService(javax.wsdl.Definition def, java.lang.String serviceNS, java.lang.String serviceName, java.lang.String portTypeNS, java.lang.String portTypeName)
          Returns a new WSIFService.
 WSIFService getService(java.lang.String wsdlLoc, java.lang.ClassLoader cl, java.lang.String serviceNS, java.lang.String serviceName, java.lang.String portTypeNS, java.lang.String portTypeName)
          Create a WSIF service instance from WSDL document URL using a ClassLoader to find local resources.
 WSIFService getService(java.lang.String wsdlLoc, java.lang.String serviceNS, java.lang.String serviceName, java.lang.String portTypeNS, java.lang.String portTypeName)
          Create a WSIFService from WSDL document URL.
 void setFeature(java.lang.String name, java.lang.Object value)
          Set a feature on the WSIFServiceFactory.
 void setFeatures(java.util.Map map)
          Set features on the WSIFServiceFactory.
 
Methods inherited from class org.apache.wsif.WSIFServiceFactory
newInstance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSIFServiceFactoryImpl

public WSIFServiceFactoryImpl()
Method Detail

getService

public WSIFService getService(java.lang.String wsdlLoc,
                              java.lang.String serviceNS,
                              java.lang.String serviceName,
                              java.lang.String portTypeNS,
                              java.lang.String portTypeName)
                       throws WSIFException
Create a WSIFService from WSDL document URL.
If serviceName or serviceNS is null, then WSDL document must have exactly one service in it.
If portTypeName or portTypeNS is null, then WSDL document must have exactly one portType in it and all ports of the selected service must implement the same portType.

Specified by:
getService in class WSIFServiceFactory
Parameters:
wsdlLoc - The URL for the wsdl's location
serviceNS - The namespace of the service
serviceName - The name of the service
portTypeNS - The namespace of the port type
portTypeName - The name of the port type
Returns:
The service
Throws:
A - WSIFException if an error occurs when creating the service
WSIFException

getService

public WSIFService getService(java.lang.String wsdlLoc,
                              java.lang.ClassLoader cl,
                              java.lang.String serviceNS,
                              java.lang.String serviceName,
                              java.lang.String portTypeNS,
                              java.lang.String portTypeName)
                       throws WSIFException
Create a WSIF service instance from WSDL document URL using a ClassLoader to find local resources.
If serviceName or serviceNS is null, then WSDL document must have exactly one service in it.
If portTypeName or portTypeNS is null, then WSDL document must have exactly one portType in it and all ports of the selected service must implement the same portType.

Specified by:
getService in class WSIFServiceFactory
Parameters:
wsdlLoc - The URL for the wsdl's location
cl - A ClassLoader to use in locating the wsdl
serviceNS - The namespace of the service
serviceName - The name of the service
portTypeNS - The namespace of the port type
portTypeName - The name of the port type
Returns:
The service
Throws:
A - WSIFException if an error occurs when creating the service
WSIFException

getService

public WSIFService getService(javax.wsdl.Definition def)
                       throws WSIFException
Returns a new WSIFService.

Specified by:
getService in class WSIFServiceFactory
Parameters:
def - The Definition object representing the wsdl
Returns:
The service
Throws:
A - WSIFException if an error occurs when creating the service
WSIFException

getService

public WSIFService getService(javax.wsdl.Definition def,
                              javax.wsdl.Service service)
                       throws WSIFException
Returns a new WSIFService.

Specified by:
getService in class WSIFServiceFactory
Parameters:
def - The Definition object representing the wsdl
service - The Service object representing the service to use
Returns:
The service
Throws:
A - WSIFException if an error occurs when creating the service
WSIFException

getService

public WSIFService getService(javax.wsdl.Definition def,
                              javax.wsdl.Service service,
                              javax.wsdl.PortType portType)
                       throws WSIFException
Returns a new WSIFService.

Specified by:
getService in class WSIFServiceFactory
Parameters:
def - The Definition object representing the wsdl
service - The Service object representing the service to use
portType - The PortType object representing the port type to use
Returns:
The service
Throws:
A - WSIFException if an error occurs when creating the service
WSIFException

getService

public WSIFService getService(javax.wsdl.Definition def,
                              java.lang.String serviceNS,
                              java.lang.String serviceName,
                              java.lang.String portTypeNS,
                              java.lang.String portTypeName)
                       throws WSIFException
Returns a new WSIFService.

Specified by:
getService in class WSIFServiceFactory
Parameters:
def - The Definition object representing the wsdl
serviceNS - The namespace of the service
serviceName - The name of the service
portTypeNS - The namespace of the port type
portTypeName - The name of the port type
Returns:
The service
Throws:
A - WSIFException if an error occurs when creating the service
WSIFException

cachingOn

public void cachingOn(boolean on)
Deprecated. Use setFeature(WSIFConstants.WSIF_FEATURE_SERVICE_CACHING, new Boolean(true)) or setFeature(WSIFConstants.WSIF_FEATURE_SERVICE_CACHING, new Boolean(false)) instead

Set caching of servies on/off. The default is off. If caching is on then a call to getService will first check if a service matching the parameters specified has already been created and if so a reference to that instance of WSIFService is returned.

Overrides:
cachingOn in class WSIFServiceFactory
Parameters:
on - Flag to indicate whether or not caching of services should be used

clearServiceCache

public void clearServiceCache()
Clear out the service cache. Useful if wsdl definitions can change during runtime operations.

Overrides:
clearServiceCache in class WSIFServiceFactory

setFeature

public void setFeature(java.lang.String name,
                       java.lang.Object value)
Description copied from class: WSIFServiceFactory
Set a feature on the WSIFServiceFactory. The names of supported features are stored as constants in the WSIFConstants class. The names of these constants have a convention of starting WSIF_FEATURE_. For more information about individual features, see the field details for the feature constants.

Note: features should be set before calls to the getService methods.

Specified by:
setFeature in class WSIFServiceFactory
Parameters:
name - The name of the feature to set
value - The value of the feature
See Also:
WSIFServiceFactory.setFeature(String, Object)

setFeatures

public void setFeatures(java.util.Map map)
Description copied from class: WSIFServiceFactory
Set features on the WSIFServiceFactory. Calling this method will replace the currently set features with those configured in the Map passed in. The names of supported features are stored as constants in the WSIFConstants class. The names of these constants have a convention of starting WSIF_FEATURE_. For more information about individual features, see the field details for the feature constants.

Note: features should be set before calls to the getService methods.

Specified by:
setFeatures in class WSIFServiceFactory
Parameters:
map - A Map containing all the features to set on the factory
See Also:
WSIFServiceFactory.setFeatures(Map)

getFeature

public java.lang.Object getFeature(java.lang.String name)
Description copied from class: WSIFServiceFactory
Get the value for a feature currently being used by the factory.

Specified by:
getFeature in class WSIFServiceFactory
Returns:
The feature value
See Also:
WSIFServiceFactory.getFeature(String)

getFeatures

public java.util.Map getFeatures()
Description copied from class: WSIFServiceFactory
Get the map of features currently being used by the factory.

Specified by:
getFeatures in class WSIFServiceFactory
Returns:
The map of features
See Also:
WSIFServiceFactory.getFeatures()


Copyright ? 2002, 2006 Apache XML Project. All Rights Reserved.