Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KAA-25: Added optimistic lock for update endpoint profile.
- Loading branch information
Igor Khanenko
committed
Dec 16, 2015
1 parent
62859fa
commit 62bf615
Showing
19 changed files
with
458 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
.../java/org/kaaproject/kaa/server/common/dao/lock/KaaOptimisticLockingFailureException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,14 @@ | |||
package org.kaaproject.kaa.server.common.dao.lock; | |||
|
|||
import org.springframework.dao.OptimisticLockingFailureException; | |||
|
|||
public class KaaOptimisticLockingFailureException extends OptimisticLockingFailureException { | |||
|
|||
public KaaOptimisticLockingFailureException(String msg, Throwable cause) { | |||
super(msg, cause); | |||
} | |||
|
|||
public KaaOptimisticLockingFailureException(String msg) { | |||
super(msg); | |||
} | |||
} |
25 changes: 25 additions & 0 deletions
25
server/common/dao/src/main/java/org/kaaproject/kaa/server/common/dao/lock/Retry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,25 @@ | |||
package org.kaaproject.kaa.server.common.dao.lock; | |||
|
|||
import java.lang.annotation.ElementType; | |||
import java.lang.annotation.Retention; | |||
import java.lang.annotation.RetentionPolicy; | |||
import java.lang.annotation.Target; | |||
|
|||
@Retention(RetentionPolicy.RUNTIME) | |||
@Target(ElementType.METHOD) | |||
public @interface Retry { | |||
|
|||
/** | |||
* The number of retry attempts | |||
* | |||
* @return retry attempts | |||
*/ | |||
int times() default 1; | |||
|
|||
/** | |||
* Declare the exception types the retry will be issued on. | |||
* | |||
* @return exception types causing a retry | |||
*/ | |||
Class<? extends Exception>[] on(); | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.