001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.wsrp;
022:
023: import org.apache.wsrp4j.exception.WSRPException;
024: import org.apache.wsrp4j.producer.provider.DescriptionHandler;
025: import org.apache.wsrp4j.producer.provider.PortletInvoker;
026: import org.apache.wsrp4j.producer.provider.PortletPool;
027: import org.apache.wsrp4j.producer.provider.PortletRegistrationFilter;
028: import org.apache.wsrp4j.producer.provider.PortletRegistrationFilterWriter;
029: import org.apache.wsrp4j.producer.provider.PortletStateManager;
030: import org.apache.wsrp4j.producer.provider.Provider;
031: import org.apache.wsrp4j.producer.provider.URLComposer;
032: import org.apache.wsrp4j.producer.provider.driver.PortletRegistrationFilterImpl;
033: import org.apache.wsrp4j.producer.provider.driver.URLComposerImpl;
034:
035: /**
036: * <a href="ProviderImpl.java.html"><b><i>View Source</i></b></a>
037: *
038: * @author Michael Young
039: *
040: */
041: public class ProviderImpl implements Provider {
042:
043: public DescriptionHandler getDescriptionHandler() {
044: if (_descriptionHandler == null) {
045: _descriptionHandler = new DescriptionHandlerImpl();
046: }
047:
048: return _descriptionHandler;
049: }
050:
051: public PortletInvoker getPortletInvoker() {
052: if (_portletInvoker == null) {
053: _portletInvoker = new PortletInvokerImpl(this );
054: }
055:
056: return _portletInvoker;
057: }
058:
059: public PortletPool getPortletPool() {
060: if (_portletPool == null) {
061: _portletPool = new PortletPoolImpl();
062: }
063:
064: return _portletPool;
065: }
066:
067: public PortletRegistrationFilter getPortletRegistrationFilter() {
068: if (_portletRegistrationFilter == null) {
069: _portletRegistrationFilter = PortletRegistrationFilterImpl
070: .createReader();
071: }
072:
073: return _portletRegistrationFilter;
074: }
075:
076: public PortletRegistrationFilterWriter getPortletRegistrationFilterWriter() {
077: if (_portletRegistrationFilterWriter == null) {
078: _portletRegistrationFilterWriter = PortletRegistrationFilterImpl
079: .createWriter();
080: }
081:
082: return _portletRegistrationFilterWriter;
083: }
084:
085: public PortletStateManager getPortletStateManager()
086: throws WSRPException {
087: if (_portletStateManager == null) {
088: _portletStateManager = new PortletStateManagerImpl();
089: }
090:
091: return _portletStateManager;
092: }
093:
094: public URLComposer getURLComposer() {
095: if (_urlComposer == null) {
096: _urlComposer = URLComposerImpl.getInstance(this );
097: }
098:
099: return _urlComposer;
100: }
101:
102: private DescriptionHandler _descriptionHandler;
103: private PortletInvoker _portletInvoker;
104: private PortletPool _portletPool;
105: private PortletRegistrationFilter _portletRegistrationFilter;
106: private PortletRegistrationFilterWriter _portletRegistrationFilterWriter;
107: private PortletStateManager _portletStateManager;
108: private URLComposer _urlComposer;
109:
110: }
|