backport concurrent

timeoutSeconds
polish in conversation management system
This commit is contained in:
Keith Donald
2008-03-31 19:13:24 +00:00
parent 81922cb888
commit 0f86540ae2
3 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package org.springframework.webflow.conversation.impl;
import org.springframework.webflow.conversation.ConversationException;
/**
* Thrown if a conversation id could not be parsed.
*
* @author Keith Donald
*/
public class BadlyFormattedConversationIdException extends ConversationException {
/**
* Creates a new badly formatted conversation id exception.
* @param encodedId the badly formatted id
* @param parseException the cause
*/
public BadlyFormattedConversationIdException(String encodedId, Throwable parseException) {
super("Unable to parse string-encoded conversationId + '" + encodedId + "'", parseException);
}
}

View File

@@ -0,0 +1,20 @@
package org.springframework.webflow.conversation.impl;
import org.springframework.webflow.conversation.ConversationLockException;
/**
* <code>Exception</code> indicating that some {@link Thread} was {@link Thread#interrupt() interrupted} during
* processing and as such processing was halted.
* <p>
* Only used to wrap the checked {@link InterruptedException java.lang.InterruptedException}.
*/
public class LockInterruptedException extends ConversationLockException {
/**
* Creates a new <code>SystemInterruptedException</code>.
* @param cause the root cause of this <code>Exception</code>
*/
public LockInterruptedException(InterruptedException cause) {
super("Unable to acquire conversation lock - thread interrupted", cause);
}
}

View File

@@ -0,0 +1,16 @@
package org.springframework.webflow.conversation.impl;
import org.springframework.webflow.conversation.ConversationLockException;
/**
* Thrown when a lock could not be acquired after a timeout period.
*
* @author Keith Donald
*/
public class LockTimeoutException extends ConversationLockException {
public LockTimeoutException(int timeoutSeconds) {
super("Unable to acquire conversation lock after " + timeoutSeconds + " seconds");
}
}