View Javadoc
1   package org.andromda.cartridges.support.webservice.client;
2   
3   import org.springframework.aop.framework.ProxyFactory;
4   import org.springframework.beans.factory.FactoryBean;
5   
6   /**
7    * FactoryBean for a specific port of a webservice.
8    */
9   public class Axis2ProxyFactoryBean
10      extends Axis2PortClientInterceptor
11      implements FactoryBean
12  {
13      private static final long serialVersionUID = 34L;
14      private Object serviceProxy;
15  
16      /**
17       * @see org.andromda.cartridges.support.webservice.client.Axis2PortClientInterceptor#afterPropertiesSet()
18       */
19      public void afterPropertiesSet()
20      {
21          if (this.getServiceInterface() == null)
22          {
23              throw new IllegalArgumentException("serviceInterface is required");
24          }
25          if (this.getWsdlUrl() == null)
26          {
27              throw new IllegalArgumentException("WSDL URL is required");
28          }
29          super.afterPropertiesSet();
30          this.serviceProxy =
31              ProxyFactory.getProxy(
32                  getServiceInterface(),
33                  this);
34      }
35  
36      /**
37       * @see org.springframework.beans.factory.FactoryBean#getObject()
38       */
39      public Object getObject()
40      {
41          return this.serviceProxy;
42      }
43  
44      /**
45       * @see org.springframework.beans.factory.FactoryBean#getObjectType()
46       */
47      public Class getObjectType()
48      {
49          return getServiceInterface();
50      }
51  
52      /**
53       * @see org.springframework.beans.factory.FactoryBean#isSingleton()
54       */
55      public boolean isSingleton()
56      {
57          return true;
58      }
59  }