1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.wsrp;
24  
25  import org.apache.wsrp4j.exception.WSRPException;
26  import org.apache.wsrp4j.producer.provider.DescriptionHandler;
27  import org.apache.wsrp4j.producer.provider.PortletInvoker;
28  import org.apache.wsrp4j.producer.provider.PortletPool;
29  import org.apache.wsrp4j.producer.provider.PortletRegistrationFilter;
30  import org.apache.wsrp4j.producer.provider.PortletRegistrationFilterWriter;
31  import org.apache.wsrp4j.producer.provider.PortletStateManager;
32  import org.apache.wsrp4j.producer.provider.Provider;
33  import org.apache.wsrp4j.producer.provider.URLComposer;
34  import org.apache.wsrp4j.producer.provider.driver.PortletRegistrationFilterImpl;
35  import org.apache.wsrp4j.producer.provider.driver.URLComposerImpl;
36  
37  /**
38   * <a href="ProviderImpl.java.html"><b><i>View Source</i></b></a>
39   *
40   * @author Michael Young
41   *
42   */
43  public class ProviderImpl implements Provider {
44  
45      public DescriptionHandler getDescriptionHandler() {
46          if (_descriptionHandler == null) {
47              _descriptionHandler = new DescriptionHandlerImpl();
48          }
49  
50          return _descriptionHandler;
51      }
52  
53      public PortletInvoker getPortletInvoker() {
54          if (_portletInvoker == null) {
55              _portletInvoker = new PortletInvokerImpl(this);
56          }
57  
58          return _portletInvoker;
59      }
60  
61      public PortletPool getPortletPool() {
62          if (_portletPool == null) {
63              _portletPool = new PortletPoolImpl();
64          }
65  
66          return _portletPool;
67      }
68  
69      public PortletRegistrationFilter getPortletRegistrationFilter() {
70          if (_portletRegistrationFilter == null) {
71              _portletRegistrationFilter =
72                  PortletRegistrationFilterImpl.createReader();
73          }
74  
75          return _portletRegistrationFilter;
76      }
77  
78      public PortletRegistrationFilterWriter getPortletRegistrationFilterWriter() {
79          if (_portletRegistrationFilterWriter == null) {
80              _portletRegistrationFilterWriter =
81                  PortletRegistrationFilterImpl.createWriter();
82          }
83  
84          return _portletRegistrationFilterWriter;
85      }
86  
87      public PortletStateManager getPortletStateManager()
88          throws WSRPException {
89          if (_portletStateManager == null) {
90              _portletStateManager = new PortletStateManagerImpl();
91          }
92  
93          return _portletStateManager;
94      }
95  
96      public URLComposer getURLComposer() {
97          if (_urlComposer == null) {
98              _urlComposer = URLComposerImpl.getInstance(this);
99          }
100 
101         return _urlComposer;
102     }
103 
104     private DescriptionHandler _descriptionHandler;
105     private PortletInvoker _portletInvoker;
106     private PortletPool _portletPool;
107     private PortletRegistrationFilter _portletRegistrationFilter;
108     private PortletRegistrationFilterWriter _portletRegistrationFilterWriter;
109     private PortletStateManager _portletStateManager;
110     private URLComposer _urlComposer;
111 
112 }