1 23 package com.sun.enterprise.admin.wsmgmt.transform; 24 25 import com.sun.enterprise.admin.wsmgmt.config.spi.WebServiceConfig; 26 27 import java.util.logging.Logger ; 28 import java.util.logging.Level ; 29 import com.sun.logging.LogDomains; 30 import com.sun.enterprise.util.i18n.StringManager; 31 32 35 public class TransformMgr { 36 37 42 public static TransformMgr getInstance() { 43 if (_instance == null) { 44 _instance = new TransformMgr(); 45 } 46 47 return _instance; 48 } 49 50 53 private TransformMgr() { 54 } 55 56 59 public void init(String appId, WebServiceConfig wsc) { 60 if ( wsc == null) { 61 return; 62 } 63 64 try { 65 if ((wsc.getRequestTransformationRule() != null) || 67 (wsc.getResponseTransformationRule() != null)) { 68 TransformHandler tHandler = new TransformHandler(wsc, appId); 69 tHandler.registerFilter(wsc); 70 } 71 72 } catch (Exception e) { 73 String msg="Configuration initialization error."; 74 _logger.log(Level.FINE, msg, e); 75 } 76 } 77 78 81 public void stop(String appId, WebServiceConfig wsc) { 82 if ( wsc == null) { 83 return; 84 } 85 86 try { 87 if ((wsc.getRequestTransformationRule() != null) || 89 (wsc.getResponseTransformationRule() != null)) { 90 TransformHandler tHandler = new TransformHandler(wsc, appId); 91 tHandler.unregisterFilter(appId,wsc); 92 } 93 94 } catch (Exception e) { 95 String msg="Configuration initialization error."; 96 _logger.log(Level.FINE, msg, e); 97 } 98 } 99 100 private static TransformMgr _instance = null; 102 private static final Logger _logger = 103 Logger.getLogger(LogDomains.ADMIN_LOGGER); 104 private static final StringManager _stringMgr = 105 StringManager.getManager(TransformMgr.class); 106 107 } 108 | Popular Tags |