1 9 package org.jboss.portal.server.invocation.portal; 10 11 import java.util.ArrayList ; 12 import java.util.List ; 13 14 import org.jboss.portal.server.Portal; 15 import org.jboss.portal.server.PortalRequest; 16 import org.jboss.portal.server.PortalServer; 17 import org.jboss.portal.server.invocation.AttachmentKey; 18 import org.jboss.portal.server.invocation.Interceptor; 19 import org.jboss.portal.server.invocation.Invocation; 20 21 27 public class ViewInterceptor implements Interceptor 28 { 29 public Object invoke(Invocation invocation) 30 { 31 try 32 { 33 PortalRequest req = (PortalRequest)invocation.getAttachment(AttachmentKey.PORTAL_REQUEST); 35 PortalServer container = req.getServer(); 36 Portal portal = container.getDefaultPortal(); 37 38 List windows = new ArrayList (); 40 windows.addAll(portal.getWindows()); 41 42 invocation.setAttachment(AttachmentKey.VIEW, windows); 44 invocation.setAttachment(AttachmentKey.PORTAL, portal); 45 return invocation.invokeNext(); 46 } 47 finally 48 { 49 invocation.removeAttachment(AttachmentKey.VIEW); 50 } 51 } 52 } 53 | Popular Tags |