Author: dkulp
Date: Thu May 27 16:38:25 2010
New Revision: 948900
URL: http://svn.apache.org/viewvc?rev=948900&view=rev
Log:
Merged revisions 948586 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r948586 | dkulp | 2010-05-26 16:52:17 -0400 (Wed, 26 May 2010) | 1 line
[CXF-2803] Make sure the initialize method is only called once.
........
Modified:
cxf/branches/2.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=948900&r1=948899&r2=948900&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Thu May 27 16:38:25 2010
@@ -208,12 +208,15 @@ public class JAXBDataBinding extends Abs
private boolean unwrapJAXBElement = true;
private boolean qualifiedSchemas;
- private Service service;
- private List<Interceptor> in = new
ModCountCopyOnWriteArrayList<Interceptor>();
- private List<Interceptor> out = new
ModCountCopyOnWriteArrayList<Interceptor>();
- private List<Interceptor> outFault = new
ModCountCopyOnWriteArrayList<Interceptor>();
- private List<Interceptor> inFault = new
ModCountCopyOnWriteArrayList<Interceptor>();
+ private ModCountCopyOnWriteArrayList<Interceptor> in
+ = new ModCountCopyOnWriteArrayList<Interceptor>();
+ private ModCountCopyOnWriteArrayList<Interceptor> out
+ = new ModCountCopyOnWriteArrayList<Interceptor>();
+ private ModCountCopyOnWriteArrayList<Interceptor> outFault
+ = new ModCountCopyOnWriteArrayList<Interceptor>();
+ private ModCountCopyOnWriteArrayList<Interceptor> inFault
+ = new ModCountCopyOnWriteArrayList<Interceptor>();
public JAXBDataBinding() {
}
@@ -289,11 +292,10 @@ public class JAXBDataBinding extends Abs
}
@SuppressWarnings("unchecked")
- public void initialize(Service aservice) {
- this.service = aservice;
+ public synchronized void initialize(Service service) {
- getInInterceptors().add(JAXBAttachmentSchemaValidationHack.INSTANCE);
-
getInFaultInterceptors().add(JAXBAttachmentSchemaValidationHack.INSTANCE);
+ in.addIfAbsent(JAXBAttachmentSchemaValidationHack.INSTANCE);
+ inFault.addIfAbsent(JAXBAttachmentSchemaValidationHack.INSTANCE);
// context is already set, don't redo it
if (context != null) {
@@ -313,7 +315,7 @@ public class JAXBDataBinding extends Abs
}
- String tns = getNamespaceToUse();
+ String tns = getNamespaceToUse(service);
CachedContextAndSchemas cachedContextAndSchemas = null;
JAXBContext ctx = null;
try {
@@ -419,7 +421,7 @@ public class JAXBDataBinding extends Abs
}
}
- private String getNamespaceToUse() {
+ private String getNamespaceToUse(Service service) {
if
("true".equals(service.get("org.apache.cxf.databinding.namespace"))) {
return null;
}