1 15 16 package com.jdon.bussinessproxy; 17 18 import com.jdon.util.Debug; 19 import com.jdon.bussinessproxy.remote.auth.AuthException; 20 import com.jdon.bussinessproxy.remote.http.HttpServerParam; 21 27 public abstract class ServiceClientFactory { 28 29 private final static String module = ServiceClientFactory.class.getName(); 30 31 private static Object initLock = new Object (); 32 private static String className = 33 "com.jdon.bussinessproxy.remote.ServiceHTTPImp"; 34 private static ServiceClientFactory factory = null; 35 36 public static ServiceClientFactory getInstance() { 37 if (factory == null) { 38 synchronized (initLock) { 39 if (factory == null) { 40 try { 41 Class c = Class.forName(className); 43 factory = (ServiceClientFactory) c.newInstance(); 44 } catch (Exception e) { 45 Debug.logError("[JdonFramework] get factory instance error:" + e, module); 46 return null; 47 } 48 } 49 } 50 } 51 return factory; 52 } 53 54 public abstract void setHttpServerParam(HttpServerParam httpServerParam); 55 56 public abstract String login(String loginName, String password) throws AuthException; 57 58 public abstract Object getService(TargetMetaDef targetMetaDef); 59 60 61 62 63 } 64 | Popular Tags |