org.apache.wsif
Interface WSIFService

All Known Implementing Classes:
WSIFServiceImpl

public interface WSIFService

A WSIFService is a factory via which WSIFPorts are retrieved. This follows the J2EE design pattern of accessing resources (WSIFPorts, in this case) via a factory which is retrieved from the context in which the application is running. When WSIF is hosted in an app server, the container can manage service invocation details by providing a factory implementation that follows the app servers wishes and guidelines. The factory is assumed to be for a specific portType; i.e., the factory knows how to factor WSIFPorts for a given portType. As such the getPort() methods do not take portType arguments.

Author:
Paul Fremantle, Michael Beisiegel, Sanjiva Weerawarana, Aleksander Slominski

Method Summary
 java.util.Iterator getAvailablePortNames()
          Get the names of the available ports
 WSIFMessage getContext()
          Gets the context information for this WSIFService.
 javax.wsdl.Definition getDefinition()
          Get the Definition object representing the wsdl document
 WSIFPort getPort()
          Returns an appropriate WSIFPort for the portType that this factory supports.
 WSIFPort getPort(java.lang.String portName)
          Returns a WSIFPort for the indicated port.
 java.lang.Object getStub(java.lang.Class iface)
          Get the dynamic proxy that will implement an interface for a port This method will attempt to use the preferred port if set otherwise it will use the first available port.
 java.lang.Object getStub(java.lang.String portName, java.lang.Class iface)
          Get the dynamic proxy that will implement an interface for a port
 void mapPackage(java.lang.String namespace, java.lang.String packageName)
          Add an association between a namespace URI and and a Java package.
 void mapType(javax.xml.namespace.QName xmlType, java.lang.Class javaType)
          Inform WSIF that a particular XML type (referred to in the WSDL) actually maps to a particular Java class.
 void setContext(WSIFMessage context)
          Sets the context information for this WSIFService.
 void setPreferredPort(java.lang.String portName)
          Set the preferred port
 

Method Detail

getPort

public WSIFPort getPort()
                 throws WSIFException
Returns an appropriate WSIFPort for the portType that this factory supports. If the service had multiple ports, which one is returned depends on the specific factory - the factory implementation may use whatever heuristic it feels like to select an "appropriate" one.

Returns:
the new WSIFPort
Throws:
WSIFException - if a suitable port cannot be located.

getPort

public WSIFPort getPort(java.lang.String portName)
                 throws WSIFException
Returns a WSIFPort for the indicated port.

Parameters:
portName - name of the port (local part of the name).
Returns:
the new WSIFPort
Throws:
WSIFException - if the named port is not known or available

getStub

public java.lang.Object getStub(java.lang.String portName,
                                java.lang.Class iface)
                         throws WSIFException
Get the dynamic proxy that will implement an interface for a port

Parameters:
portName - the name of the port
iface - the interface that the stub will implement
Returns:
a stub (a dynamic proxy)
Throws:
WSIFException - if something goes wrong

getStub

public java.lang.Object getStub(java.lang.Class iface)
                         throws WSIFException
Get the dynamic proxy that will implement an interface for a port This method will attempt to use the preferred port if set otherwise it will use the first available port.

Returns:
a stub (a dynamic proxy)
Throws:
WSIFException - if something goes wrong

mapType

public void mapType(javax.xml.namespace.QName xmlType,
                    java.lang.Class javaType)
             throws WSIFException
Inform WSIF that a particular XML type (referred to in the WSDL) actually maps to a particular Java class. Use this method when there is no schema definition for this type, or when the mapping is sufficiently complicated that WSIF does not understand the schema definition. Calling this method overrides whatever schema is present in the WSDL for this type.

Parameters:
xmlType - the fully qualified XML type name
javaType - the java class that this type maps to
Throws:
WSIFException - if something goes wrong

mapPackage

public void mapPackage(java.lang.String namespace,
                       java.lang.String packageName)
                throws WSIFException
Add an association between a namespace URI and and a Java package. This enables WSIF to map schema definitions to real java classes.

Parameters:
namespace - The namespace URI
packageName - The full package name
Throws:
WSIFException - if something goes wrong

setPreferredPort

public void setPreferredPort(java.lang.String portName)
                      throws WSIFException
Set the preferred port

Parameters:
portName - The name of the port to use
Throws:
WSIFException - if something goes wrong

getAvailablePortNames

public java.util.Iterator getAvailablePortNames()
                                         throws WSIFException
Get the names of the available ports

Returns:
Iterator for list of available port names.
Throws:
WSIFException - if something goes wrong

getDefinition

public javax.wsdl.Definition getDefinition()
Get the Definition object representing the wsdl document

Returns:
The Definition object

getContext

public WSIFMessage getContext()
                       throws WSIFException
Gets the context information for this WSIFService.

Returns:
context
Throws:
WSIFException

setContext

public void setContext(WSIFMessage context)
Sets the context information for this WSIFService.



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