cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1324805 - /cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
Date Wed, 11 Apr 2012 15:09:57 GMT
Author: coheigea
Date: Wed Apr 11 15:09:56 2012
New Revision: 1324805

URL: http://svn.apache.org/viewvc?rev=1324805&view=rev
Log:
JAXB update for UsernameTokenValidator

Modified:
    cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java

Modified: cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java?rev=1324805&r1=1324804&r2=1324805&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
(original)
+++ cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
Wed Apr 11 15:09:56 2012
@@ -19,7 +19,9 @@
 package org.apache.cxf.sts.token.validator;
 
 import java.security.Principal;
+import java.util.HashSet;
 import java.util.Properties;
+import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -32,6 +34,8 @@ import javax.xml.bind.Marshaller;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
+import org.apache.cxf.common.jaxb.JAXBContextCache;
+import org.apache.cxf.common.jaxb.JAXBContextCache.CachedContextAndSchemas;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.sts.QNameConstants;
@@ -41,6 +45,7 @@ import org.apache.cxf.sts.request.Receiv
 import org.apache.cxf.sts.request.TokenRequirements;
 import org.apache.cxf.sts.token.realm.UsernameTokenRealmCodec;
 
+import org.apache.cxf.ws.security.sts.provider.model.ObjectFactory;
 import org.apache.cxf.ws.security.sts.provider.model.secext.UsernameTokenType;
 import org.apache.cxf.ws.security.tokenstore.SecurityToken;
 
@@ -139,8 +144,14 @@ public class UsernameTokenValidator impl
         // Marshall the received JAXB object into a DOM Element
         Element usernameTokenElement = null;
         try {
-            JAXBContext jaxbContext = 
-                JAXBContext.newInstance("org.apache.cxf.ws.security.sts.provider.model");
+            Set<Class<?>> classes = new HashSet<Class<?>>();
+            classes.add(ObjectFactory.class);
+            classes.add(org.apache.cxf.ws.security.sts.provider.model.wstrust14.ObjectFactory.class);
+                    
+            CachedContextAndSchemas cache = 
+                JAXBContextCache.getCachedContextAndSchemas(classes, null, null, null, false);
+            JAXBContext jaxbContext = cache.getContext();
+            
             Marshaller marshaller = jaxbContext.createMarshaller();
             Document doc = DOMUtils.createDocument();
             Element rootElement = doc.createElement("root-element");



Mime
View raw message