01: /**
02: * $Id: OSTasksFactory.java,v 1.4 2006/07/28 02:39:53 portalbld Exp $
03: * Copyright 2004 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.fabric.util.os;
14:
15: import com.sun.portal.admin.common.context.PSConfigContext;
16:
17: public class OSTasksFactory {
18:
19: protected static OSTasksFactory factory = new OSTasksFactory();
20:
21: public static OSTasksFactory getInstance() {
22: return factory;
23: }
24:
25: public static OSTasks getOSTasks(PSConfigContext context) {
26: OSTasks result = null;
27: String osName = System.getProperty("os.name");
28: if (osName.indexOf("indows") != -1) {
29: result = new WindowsTasks(context);
30: } else if (osName.indexOf("Linux") != -1) {
31: result = new LinuxTasks(context);
32: } else if (osName.indexOf("HP-UX") != -1) {
33: result = new HpuxTasks(context);
34: } else {
35: result = new SunOSTasks(context);
36: }
37: return result;
38: }
39:
40: }
|