86 core.marshal(context,adaptM(context,inMemory),result); |
86 core.marshal(context,adaptM(context,inMemory),result); |
87 } |
87 } |
88 |
88 |
89 private OnWire adaptM(Marshaller m,InMemory v) throws JAXBException { |
89 private OnWire adaptM(Marshaller m,InMemory v) throws JAXBException { |
90 XMLSerializer serializer = ((MarshallerImpl)m).serializer; |
90 XMLSerializer serializer = ((MarshallerImpl)m).serializer; |
91 serializer.setThreadAffinity(); |
|
92 serializer.pushCoordinator(); |
91 serializer.pushCoordinator(); |
93 try { |
92 try { |
94 return _adaptM(serializer, v); |
93 return _adaptM(serializer, v); |
95 } finally { |
94 } finally { |
96 serializer.popCoordinator(); |
95 serializer.popCoordinator(); |
97 serializer.resetThreadAffinity(); |
|
98 } |
96 } |
99 } |
97 } |
100 |
98 |
101 private OnWire _adaptM(XMLSerializer serializer, InMemory v) throws MarshalException { |
99 private OnWire _adaptM(XMLSerializer serializer, InMemory v) throws MarshalException { |
102 XmlAdapter<OnWire,InMemory> a = serializer.getAdapter(adapter); |
100 XmlAdapter<OnWire,InMemory> a = serializer.getAdapter(adapter); |
130 } |
128 } |
131 |
129 |
132 private @NotNull InMemory adaptU(Unmarshaller _u, OnWire v) throws JAXBException { |
130 private @NotNull InMemory adaptU(Unmarshaller _u, OnWire v) throws JAXBException { |
133 UnmarshallerImpl u = (UnmarshallerImpl) _u; |
131 UnmarshallerImpl u = (UnmarshallerImpl) _u; |
134 XmlAdapter<OnWire,InMemory> a = u.coordinator.getAdapter(adapter); |
132 XmlAdapter<OnWire,InMemory> a = u.coordinator.getAdapter(adapter); |
135 u.coordinator.setThreadAffinity(); |
|
136 u.coordinator.pushCoordinator(); |
133 u.coordinator.pushCoordinator(); |
137 try { |
134 try { |
138 return a.unmarshal(v); |
135 return a.unmarshal(v); |
139 } catch (Exception e) { |
136 } catch (Exception e) { |
140 throw new UnmarshalException(e); |
137 throw new UnmarshalException(e); |
141 } finally { |
138 } finally { |
142 u.coordinator.popCoordinator(); |
139 u.coordinator.popCoordinator(); |
143 u.coordinator.resetThreadAffinity(); |
|
144 } |
140 } |
145 } |
141 } |
146 |
142 |
147 void marshal(InMemory o, XMLSerializer out) throws IOException, SAXException, XMLStreamException { |
143 void marshal(InMemory o, XMLSerializer out) throws IOException, SAXException, XMLStreamException { |
148 try { |
144 try { |