org.andromda.cartridges.support.webservice.client
Class Axis2PortClientInterceptor

java.lang.Object
  extended by org.springframework.core.AttributeAccessorSupport
      extended by org.springframework.beans.BeanMetadataAttributeAccessor
          extended by org.springframework.beans.factory.support.AbstractBeanDefinition
              extended by org.springframework.beans.factory.support.RootBeanDefinition
                  extended by org.andromda.cartridges.support.webservice.client.Axis2PortClientInterceptor
All Implemented Interfaces:
Serializable, Cloneable, org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.BeanMetadataElement, org.springframework.beans.factory.config.BeanDefinition, org.springframework.beans.factory.InitializingBean, org.springframework.core.AttributeAccessor
Direct Known Subclasses:
Axis2ProxyFactoryBean

public class Axis2PortClientInterceptor
extends org.springframework.beans.factory.support.RootBeanDefinition
implements org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.InitializingBean

Interceptor for accessing a specific port of a web service. Change from RootBeanDefinition to GenericBeanDefinition when using Spring 2.5

See Also:
Serialized Form

Field Summary
protected  Log logger
          LogFactory.getLog(Axis2PortClientInterceptor.class)
 
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO, DEPENDENCY_CHECK_ALL, DEPENDENCY_CHECK_NONE, DEPENDENCY_CHECK_OBJECTS, DEPENDENCY_CHECK_SIMPLE, INFER_METHOD, SCOPE_DEFAULT
 
Fields inherited from interface org.springframework.beans.factory.config.BeanDefinition
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON
 
Constructor Summary
Axis2PortClientInterceptor()
           
 
Method Summary
 void afterPropertiesSet()
          Prepares the JAX-RPC service and port if the "lazyInit" isn't false.
 org.springframework.beans.factory.support.RootBeanDefinition cloneBeanDefinition()
           
 boolean getBase64Password()
          Gets the flag indicating whether or not the password given is in Base64.
 String getPassword()
          Return the password to connect to the service.
 String getPortAddress()
          Returns the port address (if not using a port address in the WSDL).
 Class getServiceInterface()
          Return the interface of the service that this factory should create a proxy for.
 long getTimeout()
          Gets the timeout of the client in seconds.
 String getUsername()
          Return the username to connect to the service.
 String getWsdlUrl()
          Returns the URL to the WSDL for the service.
 Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
          Translates the method invocation into a JAX-RPC service invocation.
 void prepare()
          Create and initialize the service for the specified WSDL.
 void setBase64Password(boolean base64Password)
          Sets a flag indicating whether or not the password given is in Base64.
 void setPassword(String password)
          Set the password to connect to the service.
 void setPortAddress(String portAddress)
          Sets the port address (if to use one other than the one in the WSDL).
 void setServiceInterface(Class serviceInterface)
          Set the interface of the service that this factory should create a proxy for.
 void setTimeout(long timeout)
          Sets the timeout of the client in seconds.
 void setTypeMapper(Class typeMapper)
          Sets the TypeMapper to use.
 void setUsername(String username)
          Set the username to connect to the service.
 void setWsdlUrl(String wsdlUrl)
          Sets the WSDL URL for the service.
 
Methods inherited from class org.springframework.beans.factory.support.RootBeanDefinition
equals, getDecoratedDefinition, getParentName, getResolvedFactoryMethod, isExternallyManagedConfigMember, isExternallyManagedDestroyMethod, isExternallyManagedInitMethod, isFactoryMethod, registerExternallyManagedConfigMember, registerExternallyManagedDestroyMethod, registerExternallyManagedInitMethod, setDecoratedDefinition, setParentName, setUniqueFactoryMethodName, toString
 
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
addQualifier, applyDefaults, clone, copyQualifiersFrom, getAutowireMode, getBeanClass, getBeanClassName, getConstructorArgumentValues, getDependencyCheck, getDependsOn, getDescription, getDestroyMethodName, getFactoryBeanName, getFactoryMethodName, getInitMethodName, getMethodOverrides, getOriginatingBeanDefinition, getPropertyValues, getQualifier, getQualifiers, getResolvedAutowireMode, getResource, getResourceDescription, getRole, getScope, hasBeanClass, hasConstructorArgumentValues, hashCode, hasQualifier, isAbstract, isAutowireCandidate, isEnforceDestroyMethod, isEnforceInitMethod, isLazyInit, isLenientConstructorResolution, isNonPublicAccessAllowed, isPrimary, isPrototype, isSingleton, isSynthetic, overrideFrom, overrideFrom, prepareMethodOverride, prepareMethodOverrides, resolveBeanClass, setAbstract, setAutowireCandidate, setAutowireMode, setBeanClass, setBeanClassName, setConstructorArgumentValues, setDependencyCheck, setDependsOn, setDescription, setDestroyMethodName, setEnforceDestroyMethod, setEnforceInitMethod, setFactoryBeanName, setFactoryMethodName, setInitMethodName, setLazyInit, setLenientConstructorResolution, setMethodOverrides, setNonPublicAccessAllowed, setOriginatingBeanDefinition, setPrimary, setPropertyValues, setResource, setResourceDescription, setRole, setScope, setSingleton, setSynthetic, validate
 
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource
 
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, hasAttribute
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
 
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource
 

