View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.cxf.component;
8   
9   import org.mule.api.lifecycle.InitialisationException;
10  import org.mule.component.AbstractComponent;
11  import org.mule.config.i18n.CoreMessages;
12  
13  import org.apache.commons.logging.Log;
14  import org.apache.commons.logging.LogFactory;
15  
16  public abstract class AbstractWebServiceWrapperComponent extends AbstractComponent
17  {
18      protected transient Log logger = LogFactory.getLog(getClass());
19  
20      public static final String WS_SERVICE_URL = "ws.service.url";
21  
22      protected String address;
23      protected boolean addressFromMessage = false;
24  
25      protected void doInitialise() throws InitialisationException
26      {
27          if (address == null && !addressFromMessage)
28          {
29              throw new InitialisationException(CoreMessages.objectIsNull("webServiceUrl"), this);
30          }
31      }
32  
33      public String getAddress()
34      {
35          return address;
36      }
37  
38      public void setAddress(String address)
39      {
40          this.address = address;
41      }
42  
43      public boolean isAddressFromMessage()
44      {
45          return addressFromMessage;
46      }
47  
48      public void setAddressFromMessage(boolean addressFromMessage)
49      {
50          this.addressFromMessage = addressFromMessage;
51      }
52  
53  }