final Map mappingProperties) throws Exception {
if (streamFactoryLookup != null) {
return InitialContext.doLookup(streamFactoryLookup);
}
synchronized (beanIOMappings) {
StreamFactory streamFactory = beanIOMappings.get(key);
if (streamFactory != null) {
return streamFactory;
}
final InputStream mappingInputStream = getInputStream(key.mappingFile, false);
if (mappingInputStream == null) {
throw SupportMessages.MESSAGES.invalidReaderWriterProperty(null, null, "streamMapping");
}
streamFactory = StreamFactory.newInstance();
try {
if (mappingProperties == null) {
streamFactory.load(mappingInputStream);
} else {
final Properties p = new Properties();
p.putAll(mappingProperties);
streamFactory.load(mappingInputStream, p);
}
} finally {
try {
mappingInputStream.close();
} catch (final IOException ioe) {