Merge branch 'master' of bitbucket.org:openesb/openesb-components

master
David BRASSELY 2014-02-06 13:18:29 +01:00
commit 232960de7b
6 changed files with 431 additions and 377 deletions

View File

@ -972,12 +972,12 @@
<repository>
<id>openesb-release</id>
<name>OpenESB repo release</name>
<url>http://nexus.openesb-dev.org:8081/nexus/content/repositories/openesb-release/</url>
<url>http://build2.open-esb.net:8081/nexus/content/repositories/openesb-release/</url>
</repository>
<snapshotRepository>
<id>openesb-snapshot</id>
<name>OpenESB repo release</name>
<url>http://nexus.openesb-dev.org:8081/nexus/content/repositories/openesb-snapshot/</url>
<url>http://build2.open-esb.net:8081/nexus/content/repositories/openesb-snapshot/</url>
</snapshotRepository>
</distributionManagement>

View File

@ -181,12 +181,12 @@
<repository>
<id>openesb-release</id>
<name>OpenESB repo release</name>
<url>http://nexus.openesb-dev.org:8081/nexus/content/repositories/openesb-release/</url>
<url>http://build2.open-esb.net:8081/nexus/content/repositories/openesb-release/</url>
</repository>
<snapshotRepository>
<id>openesb-snapshot</id>
<name>OpenESB repo release</name>
<url>http://nexus.openesb-dev.org:8081/nexus/content/repositories/openesb-snapshot/</url>
<url>http://build2.open-esb.net:8081/nexus/content/repositories/openesb-snapshot/</url>
</snapshotRepository>
</distributionManagement>
<pluginRepositories>

View File

@ -383,7 +383,7 @@ public class InboundMessageProcessor implements Runnable, MessageExchangeReplyLi
*/
private FileLock acquireLockOnTargetDir(/*FileAddress fileAddress, File inDir*/)
throws IOException, FileNotFoundException {
FileLock fLock;
FileLock fLock = null;
// we are the only thread on this process entered this area
// further lock the physical target directory
//File lockFile = new File(inDir, fileAddress.getLockName());
@ -396,7 +396,16 @@ public class InboundMessageProcessor implements Runnable, MessageExchangeReplyLi
FileOutputStream fos = new FileOutputStream(lockFile);
mLock.setChannel(channel = fos.getChannel());
}
fLock = channel.tryLock();
try {
fLock = channel.tryLock();
} catch (IOException e) {
if (mLogger.isLoggable(Level.WARNING)) {
mLogger.log(Level.WARNING, "Exception caught when trying to lock file for inbound target: " + lockFile.getName() + ", destination file :" + mLock.getLockFilePath() + ". Trying to recreate. Exception: " + e.getMessage());
}
FileOutputStream fos = new FileOutputStream(lockFile);
mLock.setChannel(channel = fos.getChannel());
if (fLock == null) fLock = channel.tryLock();
}
return fLock;
}

View File

@ -1425,7 +1425,47 @@ public class OutboundMessageProcessor implements Runnable {
// sync threads across JVM (process) using physical file lock
// for accessing the target file
// blocking call
fileLock = cLock.getFileChannel().lock();
try {
fileLock = cLock.getFileChannel().lock();
} catch (IOException e) {
if (mLogger.isLoggable(Level.WARNING)) {
mLogger.log(Level.WARNING, "Exception caught when trying to lock file for outbound target: " + fileLock + ", destination file :" + outFile.getPath() + ". Trying to recreate. Exception: " + e.getMessage());
}
// So lets try to recreate lock for one time. Perhaps the service uses for NFS and external file storage got fail
LockRegistry.remove(endpointKey);
String lockName = null;
FileOutputStream fos = null;
File lockFile = null;
//write out info about this directory
lockName = endpoint.getFileAddress().getLockName();
lockName = lockName != null && lockName.trim().length() > 0 ? lockName : Lock.DEFAULT_INBOUND_LOCKFILE_NAME;
lockFile = new File(endpoint.getWorkAreaDir(), lockName);
lockFile.createNewFile();
fos = new FileOutputStream(lockFile);
if (mLogger.isLoggable(Level.FINE)) {
mLogger.log(Level.FINE, "FBD_Init_SU_Register_Lock",
new Object[]{lockFile.getCanonicalPath(), endpointKey});
}
Lock l = LockRegistry.register(endpointKey, new Lock((fos != null ? fos.getChannel() : null), new ReentrantLock(), lockFile.getCanonicalPath()));
if (l == null) {
throw new Exception(
mMessages.getString("FILEBC-E00793.Failed_register_lock_4_outbound_endpoint",
new Object[]{endpoint.getServiceName().toString(),
endpoint.getEndpointName(),
lockFile.getCanonicalPath()
}));
}
try {
cLock.setChannel(fos.getChannel());
fileLock = cLock.getFileChannel().lock();
} catch (Exception eee) {
mLogger.log(Level.SEVERE, "Exception caught when trying to lock file for outbound target: " + fileLock + ", destination file :" + outFile.getPath() + ", Exception: ("+e.getClass().getName()+")" + e.getMessage());
}
}
}
File path = outFile.getParentFile();

View File

@ -151,6 +151,7 @@ FILEBC-E00769.Failed_to_process_redelivery=FILEBC-E00769: An exception occured w
FileBC-E00790.Solicited_Read_Multiple_Records_Per_File=FileBC-E00790: Solicited Read does not support multiple records per file. Endpoint invoked was: {0}.
FILEBC-E00791.Solicited_Read_Failed=FILEBC-E00791: Solicited Read Failed. service: {0}, endpoint: {1}, operation: {2}. Error was: {3}.
FileBC-E00792.Solicited_Read_Could_Not_Send_Error_Message=FileBC-E00792: Solicited Read Failed. But error message could not be sent to the invoking service due to: {0}.
FILEBC-E00793.Failed_register_lock_4_outbound_endpoint=FILEBC-E00793: Failed to register lock file for outbound endpoint: service name = [{0}] endpoint name = [{1}], [{2}] might be used by an existing outbound endpoint.
# Warnings
FILEBC-W00701.Message_write_failed_exception=FILEBC-W00701: Attempt to write a message for service: {0}, endpoint: {1}, operation: {2}, failed. Error was: {3}