01: /**
02: * $Id: PortletServiceFactory.java,v 1.3 2005/04/29 03:07:50 mjain Exp $
03: * Copyright 2005 Sun Microsystems, Inc. All
04: * rights reserved. Use of this product is subject
05: * to license terms. Federal Acquisitions:
06: * Commercial Software -- Government Users
07: * Subject to Standard License Terms and
08: * Conditions.
09: *
10: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
11: * are trademarks or registered trademarks of Sun Microsystems,
12: * Inc. in the United States and other countries.
13: */package com.sun.portal.service.portlet;
14:
15: import com.sun.portal.service.Service;
16: import com.sun.portal.service.portlet.PortletService;
17: import com.sun.portal.service.common.ServiceConfig;
18:
19: /**
20: *
21: * @author mjain
22: */
23: public class PortletServiceFactory {
24:
25: private static PortletServiceFactory _instance;
26: private static String _portletServiceClass;
27:
28: public static void init() {
29:
30: _instance = new PortletServiceFactory();
31: ServiceConfig config = ServiceConfig.getInstance();
32: _portletServiceClass = config.getPortletServiceClassname();
33:
34: }
35:
36: public static PortletService instantiatePortletService() {
37: try {
38: PortletService service = (PortletService) (Class
39: .forName(_portletServiceClass).newInstance());
40:
41: return service;
42: } catch (Exception ex) {
43: throw new AssertionError(
44: "Portlet Service object not created");
45: }
46:
47: }
48: }
|