1 20 21 package org.jdesktop.jdic.desktop.internal.impl; 22 23 import org.jdesktop.jdic.desktop.internal.ServiceManager; 24 25 26 34 public class ServiceManagerStub { 35 36 39 private ServiceManagerStub() {} 40 41 53 public static Object getService(String serviceName) 54 throws IllegalArgumentException , UnsupportedOperationException { 55 if (serviceName.equals(ServiceManager.LAUNCH_SERVICE)) { 56 return new MacLaunchService(); 57 } else if (serviceName.equals(ServiceManager.BROWSER_SERVICE)) { 58 return new MacBrowserService(); 59 } else if (serviceName.equals(ServiceManager.MAILER_SERVICE)) { 60 return new MacMailerService(); 61 } else { 62 throw new IllegalArgumentException ( 64 "The requested service is not supported."); 65 } 66 } 67 } 68 | Popular Tags |