Field Detail

logger

protected final Log logger
LogFactory.getLog(Axis2PortClientInterceptor.class)

Constructor Detail

Axis2PortClientInterceptor

public Axis2PortClientInterceptor()
Method Detail

setUsername

public void setUsername(String username)
Set the username to connect to the service.

Parameters:
username -

getUsername

public String getUsername()
Return the username to connect to the service.

Returns:
username

setPassword

public void setPassword(String password)
Set the password to connect to the service.

Parameters:
password -

getPassword

public String getPassword()
Return the password to connect to the service.

Returns:
password

setBase64Password

public void setBase64Password(boolean base64Password)
Sets a flag indicating whether or not the password given is in Base64.

Parameters:
base64Password - true/false

getBase64Password

public boolean getBase64Password()
Gets the flag indicating whether or not the password given is in Base64.

Returns:
true/false

setTimeout

public void setTimeout(long timeout)
Sets the timeout of the client in seconds.

Parameters:
timeout -

getTimeout

public long getTimeout()
Gets the timeout of the client in seconds.

Returns:
the timeout.

setServiceInterface

public void setServiceInterface(Class serviceInterface)
Set the interface of the service that this factory should create a proxy for.

Parameters:
serviceInterface -

getServiceInterface

public Class getServiceInterface()
Return the interface of the service that this factory should create a proxy for.

Returns:
serviceInterface

getWsdlUrl

public String getWsdlUrl()
Returns the URL to the WSDL for the service.

Returns:
the wsdlUrl

setWsdlUrl

public void setWsdlUrl(String wsdlUrl)
Sets the WSDL URL for the service.

Parameters:
wsdlUrl - the wsdlUrl to set

getPortAddress

public String getPortAddress()
Returns the port address (if not using a port address in the WSDL).

Returns:
the portAddress

setPortAddress

public void setPortAddress(String portAddress)
Sets the port address (if to use one other than the one in the WSDL).

Parameters:
portAddress - the portAddress to set

setTypeMapper

public void setTypeMapper(Class typeMapper)
                   throws InstantiationException,
                          IllegalAccessException
Sets the TypeMapper to use. It only makes sense to set this if you want to change the default type mapping behavoir.

Parameters:
typeMapper - the typeMapper to set
Throws:
IllegalAccessException
InstantiationException

afterPropertiesSet

public void afterPropertiesSet()
Prepares the JAX-RPC service and port if the "lazyInit" isn't false.

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

prepare

public void prepare()
Create and initialize the service for the specified WSDL.


invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
              throws Throwable
Translates the method invocation into a JAX-RPC service invocation. Uses traditional RMI stub invocation if a JAX-RPC port stub is available; falls back to JAX-RPC dynamic calls else.

Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Parameters:
invocation -
Returns:
invoked operation return
Throws:
Throwable
See Also:
WebServiceClient.invokeBlocking(String, Object[]), RmiClientInterceptorUtils

cloneBeanDefinition

public org.springframework.beans.factory.support.RootBeanDefinition cloneBeanDefinition()
Overrides:
cloneBeanDefinition in class org.springframework.beans.factory.support.RootBeanDefinition
See Also:
RootBeanDefinition.cloneBeanDefinition()


Copyright © 2003-2012 AndroMDA.org. All Rights Reserved.