1 23 24 25 package com.sun.enterprise.webservice.monitoring; 26 27 import java.security.Principal ; 28 import java.util.logging.Logger ; 29 import java.util.logging.Level ; 30 import javax.enterprise.deploy.shared.ModuleType ; 31 32 import com.sun.logging.LogDomains; 33 import com.sun.enterprise.deployment.BundleDescriptor; 34 35 40 public class LogAuthenticationListener implements AuthenticationListener { 41 42 private static Logger ejbLogger 43 = LogDomains.getLogger(LogDomains.EJB_LOGGER); 44 private static Logger webLogger 45 = LogDomains.getLogger(LogDomains.WEB_LOGGER); 46 47 48 49 public LogAuthenticationListener() { 50 } 51 52 56 public void authSucess(BundleDescriptor bundleDesc, Endpoint endpoint, Principal principal) { 57 if (ModuleType.EJB.equals(bundleDesc.getModuleType())) { 58 if (ejbLogger.isLoggable(Level.FINER)) { 59 ejbLogger.finer("LOG LISTENER : authentication succeeded for " 60 + endpoint.getEndpointSelector()); 61 } 62 } else { 63 if (webLogger.isLoggable(Level.FINER)) { 64 webLogger.finer("authentication succeeded for endpoint in " + 65 bundleDesc.getModuleID() + " web app"); 66 } 67 } 68 } 69 70 75 public void authFailure(BundleDescriptor bundleDesc, Endpoint endpoint, Principal principal) { 76 if (ModuleType.EJB.equals(bundleDesc.getModuleType())) { 77 if (ejbLogger.isLoggable(Level.FINE)) { 78 ejbLogger.fine("authentication failure for " 79 + endpoint.getEndpointSelector()); 80 } 81 } else { 82 if (webLogger.isLoggable(Level.FINE)) { 83 webLogger.fine("authentication failure for endpoint in " + 84 bundleDesc.getModuleID() + " web app"); 85 } 86 } 87 } 88 } 89 | Popular Tags |