org.springframework.remoting.jaxws

Class JaxWsPortClientInterceptor

    • Constructor Detail

      • JaxWsPortClientInterceptor

        public JaxWsPortClientInterceptor()
    • Method Detail

      • getJaxWsService

        @Nullable
        public Service getJaxWsService()
        Return a reference to an existing JAX-WS Service instance, if any.
      • setPortName

        public void setPortName(@Nullable
                                java.lang.String portName)
        Set the name of the port. Corresponds to the "wsdl:port" name.
      • getPortName

        @Nullable
        public java.lang.String getPortName()
        Return the name of the port.
      • getUsername

        @Nullable
        public java.lang.String getUsername()
        Return the username to specify on the stub.
      • getPassword

        @Nullable
        public java.lang.String getPassword()
        Return the password to specify on the stub.
      • getEndpointAddress

        @Nullable
        public java.lang.String getEndpointAddress()
        Return the endpoint address to specify on the stub.
      • isMaintainSession

        public boolean isMaintainSession()
        Return the "session.maintain" flag to specify on the stub.
      • isUseSoapAction

        public boolean isUseSoapAction()
        Return the "soapaction.use" flag to specify on the stub.
      • getSoapActionUri

        @Nullable
        public java.lang.String getSoapActionUri()
        Return the SOAP action URI to specify on the stub.
      • setCustomProperties

        public void setCustomProperties(java.util.Map<java.lang.String,java.lang.Object> customProperties)
        Set custom properties to be set on the stub.

        Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.

        See Also:
        BindingProvider.getRequestContext()
      • getCustomProperties

        public java.util.Map<java.lang.String,java.lang.Object> getCustomProperties()
        Allow Map access to the custom properties to be set on the stub, with the option to add or override specific entries.

        Useful for specifying entries directly, for example via "customProperties[myKey]". This is particularly useful for adding or overriding entries in child bean definitions.

      • addCustomProperty

        public void addCustomProperty(java.lang.String name,
                                      java.lang.Object value)
        Add a custom property to this JAX-WS BindingProvider.
        Parameters:
        name - the name of the attribute to expose
        value - the attribute value to expose
        See Also:
        BindingProvider.getRequestContext()
      • setServiceInterface

        public void setServiceInterface(@Nullable
                                        java.lang.Class<?> serviceInterface)
        Set the interface of the service that this factory should create a proxy for.
      • getServiceInterface

        @Nullable
        public java.lang.Class<?> getServiceInterface()
        Return the interface of the service that this factory should create a proxy for.
      • setLookupServiceOnStartup

        public void setLookupServiceOnStartup(boolean lookupServiceOnStartup)
        Set whether to look up the JAX-WS service on startup.

        Default is "true". Turn this flag off to allow for late start of the target server. In this case, the JAX-WS service will be lazily fetched on first access.

      • getBeanClassLoader

        @Nullable
        protected java.lang.ClassLoader getBeanClassLoader()
        Return the bean ClassLoader to use for this interceptor.
      • afterPropertiesSet

        public void afterPropertiesSet()
        Description copied from interface: InitializingBean
        Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

        This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

        Specified by:
        afterPropertiesSet in interface InitializingBean
      • prepare

        public void prepare()
        Initialize the JAX-WS port for this interceptor.
      • applyDefaultsFromAnnotation

        protected void applyDefaultsFromAnnotation(WebService ann)
        Initialize this client interceptor's properties from the given WebService annotation, if necessary and possible (i.e. if "wsdlDocumentUrl", "namespaceUri", "serviceName" and "portName" haven't been set but corresponding values are declared at the annotation level of the specified service interface).
        Parameters:
        ann - the WebService annotation found on the specified service interface
      • isPrepared

        protected boolean isPrepared()
        Return whether this client interceptor has already been prepared, i.e. has already looked up the JAX-WS service and port.
      • getPortStub

        protected java.lang.Object getPortStub(Service service,
                                               @Nullable
                                               QName portQName)
        Obtain the port stub from the given JAX-WS Service.
        Parameters:
        service - the Service object to obtain the port from
        portQName - the name of the desired port, if specified
        Returns:
        the corresponding port object as returned from Service.getPort(...)
      • getPortStub

        @Nullable
        protected java.lang.Object getPortStub()
        Return the underlying JAX-WS port stub that this interceptor delegates to for each method invocation on the proxy.
      • invoke

        @Nullable
        public java.lang.Object invoke(MethodInvocation invocation)
                                          throws java.lang.Throwable
        Description copied from interface: MethodInterceptor
        Implement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invoke Joinpoint.proceed().
        Specified by:
        invoke in interface MethodInterceptor
        Parameters:
        invocation - the method invocation joinpoint
        Returns:
        the result of the call to Joinpoint.proceed(); might be intercepted by the interceptor
        Throws:
        java.lang.Throwable - if the interceptors or the target object throws an exception
      • doInvoke

        @Nullable
        protected java.lang.Object doInvoke(MethodInvocation invocation,
                                                      @Nullable
                                                      java.lang.Object portStub)
                                               throws java.lang.Throwable
        Perform a JAX-WS service invocation on the given port stub.
        Parameters:
        invocation - the AOP method invocation
        portStub - the RMI port stub to invoke
        Returns:
        the invocation result, if any
        Throws:
        java.lang.Throwable - in case of invocation failure
        See Also:
        getPortStub()