abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r441334 - in /incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security: AbderaSecurity.java util/SecurityBase.java util/servlet/SignedResponseFilter.java xmlsec/XmlSecurityOptions.java
Date Fri, 08 Sep 2006 02:04:49 GMT
Author: jmsnell
Date: Thu Sep  7 19:04:48 2006
New Revision: 441334

URL: http://svn.apache.org/viewvc?view=rev&rev=441334
Log:
General code improvements

Modified:
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/AbderaSecurity.java
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/SecurityBase.java
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/SignedResponseFilter.java
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/xmlsec/XmlSecurityOptions.java

Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/AbderaSecurity.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/AbderaSecurity.java?view=diff&rev=441334&r1=441333&r2=441334
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/AbderaSecurity.java
(original)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/AbderaSecurity.java
Thu Sep  7 19:04:48 2006
@@ -23,20 +23,22 @@
 
 public class AbderaSecurity {
 
-  private Abdera abdera = null;
-  private Encryption encryption = null;
-  private Signature signature = null;
+  private final Abdera abdera;
+  private final Encryption encryption;
+  private final Signature signature;
   
   public AbderaSecurity() {
-    abdera = new Abdera();
+    this(new Abdera());
   }
   
   public AbderaSecurity(Abdera abdera) {
     this.abdera = abdera;
+    this.encryption = newEncryption();
+    this.signature = newSignature();
   }
   
   public AbderaSecurity(AbderaConfiguration config) {
-    this.abdera = new Abdera(config);
+    this(new Abdera(config));
   }
   
   private Abdera getAbdera() {
@@ -52,8 +54,6 @@
   }
   
   public Encryption getEncryption() {
-    if (encryption == null)
-      encryption = newEncryption();
     return encryption;
   }
   
@@ -66,8 +66,6 @@
   }
   
   public Signature getSignature() {
-    if (signature == null)
-      signature = newSignature();
     return signature;
   }
   

Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/SecurityBase.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/SecurityBase.java?view=diff&rev=441334&r1=441333&r2=441334
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/SecurityBase.java
(original)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/SecurityBase.java
Thu Sep  7 19:04:48 2006
@@ -33,7 +33,7 @@
 
 public abstract class SecurityBase {
   
-  protected Abdera abdera = null;
+  protected final Abdera abdera;
   
   protected SecurityBase(Abdera abdera) {
     this.abdera = abdera;

Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/SignedResponseFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/SignedResponseFilter.java?view=diff&rev=441334&r1=441333&r2=441334
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/SignedResponseFilter.java
(original)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/SignedResponseFilter.java
Thu Sep  7 19:04:48 2006
@@ -92,8 +92,8 @@
   
   private static final String keystoreType = "JKS";
   
-  private Abdera abdera = null;
-  private AbderaSecurity security = null;
+  private final Abdera abdera;
+  private final AbderaSecurity security;
   private String keystoreFile = null;
   private String keystorePass = null;
   private String privateKeyAlias = null;
@@ -102,6 +102,11 @@
   private PrivateKey signingKey = null;
   private X509Certificate cert = null;
 
+  public SignedResponseFilter() {
+    this.abdera = new Abdera();
+    this.security = new AbderaSecurity(abdera);
+  }
+  
   public void init(
     FilterConfig config) 
       throws ServletException {
@@ -110,8 +115,6 @@
     privateKeyAlias = config.getInitParameter(KEY);
     privateKeyPass = config.getInitParameter(KEYPASS);
     certificateAlias = config.getInitParameter(CERT);
-    abdera = new Abdera();
-    security = new AbderaSecurity(abdera);
     
     try {
       KeyStore ks = KeyStore.getInstance(keystoreType);    

Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/xmlsec/XmlSecurityOptions.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/xmlsec/XmlSecurityOptions.java?view=diff&rev=441334&r1=441333&r2=441334
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/xmlsec/XmlSecurityOptions.java
(original)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/xmlsec/XmlSecurityOptions.java
Thu Sep  7 19:04:48 2006
@@ -26,7 +26,7 @@
   implements SecurityOptions {
 
   protected Parser parser = null;
-  protected Abdera abdera = null;
+  protected final Abdera abdera;
   
   protected XmlSecurityOptions(Abdera abdera) {
     this.abdera = abdera;



Mime
View raw message