org.jboss.security.plugins
Class JaasSecurityManagerService

java.lang.Object
  |
  +--javax.management.NotificationBroadcasterSupport
        |
        +--org.jboss.util.ServiceMBeanSupport
              |
              +--org.jboss.security.plugins.JaasSecurityManagerService
All Implemented Interfaces:
JaasSecurityManagerServiceMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.naming.spi.ObjectFactory, Service, ServiceMBean

public class JaasSecurityManagerService
extends ServiceMBeanSupport
implements JaasSecurityManagerServiceMBean, javax.naming.spi.ObjectFactory

This is a JMX service which manages JAAS based SecurityManagers. JAAS SecurityManagers are responsible for validating credentials associated with principals. The service defaults to the org.jboss.security.plugins.JaasSecurityManager implementation but this can be changed via the securityManagerClass property.

Author:
Oleg Nitz, Rickard Oberg, Scott Stark
See Also:
JaasSecurityManager, SubjectSecurityManager

Fields inherited from class org.jboss.util.ServiceMBeanSupport
log, STARTED, STARTING, states, STOPPED, STOPPING
 
Fields inherited from interface org.jboss.security.plugins.JaasSecurityManagerServiceMBean
OBJECT_NAME
 
Constructor Summary
JaasSecurityManagerService()
           
 
Method Summary
 java.lang.String getAuthenticationCacheJndiName()
          Get the jndi name under which the authentication cache policy is found
 java.lang.String getName()
           
 java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable environment)
          Object factory implementation.
protected  javax.management.ObjectName getObjectName(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 java.lang.String getSecurityManagerClassName()
          Get the name of the class that provides the security manager implementation.
 java.lang.String getSecurityProxyFactoryClassName()
          Get the name of the class that provides the SecurityProxyFactory implementation.
 void setAuthenticationCacheJndiName(java.lang.String jndiName)
          Set the jndi name under which the authentication cache policy is found
 void setSecurityManagerClassName(java.lang.String className)
          Set the name of the class that provides the security manager implementation.
 void setSecurityProxyFactoryClassName(java.lang.String className)
          Set the name of the class that provides the SecurityProxyFactory implementation.
protected  void startService()
           
protected  void stopService()
           
 
Methods inherited from class org.jboss.util.ServiceMBeanSupport
destroy, destroyService, getState, getStateString, init, initService, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.util.ServiceMBean
getState, getStateString
 
Methods inherited from interface org.jboss.util.Service
destroy, init, start, stop
 

Constructor Detail

JaasSecurityManagerService

public JaasSecurityManagerService()
Method Detail

getSecurityManagerClassName

public java.lang.String getSecurityManagerClassName()
Description copied from interface: JaasSecurityManagerServiceMBean
Get the name of the class that provides the security manager implementation.
Specified by:
getSecurityManagerClassName in interface JaasSecurityManagerServiceMBean

setSecurityManagerClassName

public void setSecurityManagerClassName(java.lang.String className)
                                 throws java.lang.ClassNotFoundException
Description copied from interface: JaasSecurityManagerServiceMBean
Set the name of the class that provides the security manager implementation.
Specified by:
setSecurityManagerClassName in interface JaasSecurityManagerServiceMBean

getSecurityProxyFactoryClassName

public java.lang.String getSecurityProxyFactoryClassName()
Description copied from interface: JaasSecurityManagerServiceMBean
Get the name of the class that provides the SecurityProxyFactory implementation.
Specified by:
getSecurityProxyFactoryClassName in interface JaasSecurityManagerServiceMBean

setSecurityProxyFactoryClassName

public void setSecurityProxyFactoryClassName(java.lang.String className)
                                      throws java.lang.ClassNotFoundException
Description copied from interface: JaasSecurityManagerServiceMBean
Set the name of the class that provides the SecurityProxyFactory implementation.
Specified by:
setSecurityProxyFactoryClassName in interface JaasSecurityManagerServiceMBean

getAuthenticationCacheJndiName

public java.lang.String getAuthenticationCacheJndiName()
Get the jndi name under which the authentication cache policy is found
Specified by:
getAuthenticationCacheJndiName in interface JaasSecurityManagerServiceMBean

setAuthenticationCacheJndiName

public void setAuthenticationCacheJndiName(java.lang.String jndiName)
Set the jndi name under which the authentication cache policy is found
Specified by:
setAuthenticationCacheJndiName in interface JaasSecurityManagerServiceMBean

getName

public java.lang.String getName()
Specified by:
getName in interface ServiceMBean
Overrides:
getName in class ServiceMBeanSupport

getObjectName

protected javax.management.ObjectName getObjectName(javax.management.MBeanServer server,
                                                    javax.management.ObjectName name)
                                             throws javax.management.MalformedObjectNameException
Overrides:
getObjectName in class ServiceMBeanSupport

startService

protected void startService()
                     throws java.lang.Exception
Overrides:
startService in class ServiceMBeanSupport

stopService

protected void stopService()
Overrides:
stopService in class ServiceMBeanSupport

getObjectInstance

public java.lang.Object getObjectInstance(java.lang.Object obj,
                                          javax.naming.Name name,
                                          javax.naming.Context nameCtx,
                                          java.util.Hashtable environment)
                                   throws java.lang.Exception
Object factory implementation. This method is a bit tricky as it is called twice for each JSM lookup. Let's say the lookup is for "java:jaas/MySecurity". Then this will first be called as JNDI starts the "jaas" federation. In that call we make sure that the next call will go through, i.e. we check that the "MySecurity" binding is availble. Then we return the implementation of the "jaas" context. Then, when the "MySecurity" is dereferenced we look up the JSM from an internal static hash table. Note: it is possible to break this by doing the lookup in two phases: first lookup "java:jaas" and then do a second lookup of "MySecurity". If that is done then the first lookup has no way of knowing what name to check (i.e. it can't make sure that "MySecurity" is available in the "java:jaas" context!
Specified by:
getObjectInstance in interface javax.naming.spi.ObjectFactory
Parameters:
obj -  
name -  
nameCtx -  
environment -  
Returns:
 
Throws:
java.lang.Exception -  


Copyright © 2000 The JBoss Organization. All Rights Reserved.