|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.wsclient.proxy.impl.WSClientDynamicProxy
public class WSClientDynamicProxy
Dynamic proxy that implements the IWSClientProxy
interface and proxies requests for a
web service interface, providing services such as session managment via a IWSClientSession
instance,
as well as web service result caching via a IWSCacheManager
.
The web service request is handled by the underlying Glue SOAP stack
Field Summary | |
---|---|
protected AuthCredentials |
m_authCredentials
|
protected int |
m_clientSocketReadTimeout
|
protected String |
m_endPointURL
|
protected List |
m_failedAuthCallbacks
|
protected String |
m_hostURL
|
protected IWSProxyFactory |
m_proxyFactory
|
protected boolean |
m_reuseSession
|
protected boolean |
m_useCache
|
protected Class |
m_webServiceClass
|
protected String |
m_wsdlURL
|
Constructor Summary | |
---|---|
WSClientDynamicProxy(IWSProxyFactory proxyFactory,
Class clazz,
String wsdlURL,
String endPoint,
boolean useCache,
boolean reuseSession,
int clientSocketReadTimeout,
AuthCredentials authCredentials)
Primary constructor for creating a new proxy instance for a web service interface stub NOTE: normally this constructor is not called directly, instead a new proxy is obtained via the proxy factory IWSProxyFactory.getProxy() |
Method Summary | |
---|---|
void |
addFailedAuthCallback(IFailedAuthCallback callbackObj)
Register a IFailedAuthCallback listener to be invoked when an authentication failure occurs
when invoking a web service |
void |
flushCache()
Flush the cache web service results cache associated with this proxy |
AuthCredentials |
getAuthCredentials()
Get the AuthCredentials used by this proxy to authenticate web service request. |
protected Throwable |
getBaseException(Throwable t)
helper method to unravel InvocationException and WrappedExceptions |
protected Object |
getBinding(ProxyContext context)
|
int |
getClientSocketReadTimeout()
Get the socket timeout. |
protected Throwable |
getCompatibleException(Method method,
Throwable t)
Translate an exception into a Throwable that is explicitly declared in the the method's throws clause, or wrapped as a RuntimeException (this avoids a UndeclaredThrowableException) |
String |
getEndPointURL()
Get the endpoint that this web service proxy will invoke |
List |
getFailedAuthListeners()
Get the list of all registered IFailedAuthCallback listeners |
String |
getHostURL()
Get the host partion of the IWSClientProxy.getEndPointURL() } |
protected Set |
getInternalMethods()
|
IWSProxyFactory |
getProxyFactory()
The factory that instantiated this proxy |
boolean |
getReuseSession()
Whether to attempt to recycle an existing IWSClientSession when
invoking a web service |
boolean |
getUseCache()
Whether invocations will check with the CacheManager |
Class |
getWebServiceClass()
Get the portType class that this IWSClientProxy instance is proxying |
String |
getWsdlURL()
The WSDL url for this proxy |
Object |
invoke(Object proxy,
Method method,
Object[] args)
Invoke a web service method. |
Object |
invokeMethod(IWSClientSession session,
Method method,
Object[] args)
Directly invoke a web service method. |
protected boolean |
isNonRetryableException(Throwable throwable)
Determine if an exception is fatal (connection, transport, or other non-retry types of errors) |
void |
removeFailedAuthCallback(IFailedAuthCallback callbackObj)
Remove a specific IFailedAuthCallback object from the list of listeners |
void |
setReuseSession(boolean reuseCache)
Specify whether to attempt to recycle an existing IWSClientSession
when invoking a web service |
void |
setUseCache(boolean useCache)
Set option for the cache manager to cache web service results |
protected Throwable |
wrapWsClientException(Throwable throwable)
Wrap the exception if with WsClientException with additional error text (if appropriate) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IWSProxyFactory m_proxyFactory
protected Class m_webServiceClass
protected String m_wsdlURL
protected String m_endPointURL
protected String m_hostURL
protected boolean m_useCache
protected boolean m_reuseSession
protected int m_clientSocketReadTimeout
protected AuthCredentials m_authCredentials
protected List m_failedAuthCallbacks
Constructor Detail |
---|
public WSClientDynamicProxy(IWSProxyFactory proxyFactory, Class clazz, String wsdlURL, String endPoint, boolean useCache, boolean reuseSession, int clientSocketReadTimeout, AuthCredentials authCredentials)
IWSProxyFactory.getProxy()
proxyFactory
- IWSProxyFactory
the proxy factoryclazz
- web service interface to proxywsdlURL
- URL of the web service WSDL fileendPoint
- The endpoint URL of the web serviceuseCache
- enable/disable web service result caching for this proxyreuseSession
- true to enable/disable session reuse for this proxyclientSocketReadTimeout
- the web service timeout in millisecondsauthCredentials
- AuthCredentials
to use when authenticating the web service request. If null,
the AuthCredentials
of the WSProxyFactory will be used.Method Detail |
---|
public Object invokeMethod(IWSClientSession session, Method method, Object[] args) throws Throwable
invoke()
method, which
includes authentication retries and result caching
session
- IWSClientSession
instance to invoke the web service throughmethod
- the Method
on the web service interface to invokeargs
- the web service method arguments as an Object[]
Throwable
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
proxy
- IWSClientSession
instance to invoke the web service throughmethod
- the Method
on the web service interface to invokeargs
- the web service method arguments as an Object[]
Throwable
public IWSProxyFactory getProxyFactory()
IWSClientProxy
getProxyFactory
in interface IWSClientProxy
IWSProxyFactory
that created this proxy instancepublic String getEndPointURL()
IWSClientProxy
getEndPointURL
in interface IWSClientProxy
public String getHostURL()
IWSClientProxy
IWSClientProxy.getEndPointURL()
}
getHostURL
in interface IWSClientProxy
public String getWsdlURL()
IWSClientProxy
getWsdlURL
in interface IWSClientProxy
public boolean getUseCache()
IWSClientProxy
getUseCache
in interface IWSClientProxy
public void setUseCache(boolean useCache)
IWSClientProxy
setUseCache
in interface IWSClientProxy
useCache
- true to enable caching, false to disable cachingpublic boolean getReuseSession()
IWSClientProxy
IWSClientSession
when
invoking a web service
getReuseSession
in interface IWSClientProxy
public void setReuseSession(boolean reuseCache)
IWSClientProxy
IWSClientSession
when invoking a web service
setReuseSession
in interface IWSClientProxy
reuseCache
- true to enable session reuse, false to create a new session on each service invocationpublic AuthCredentials getAuthCredentials()
IWSClientProxy
AuthCredentials
used by this proxy to authenticate web service request.
Specifying null credentials will use global credentials set on the @WSClient
instance.
getAuthCredentials
in interface IWSClientProxy
AuthCredentials
for this proxypublic Class getWebServiceClass()
IWSClientProxy
getWebServiceClass
in interface IWSClientProxy
public int getClientSocketReadTimeout()
IWSClientProxy
getClientSocketReadTimeout
in interface IWSClientProxy
protected Object getBinding(ProxyContext context)
public void addFailedAuthCallback(IFailedAuthCallback callbackObj)
IWSClientProxy
IFailedAuthCallback
listener to be invoked when an authentication failure occurs
when invoking a web service
addFailedAuthCallback
in interface IWSClientProxy
callbackObj
- - the IFailedAuthCallback
object instancepublic void removeFailedAuthCallback(IFailedAuthCallback callbackObj)
IWSClientProxy
IFailedAuthCallback
object from the list of listeners
removeFailedAuthCallback
in interface IWSClientProxy
callbackObj
- - the IFailedAuthCallback object instance to removepublic List getFailedAuthListeners()
IWSClientProxy
IFailedAuthCallback
listeners
getFailedAuthListeners
in interface IWSClientProxy
IFailedAuthCallback
instancesprotected Set getInternalMethods()
protected Throwable getBaseException(Throwable t)
protected Throwable getCompatibleException(Method method, Throwable t)
method
- - the invoked methodt
- - the exception thrown by the method
public void flushCache()
IWSClientProxy
flushCache
in interface IWSClientProxy
protected Throwable wrapWsClientException(Throwable throwable)
throwable
- exception thrown by the web service invocation
protected boolean isNonRetryableException(Throwable throwable)
throwable
- the Exception to examine
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |