Policy Registration Factory
A JNDI ObjectFactory for a PolicyRegistration. This is a work around for SECURITY-864.
This uses deprecated API that is likely going away with Elytron.
Two classes are offered
- com.github.marschall.policyregistrationfactory.EmptyPolicyRegistrationObjectFactory
-
Creates a PolicyRegistration that always throws an UnsupportedOperationException. Useful for cases when a
PolicyRegistration
is not needed but a lookup happens anyway. - com.github.marschall.policyregistrationfactory.JBossPolicyRegistrationObjectFactory
- Creates a new JBossPolicyRegistration.
Installation
You need to create a JBoss module
- put the jar in a
${JBOSS_HOME}/modules/system/layers/base/com/github/marschall/policyregistrationfactory/main
folder (or whatever your distribution layer is) - add a module.xml to the folder into which you put the jar, you can take the one from the root of the JAR
- configure the object factory and bind it to a name
For EmptyPolicyRegistrationObjectFactory
add the following to your server configuration (eg. standalone.xml
)
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
<object-factory
name="java:/policyRegistration"
module="com.github.marschall.policyregistrationfactory"
class="com.github.marschall.policyregistrationfactory.EmptyPolicyRegistrationObjectFactory"/>
</bindings>
</subsystem>
For JBossPolicyRegistrationObjectFactory
add the following to your server configuration (eg. standalone.xml
)
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
<object-factory
name="java:/policyRegistration"
module="com.github.marschall.policyregistrationfactory"
class="com.github.marschall.policyregistrationfactory.JBossPolicyRegistrationObjectFactory"/>
</bindings>
</subsystem>