1 57 58 package org.apache.wsif.util; 59 60 import javax.naming.Context ; 61 import javax.naming.InitialContext ; 62 63 import org.apache.wsif.WSIFConstants; 64 import org.apache.wsif.WSIFCorrelationService; 65 import org.apache.wsif.base.WSIFDefaultCorrelationService; 66 import org.apache.wsif.logging.MessageLogger; 67 import org.apache.wsif.logging.Trc; 68 69 77 public class WSIFCorrelationServiceLocator { 78 79 private static WSIFCorrelationService correlationService = 80 findCorrelationService(); 81 82 89 static public WSIFCorrelationService getCorrelationService() { 90 Trc.entry(null); 91 Trc.exit(correlationService); 92 return correlationService; 93 } 94 95 static private WSIFCorrelationService findCorrelationService() { 96 Trc.entry(null); 97 WSIFCorrelationService cs = null; 98 ; 99 try { 100 Context ctx = new InitialContext (); 101 Object o = ctx.lookup(WSIFConstants.CORRELATION_SERVICE_NAMESPACE); 102 if (o != null && o instanceof WSIFCorrelationService) { 103 cs = (WSIFCorrelationService) o; 104 } 105 } catch (Exception ex) { 106 Trc.ignoredException(ex); 107 } finally { 108 if (cs == null) { 109 cs = new WSIFDefaultCorrelationService(); 110 } 111 } 112 113 MessageLogger.log("WSIF.0009I", cs.getClass().getName()); 114 115 Trc.exit(cs); 116 return cs; 117 } 118 } | Popular Tags |