1 37 38 package com.sun.j2ee.blueprints.opc.webservicebroker.requestor; 39 40 import javax.naming.NamingException ; 41 import javax.naming.InitialContext ; 42 43 public class WSClientFactory { 44 45 public static WSClient getWSClient(String providerName) { 46 47 WSClient client = null; 48 try { 49 InitialContext ic = new InitialContext (); 50 String className = (String ) ic.lookup(providerName); 51 client = (WSClient) Class.forName(className).newInstance(); 52 } catch (NamingException ne) { 53 System.err.println(ne); 54 } catch (Exception se) { 55 System.err.println(se); 56 } 57 return client; 58 } 59 } 60 61 | Popular Tags |