Hi Andy,

 

Making your method synchronized should take care of thread safety issues.

 

Kind regards,

Pim

 

From: Andy [mailto:andrh...@hotmail.com] 
Sent: zaterdag 4 december 2010 22:08
To: user@xmlbeans.apache.org
Subject: Thread-safety question

 

Hi, I have a method below that unmarshals an input stream and since I will
have many concurrent invocations of this method, I was wondering if there
would be any Thread-safety issues?  I'm not a threading expert but just
wanted to make sure the XmlObject.Factory.parse() method wouldn't cause any
issues.

 

    protected final Object unmarshalInputStream(InputStream inputStream)
throws XmlMappingException, IOException {

        try {

            XmlObject object = XmlObject.Factory.parse(inputStream,
getXmlOptions());

            validate(object);

            return object;

        }

        catch (XmlException ex) {

            throw convertXmlBeansException(ex, false);

        }

    }

 

 

Thanks-

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to