Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISPN-6677 Deal with unavailable persistence dependencies during startup
The PersistenceManager now attempts to start each of the configured stores several times before failure. The number of attempts and the time between attempts is configuratble. Furthermore, the PersistenceManager now periodically probes the availability of the configured stores via the CacheWriter and CacheLoader isAvailable methods.
- Loading branch information
1 parent
885e639
commit 63fad6f
Showing
39 changed files
with
596 additions
and
74 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
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
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
29 changes: 29 additions & 0 deletions
29
...org/infinispan/notifications/cachelistener/annotation/PersistenceAvailabilityChanged.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.infinispan.notifications.cachelistener.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* This annotation should be used on methods that need to be notified when the availability of the PersistenceManager | ||
* changes. When Cache stores are configured, but the connection to at least one store is lost, the PersistenceManager becomes | ||
* unavailable. This results in a {@link org.infinispan.persistence.spi.StoreUnavailableException} being thrown on all read/write | ||
* operations which require the PersistenceManager until all stores once again become available. | ||
* <p/> | ||
* Methods annotated with this annotation should be public and take in a single parameter, a {@link | ||
* org.infinispan.notifications.cachelistener.event.CacheEntryActivatedEvent} otherwise an {@link | ||
* org.infinispan.notifications.IncorrectListenerException} will be thrown when registering your cache listener. | ||
* Locking: notification is performed WITH locks on the given key. | ||
* <p/> | ||
* Any exceptions thrown by the listener will abort the call. Any other listeners not yet called will not be called, | ||
* and any transactions in progress will be rolled back. | ||
* | ||
* @author Ryan Emerson | ||
* @see org.infinispan.notifications.Listener | ||
* @since 9.3 | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.METHOD) | ||
public @interface PersistenceAvailabilityChanged { | ||
} |
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
8 changes: 8 additions & 0 deletions
8
...org/infinispan/notifications/cachelistener/event/PersistenceAvailabilityChangedEvent.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.infinispan.notifications.cachelistener.event; | ||
|
||
public interface PersistenceAvailabilityChangedEvent<K, V> extends Event<K, V> { | ||
/** | ||
* @return true if the {@link org.infinispan.persistence.manager.PersistenceManager} is available. | ||
*/ | ||
boolean isAvailable(); | ||
} |
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.