org.jboss.security.plugins
Class SecurityConfig

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.security.plugins.SecurityConfig
All Implemented Interfaces:
MBeanRegistration, NotificationBroadcaster, NotificationEmitter, org.jboss.kernel.spi.dependency.KernelControllerContextAware, SecurityConfigMBean, Service, ServiceMBean

public class SecurityConfig
extends ServiceMBeanSupport
implements SecurityConfigMBean

The SecurityConfigMBean implementation. This class needs the javax.security.auth.AuthPermission("setLoginConfiguration") to install the javax.security.auth.login.Configuration when running with a security manager.

Version:
$Revision: 85945 $
Author:
Scott.Stark@jboss.org

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
SecurityConfig()
           
 
Method Summary
 XMLLoginConfig getDefaultLoginConfig()
           Obtains a reference to the default login configuration bean.
 String getLoginConfig()
          Get the name of the mbean that provides the default JAAS login configuration
 MBeanServer getMbeanServer()
           Obtains a reference to the MBeanServer instance.
 String getName()
           
 void popLoginConfig()
          Pop the current mbean from the login configuration stack and install the previous Configuration as the current instance.
 void pushLoginConfig(String objectName)
          Push an mbean onto the login configuration stack and install its Configuration as the current instance.
 void pushLoginConfig(XMLLoginConfig loginConfig)
           Push the configuration obtained from the specified XMLLoginConfig onto the stack.
 void setDefaultLoginConfig(XMLLoginConfig defaultLoginConfig)
           Injects the default login configuration bean.
 void setLoginConfig(String name)
          Set the name of the mbean that provides the default JAAS login configuration
 void setMbeanServer(MBeanServer server)
           Injects the MBeanServer instance that must be used by this class.
 void startService()
          Start the configuration service by pushing the mbean given by the LoginConfig onto the configuration stack.
 void stopService()
          Stop the configuration service by poping the top of the configuration stack.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getDeploymentInfo, getLog, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, start, stop, unsetKernelControllerContext
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, 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.system.ServiceMBean
getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

SecurityConfig

public SecurityConfig()
Method Detail

getLoginConfig

public String getLoginConfig()
Get the name of the mbean that provides the default JAAS login configuration

Specified by:
getLoginConfig in interface SecurityConfigMBean

setLoginConfig

public void setLoginConfig(String name)
                    throws MalformedObjectNameException
Set the name of the mbean that provides the default JAAS login configuration

Specified by:
setLoginConfig in interface SecurityConfigMBean
Throws:
MalformedObjectNameException

getMbeanServer

public MBeanServer getMbeanServer()

Obtains a reference to the MBeanServer instance.

Returns:
the MBeanServer that has been injected into this class.

setMbeanServer

public void setMbeanServer(MBeanServer server)

Injects the MBeanServer instance that must be used by this class.

Parameters:
server - a reference to the MBeanServer to be used.

getDefaultLoginConfig

public XMLLoginConfig getDefaultLoginConfig()

Obtains a reference to the default login configuration bean.

Returns:
a reference to the default login configuration bean.

setDefaultLoginConfig

public void setDefaultLoginConfig(XMLLoginConfig defaultLoginConfig)

Injects the default login configuration bean.

Parameters:
defaulLoginConfig - a reference to the login configuration bean to be used.

startService

public void startService()
                  throws Exception
Start the configuration service by pushing the mbean given by the LoginConfig onto the configuration stack.

Overrides:
startService in class ServiceMBeanSupport
Throws:
Exception

stopService

public void stopService()
                 throws Exception
Stop the configuration service by poping the top of the configuration stack.

Overrides:
stopService in class ServiceMBeanSupport
Throws:
Exception

pushLoginConfig

public void pushLoginConfig(XMLLoginConfig loginConfig)

Push the configuration obtained from the specified XMLLoginConfig onto the stack.

Parameters:
loginConfig - a reference to the XMLLoginConfig instance.

pushLoginConfig

public void pushLoginConfig(String objectName)
                     throws JMException,
                            MalformedObjectNameException
Push an mbean onto the login configuration stack and install its Configuration as the current instance.

Specified by:
pushLoginConfig in interface SecurityConfigMBean
Throws:
JMException
MalformedObjectNameException
See Also:
Configuration

popLoginConfig

public void popLoginConfig()
                    throws JMException
Pop the current mbean from the login configuration stack and install the previous Configuration as the current instance.

Specified by:
popLoginConfig in interface SecurityConfigMBean
Throws:
JMException
See Also:
Configuration

getName

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


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.