portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlest...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/containers security.container.groovy
Date Wed, 10 Mar 2004 06:08:05 GMT
dlestrat    2004/03/09 22:08:05

  Added:       components/security/src/java/org/apache/jetspeed/security/containers
                        security.container.groovy
  Log:
  Security component containers.
  
  Revision  Changes    Path
  1.1                  jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/containers/security.container.groovy
  
  Index: security.container.groovy
  ===================================================================
  import org.picocontainer.defaults.DefaultPicoContainer
  import org.picocontainer.Parameter
  import org.picocontainer.defaults.ConstantParameter
  import org.picocontainer.defaults.ComponentParameter
  import org.picocontainer.defaults.ConstructorComponentAdapter
  
  import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer
  
  import org.apache.jetspeed.security.SecurityProvider
  import org.apache.jetspeed.security.impl.SecurityProviderImpl
  import org.apache.jetspeed.security.impl.RdbmsPolicy
  import org.apache.jetspeed.security.UserManager
  import org.apache.jetspeed.security.impl.UserManagerImpl
  import org.apache.jetspeed.security.GroupManager
  import org.apache.jetspeed.security.impl.GroupManagerImpl
  import org.apache.jetspeed.security.RoleManager
  import org.apache.jetspeed.security.impl.RoleManagerImpl
  import org.apache.jetspeed.security.PermissionManager
  import org.apache.jetspeed.security.impl.PermissionManagerImpl
  
  
  import java.io.File
  
  /**
   * This is the standard assembly for a Security
   * component.  We want the Security component to be exposed
   * at as high the container hierarchy as possibly so, if a
   * parent container is provided, we will regsiter to the parent
   * and use it as the container for the Security.
   */
  
  // Prior to this, you will need to have an Implementation
  // of org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer
  // registered.
  if(parent != null)
  {
  	container = new DefaultPicoContainer(parent)
  	parent.registerComponentImplementation(UserManager, UserManagerImpl, new Parameter[] {new
ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed")} )
  	parent.registerComponentImplementation(GroupManager, GroupManagerImpl, new Parameter[]
{new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed")} )
  	parent.registerComponentImplementation(RoleManager, RoleManagerImpl, new Parameter[] {new
ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed")} )
  	parent.registerComponentImplementation(PermissionManager, PermissionManagerImpl, new Parameter[]
{new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed")} )
  	parent.registerComponentImplementation(RdbmsPolicy, RdbmsPolicy)
  	ComponentAdapter ca = new ConstructorComponentAdapter(SecurityProvider, SecurityProviderImpl,
new Parameter[] {new ConstantParameter("login.conf"), new ComponentParameter(RdbmsPolicy),
new ComponentParameter(UserManager)})
  	parent.registerComponent(ca)
  }
  else
  {
  	container = new DefaultPicoContainer()
      container.registerComponentImplementation(UserManager, UserManagerImpl, new Parameter[]
{new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed")} )
  	container.registerComponentImplementation(GroupManager, GroupManagerImpl, new Parameter[]
{new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed")} )
  	container.registerComponentImplementation(RoleManager, RoleManagerImpl, new Parameter[]
{new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed")} )
  	container.registerComponentImplementation(PermissionManager, PermissionManagerImpl, new
Parameter[] {new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed")}
)
  	ComponentAdapter ca = new ConstructorComponentAdapter(SecurityProvider, SecurityProviderImpl,
new Parameter[] {new ConstantParameter("login.conf"), new ComponentParameter(RdbmsPolicy),
new ComponentParameter(UserManager)})
  	container.registerComponent(ca)
  }	
  	
  // This will be an empty container if "parent" was not null
  return container
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message