Improve performance of JBoss container adapter (thanks to Sergio Bern�).
This commit is contained in:
+50
-5
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
|
||||
<!--
|
||||
* ========================================================================
|
||||
*
|
||||
@@ -21,7 +20,6 @@
|
||||
*
|
||||
* ========================================================================
|
||||
-->
|
||||
|
||||
<book>
|
||||
<bookinfo>
|
||||
<title>Acegi Security System for Spring</title>
|
||||
@@ -2479,14 +2477,17 @@ $CATALINA_HOME/bin/startup.sh</programlisting></para>
|
||||
<sect2 id="security-container-adapters-joss">
|
||||
<title>JBoss Installation</title>
|
||||
|
||||
<para>The following was tested with JBoss 3.2.3. We automatically test
|
||||
<para>The following was tested with JBoss 3.2.6. We automatically test
|
||||
the following directions using our container integration test system
|
||||
and this version of JBoss.</para>
|
||||
|
||||
<para><literal>$JBOSS_HOME</literal> refers to the root of your JBoss
|
||||
installation.</para>
|
||||
|
||||
<para>Edit your
|
||||
<para>There are two different ways of making spring context available
|
||||
to the Jboss integration classes. </para>
|
||||
|
||||
<para>The first approach is by editing your
|
||||
<literal>$JBOSS_HOME/server/your_config/conf/login-config.xml</literal>
|
||||
file so that it contains a new entry under the
|
||||
<literal><Policy></literal> section:</para>
|
||||
@@ -2504,7 +2505,51 @@ $CATALINA_HOME/bin/startup.sh</programlisting></para>
|
||||
<para>Copy <literal>acegisecurity.xml</literal> into
|
||||
<literal>$JBOSS_HOME/server/your_config/conf</literal>.</para>
|
||||
|
||||
<para>Copy the following files into
|
||||
<para>In this configuration <literal>acegisecurity.xml</literal>
|
||||
contains the spring context definition including all the
|
||||
authentication manager beans. You have to bear in mind though, that
|
||||
<literal>SecurityContext</literal> is created and destroyed on each
|
||||
login request, so the login operation might become costly.
|
||||
Alternatively, the second approach is to use Spring singleton
|
||||
capabilities through
|
||||
<literal>org.springframework.beans.factory.access.SingletonBeanFactoryLocator</literal>.
|
||||
The required configuration for this approach is:</para>
|
||||
|
||||
<para><programlisting> <application-policy name = "SpringPoweredRealm">
|
||||
<authentication>
|
||||
<login-module code = "net.sf.acegisecurity.adapters.jboss.JbossSpringLoginModule"
|
||||
flag = "required">
|
||||
<module-option name = "singletonId">springRealm</module-option>
|
||||
<module-option name = "key">my_password</module-option>
|
||||
<module-option name = "authenticationManager">authenticationManager</module-option>
|
||||
</login-module>
|
||||
</authentication>
|
||||
</application-policy></programlisting></para>
|
||||
|
||||
<para>In the above code fragment,
|
||||
<literal>authenticationManager</literal> is a helper property that
|
||||
defines the expected name of the
|
||||
<literal>AuthenticationManager</literal> in case you have several
|
||||
defined in the IoC container. The <literal>singletonId</literal>
|
||||
property references a bean defined in a
|
||||
<literal>beanRefFactory.xml</literal> file. This file needs to be
|
||||
available from anywhere on the JBoss classpath, including
|
||||
<literal>$JBOSS_HOME/server/your_config/conf</literal>. The
|
||||
<literal>beanRefFactory.xml</literal> contains the following
|
||||
declaration:</para>
|
||||
|
||||
<para><programlisting><beans>
|
||||
<bean id="springRealm" singleton="true" lazy-init="true" class="org.springframework.context.support.ClassPathXmlApplicationContext">
|
||||
<constructor-arg>
|
||||
<list>
|
||||
<value>acegisecurity.xml</value>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</beans></programlisting></para>
|
||||
|
||||
<para>Finally, irrespective of the configuration approach you need to
|
||||
copy the following files into
|
||||
<literal>$JBOSS_HOME/server/your_config/lib</literal>:<itemizedlist>
|
||||
<listitem>
|
||||
<para><literal>aopalliance.jar</literal></para>
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<action dev="benalex" type="update">Improved BasicAclProvider to only respond to specified ACL object requests</action>
|
||||
<action dev="benalex" type="update">Refactored MethodDefinitionSource to work with Method, not MethodInvocation</action>
|
||||
<action dev="benalex" type="update">Refactored AbstractSecurityInterceptor to better support other AOP libraries</action>
|
||||
<action dev="benalex" type="update">Improved performance of JBoss container adapter (see reference docs)</action>
|
||||
<action dev="benalex" type="fix">Fixed AbstractProcessingFilter to use removeAttribute (JRun compatibility)</action>
|
||||
<action dev="benalex" type="fix">Fixed GrantedAuthorityEffectiveAclResolver support of UserDetails principals</action>
|
||||
<action dev="benalex" type="update">Moved MethodSecurityInterceptor to ...intercept.method.aopalliance package</action>
|
||||
|
||||
Reference in New Issue
Block a user