[jboss-cvs] JBossAS SVN: r100313 - projects/security/picketbox/trunk/picketbox/src/main/java/org/picketbox/factories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 2 21:29:13 EST 2010


Author: anil.saldhana at jboss.com
Date: 2010-02-02 21:29:13 -0500 (Tue, 02 Feb 2010)
New Revision: 100313

Modified:
   projects/security/picketbox/trunk/picketbox/src/main/java/org/picketbox/factories/SecurityFactory.java
Log:
set the logger plugin

Modified: projects/security/picketbox/trunk/picketbox/src/main/java/org/picketbox/factories/SecurityFactory.java
===================================================================
--- projects/security/picketbox/trunk/picketbox/src/main/java/org/picketbox/factories/SecurityFactory.java	2010-02-03 02:28:43 UTC (rev 100312)
+++ projects/security/picketbox/trunk/picketbox/src/main/java/org/picketbox/factories/SecurityFactory.java	2010-02-03 02:29:13 UTC (rev 100313)
@@ -66,29 +66,52 @@
    
    private static StandaloneConfiguration standaloneConfiguration = StandaloneConfiguration.getInstance();
    
+   /**
+    * Get the {@code AuthenticationManager} interface
+    * @param securityDomain security domain such as "other"
+    * @return
+    */
    public static AuthenticationManager getAuthenticationManager(String securityDomain)
    {
       validate();
       return securityManagement.getAuthenticationManager(securityDomain);
    }
    
+   /**
+    * Get the {@code AuthorizationManager} interface
+    * @param securityDomain security domain such as "other"
+    * @return
+    */
    public static AuthorizationManager getAuthorizationManager(String securityDomain)
    {
       validate();
       return securityManagement.getAuthorizationManager(securityDomain);
    }
    
+   /**
+    * Get the {@code AuditManager} interface
+    * @param securityDomain security domain such as "other"
+    * @return
+    */
    public static AuditManager getAuditManager(String securityDomain)
    {
       validate();
       return securityManagement.getAuditManager(securityDomain);
    }
    
+   /**
+    * Get the {@code ISecurityManagement} interface  
+    * @return
+    */
    public static ISecurityManagement getSecurityManagement()
    {
       return securityManagement;
    }
    
+   /**
+    * Set {@code ISecurityManagement}
+    * @param iSecurityManagement
+    */
    public static void setSecurityManagement(ISecurityManagement iSecurityManagement)
    {
       securityManagement = iSecurityManagement;
@@ -107,9 +130,47 @@
          standaloneConfiguration.setParentConfig(parentConfiguration);
          Configuration.setConfiguration(standaloneConfiguration);
       }
+      setLog4JLogger();
    }
    
    /**
+    * <p>
+    * Set the Log4J logger Plugin on the system property
+    * <b>org.jboss.logging.Logger.pluginClass</b>
+    * This is the default behavior of the {@code SecurityFactory#prepare()} method
+    * </p>
+    * <p>
+    * <b>Note:</b> If the system property is already set, there is no change in the system property. 
+    * </p>
+    */ 
+   public static void setLog4JLogger()
+   { 
+      String loggerPluginClass = SecurityActions.getSystemProperty("org.jboss.logging.Logger.pluginClass", "");
+      if(loggerPluginClass.length() < 1)
+         SecurityActions.setSystemProperty("org.jboss.logging.Logger.pluginClass", "org.jboss.logging.log4j.Log4jLoggerPlugin");
+   }
+   
+   /**
+    * <p>
+    * Set the JDK logger Plugin on the system property
+    * <b>org.jboss.logging.Logger.pluginClass</b> 
+    * </p>
+    * <p>
+    * <b>Note:</b> If the system property is already set, there is no change in the system property. Also
+    * you will need to provide logging.properties
+    * </p>
+    */ 
+   public static void setJDKLogger()
+   { 
+      String loggerPluginClass = SecurityActions.getSystemProperty("org.jboss.logging.Logger.pluginClass", "");
+      if(loggerPluginClass.length() < 1)
+      {
+         SecurityActions.setSystemProperty("org.jboss.logging.Logger.pluginClass", "org.jboss.logging.jdk.JDK14LoggerPlugin");
+         SecurityActions.setSystemProperty("java.util.logging.config.file=logging.properties", "logging.properties");
+      }  
+   }
+   
+   /**
     * Will release anything that was done during {@link #prepare()} step
     */
    public static void release()




More information about the jboss-cvs-commits mailing list