cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1311932 - /cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
Date Tue, 10 Apr 2012 19:08:38 GMT
Author: coheigea
Date: Tue Apr 10 19:08:38 2012
New Revision: 1311932

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

Modified:
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java?rev=1311932&r1=1311931&r2=1311932&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
Tue Apr 10 19:08:38 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.ReceivedToken.STATE;
 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;
 
@@ -134,8 +139,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