1 16 package org.apache.cocoon.portal.acting; 17 18 import java.util.Map ; 19 20 import org.apache.avalon.framework.parameters.Parameters; 21 import org.apache.avalon.framework.service.ServiceException; 22 import org.apache.avalon.framework.thread.ThreadSafe; 23 import org.apache.cocoon.ProcessingException; 24 import org.apache.cocoon.acting.ServiceableAction; 25 import org.apache.cocoon.environment.Redirector; 26 import org.apache.cocoon.environment.SourceResolver; 27 import org.apache.cocoon.portal.PortalService; 28 29 35 public final class LogoutAction 36 extends ServiceableAction 37 implements ThreadSafe { 38 39 42 public Map act(Redirector redirector, 43 SourceResolver resolver, 44 Map objectModel, 45 String source, 46 Parameters par) 47 throws Exception { 48 if (this.getLogger().isDebugEnabled() ) { 49 this.getLogger().debug("BEGIN act resolver="+resolver+ 50 ", objectModel="+objectModel+ 51 ", source="+source+ 52 ", par="+par); 53 } 54 55 PortalService service = null; 56 try { 57 service = (PortalService)this.manager.lookup(PortalService.ROLE); 58 service.getComponentManager().getProfileManager().logout(); 59 } catch (ServiceException ce) { 60 throw new ProcessingException("Unable to lookup portal service.", ce); 61 } finally { 62 this.manager.release(service); 63 } 64 65 if (this.getLogger().isDebugEnabled() ) { 66 this.getLogger().debug("END act map={}"); 67 } 68 69 return EMPTY_MAP; 70 } 71 72 } 73 | Popular Tags |