1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.wsrp;
21  
22  import org.apache.wsrp4j.exception.WSRPException;
23  import org.apache.wsrp4j.producer.provider.DescriptionHandler;
24  import org.apache.wsrp4j.producer.provider.PortletInvoker;
25  import org.apache.wsrp4j.producer.provider.PortletPool;
26  import org.apache.wsrp4j.producer.provider.PortletRegistrationFilter;
27  import org.apache.wsrp4j.producer.provider.PortletRegistrationFilterWriter;
28  import org.apache.wsrp4j.producer.provider.PortletStateManager;
29  import org.apache.wsrp4j.producer.provider.Provider;
30  import org.apache.wsrp4j.producer.provider.URLComposer;
31  import org.apache.wsrp4j.producer.provider.driver.PortletRegistrationFilterImpl;
32  import org.apache.wsrp4j.producer.provider.driver.URLComposerImpl;
33  
34  /**
35   * <a href="ProviderImpl.java.html"><b><i>View Source</i></b></a>
36   *
37   * @author Michael Young
38   *
39   */
40  public class ProviderImpl implements Provider {
41  
42      public DescriptionHandler getDescriptionHandler() {
43          if (_descriptionHandler == null) {
44              _descriptionHandler = new DescriptionHandlerImpl();
45          }
46  
47          return _descriptionHandler;
48      }
49  
50      public PortletInvoker getPortletInvoker() {
51          if (_portletInvoker == null) {
52              _portletInvoker = new PortletInvokerImpl(this);
53          }
54  
55          return _portletInvoker;
56      }
57  
58      public PortletPool getPortletPool() {
59          if (_portletPool == null) {
60              _portletPool = new PortletPoolImpl();
61          }
62  
63          return _portletPool;
64      }
65  
66      public PortletRegistrationFilter getPortletRegistrationFilter() {
67          if (_portletRegistrationFilter == null) {
68              _portletRegistrationFilter =
69                  PortletRegistrationFilterImpl.createReader();
70          }
71  
72          return _portletRegistrationFilter;
73      }
74  
75      public PortletRegistrationFilterWriter getPortletRegistrationFilterWriter() {
76          if (_portletRegistrationFilterWriter == null) {
77              _portletRegistrationFilterWriter =
78                  PortletRegistrationFilterImpl.createWriter();
79          }
80  
81          return _portletRegistrationFilterWriter;
82      }
83  
84      public PortletStateManager getPortletStateManager()
85          throws WSRPException {
86          if (_portletStateManager == null) {
87              _portletStateManager = new PortletStateManagerImpl();
88          }
89  
90          return _portletStateManager;
91      }
92  
93      public URLComposer getURLComposer() {
94          if (_urlComposer == null) {
95              _urlComposer = URLComposerImpl.getInstance(this);
96          }
97  
98          return _urlComposer;
99      }
100 
101     private DescriptionHandler _descriptionHandler;
102     private PortletInvoker _portletInvoker;
103     private PortletPool _portletPool;
104     private PortletRegistrationFilter _portletRegistrationFilter;
105     private PortletRegistrationFilterWriter _portletRegistrationFilterWriter;
106     private PortletStateManager _portletStateManager;
107     private URLComposer _urlComposer;
108 
109 }