From portal-commits at lists.jboss.org Thu Jan 18 10:56:26 2007 Content-Type: multipart/mixed; boundary="===============8385582792771007524==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r6031 - in trunk: server/src/main/org/jboss/portal/server/impl/invocation and 1 other directory. Date: Thu, 18 Jan 2007 10:56:26 -0500 Message-ID: --===============8385582792771007524== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2007-01-18 10:56:25 -0500 (Thu, 18 Jan 2007) New Revision: 6031 Modified: trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBossInter= ceptorStack.java trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBossInter= ceptorStackFactory.java Log: - improved the impl of JBossInterceptorStackFactory - corrected issue in cms service wiring with the integration of identity in= terceptor in the server stack Modified: trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-servic= e.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml = 2007-01-18 13:05:47 UTC (rev 6030) +++ trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml = 2007-01-18 15:56:25 UTC (rev 6031) @@ -620,7 +620,7 @@ xmbean-code=3D"org.jboss.portal.jems.as.system.JBossServiceModelMBea= n"> portal:service=3DPort= alAuthorizationManagerFactory + optional-attribute-name=3D"InterceptorName">portal:service=3DInte= rceptor,type=3DServer,name=3DCMSIdentityBinding portal:service=3DInterce= ptorStackFactory,type=3DServer Modified: trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBo= ssInterceptorStack.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBossInte= rceptorStack.java 2007-01-18 13:05:47 UTC (rev 6030) +++ trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBossInte= rceptorStack.java 2007-01-18 15:56:25 UTC (rev 6031) @@ -33,8 +33,11 @@ { = /** . */ - protected Interceptor[] interceptors; + public static final InterceptorStack EMPTY_STACK =3D new JBossIntercept= orStack(new Interceptor[0]); = + /** . */ + private final Interceptor[] interceptors; + public JBossInterceptorStack(Interceptor[] interceptors) { if (interceptors =3D=3D null) Modified: trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBo= ssInterceptorStackFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBossInte= rceptorStackFactory.java 2007-01-18 13:05:47 UTC (rev 6030) +++ trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBossInte= rceptorStackFactory.java 2007-01-18 15:56:25 UTC (rev 6031) @@ -29,6 +29,8 @@ = import javax.management.ObjectName; import java.util.List; +import java.util.ArrayList; +import java.util.Collections; = /** * @author Julien Viet @@ -40,8 +42,20 @@ /** . */ protected List interceptorNames; = + /** . */ + protected List dynamicInterceptorNames; + + /** . */ protected InterceptorStack stack; = + + public JBossInterceptorStackFactory() + { + interceptorNames =3D null; + dynamicInterceptorNames =3D new ArrayList(); + stack =3D JBossInterceptorStack.EMPTY_STACK; + } + public List getInterceptorNames() { return interceptorNames; @@ -52,6 +66,11 @@ this.interceptorNames =3D interceptorNames; } = + public List getDynamicInterceptorNames() + { + return Collections.unmodifiableList(dynamicInterceptorNames); + } + public InterceptorStack getInterceptorStack() { return stack; @@ -65,7 +84,7 @@ */ public void addInterceptor(ObjectName name) throws Exception { - interceptorNames.add(name); + dynamicInterceptorNames.add(name); } = /** @@ -87,20 +106,33 @@ /** Rebuild the interceptor stack. */ public void rebuild() throws Exception { + List names =3D new ArrayList(); + + // if (interceptorNames !=3D null) { - Interceptor[] interceptors =3D new Interceptor[interceptorNames.s= ize()]; - for (int i =3D 0; i < interceptorNames.size(); i++) - { - ObjectName name =3D (ObjectName)interceptorNames.get(i); - interceptors[i] =3D (Interceptor)server.getAttribute(name, "In= terceptor"); - } - stack =3D new JBossInterceptorStack(interceptors); + names.addAll(interceptorNames); } + + // + names.addAll(dynamicInterceptorNames); + + // + log.debug("Building interceptor stack " + getName()); + Interceptor[] interceptors =3D new Interceptor[names.size()]; + for (int i =3D 0; i < names.size(); i++) + { + ObjectName name =3D (ObjectName)names.get(i); + log.debug("Adding interceptor " + name + " to the stack"); + interceptors[i] =3D (Interceptor)server.getAttribute(name, "Inter= ceptor"); + } + + // + stack =3D new JBossInterceptorStack(interceptors); } = public void stopService() { - this.stack =3D null; + this.stack =3D JBossInterceptorStack.EMPTY_STACK; } } --===============8385582792771007524==--