[jboss-cvs] jboss-seam/src/main/org/jboss/seam/security/config ...
Shane Bryzak
Shane_Bryzak at symantec.com
Thu Dec 14 00:39:35 EST 2006
User: sbryzak2
Date: 06/12/14 00:39:35
Modified: src/main/org/jboss/seam/security/config
SecurityConfiguration.java
Log:
added @Startup to security components
Revision Changes Path
1.3 +11 -1 jboss-seam/src/main/org/jboss/seam/security/config/SecurityConfiguration.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SecurityConfiguration.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/config/SecurityConfiguration.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- SecurityConfiguration.java 13 Dec 2006 05:08:53 -0000 1.2
+++ SecurityConfiguration.java 14 Dec 2006 05:39:35 -0000 1.3
@@ -7,6 +7,8 @@
import java.util.Map;
import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
@@ -18,6 +20,7 @@
import org.jboss.seam.annotations.Intercept;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Startup;
import org.jboss.seam.security.Role;
import org.jboss.seam.security.SeamPermission;
import org.jboss.seam.util.Resources;
@@ -27,6 +30,7 @@
*
* @author Shane Bryzak
*/
+ at Startup
@Scope(APPLICATION)
@Name("org.jboss.seam.security.securityConfiguration")
@Install(value = false, precedence=BUILT_IN, dependencies = "org.jboss.seam.securityManager")
@@ -35,6 +39,8 @@
{
private static final String SECURITY_CONFIG_FILENAME = "/META-INF/security-config.xml";
+ private static final Log log = LogFactory.getLog(SecurityConfiguration.class);
+
// <security-constraint>
// private static final String SECURITY_CONSTRAINT = "security-constraint";
// private static final String WEB_RESOURCE_COLLECTION = "web-resource-collection";
@@ -77,7 +83,11 @@
public void init()
throws SecurityConfigException
{
- loadConfigFromStream(Resources.getResourceAsStream(SECURITY_CONFIG_FILENAME));
+ InputStream in = Resources.getResourceAsStream(SECURITY_CONFIG_FILENAME);
+ if (in != null)
+ loadConfigFromStream(in);
+ else
+ log.warn(String.format("Security configuration file %s not found", SECURITY_CONFIG_FILENAME));
}
/**
More information about the jboss-cvs-commits
mailing list