public static class RotatingServerAdvice.StandardRotationPolicy extends Object implements RotatingServerAdvice.RotationPolicy
| Modifier and Type | Field and Description |
|---|---|
protected DelegatingSessionFactory<?> |
factory |
protected Log |
logger |
| Constructor and Description |
|---|
StandardRotationPolicy(DelegatingSessionFactory<?> factory,
List<RotatingServerAdvice.KeyDirectory> keyDirectories,
boolean fair) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterReceive(boolean messageReceived,
MessageSource<?> source)
Invoked after the message source receive() method.
|
void |
beforeReceive(MessageSource<?> source)
Invoked before the message source receive() method.
|
protected void |
configureSource(MessageSource<?> source) |
RotatingServerAdvice.KeyDirectory |
getCurrent() |
protected DelegatingSessionFactory<?> |
getFactory() |
protected Iterator<RotatingServerAdvice.KeyDirectory> |
getIterator() |
protected List<RotatingServerAdvice.KeyDirectory> |
getKeyDirectories() |
protected boolean |
isFair() |
protected boolean |
isInitialized() |
protected void |
onRotation(MessageSource<?> source)
Update the state of the
MessageSource after the server is rotated, if necessary. |
protected void |
setInitialized(boolean initialized) |
protected void |
setIterator(Iterator<RotatingServerAdvice.KeyDirectory> iterator) |
protected final Log logger
protected final DelegatingSessionFactory<?> factory
public StandardRotationPolicy(DelegatingSessionFactory<?> factory, List<RotatingServerAdvice.KeyDirectory> keyDirectories, boolean fair)
protected Iterator<RotatingServerAdvice.KeyDirectory> getIterator()
protected void setIterator(Iterator<RotatingServerAdvice.KeyDirectory> iterator)
protected boolean isInitialized()
protected void setInitialized(boolean initialized)
protected DelegatingSessionFactory<?> getFactory()
protected List<RotatingServerAdvice.KeyDirectory> getKeyDirectories()
protected boolean isFair()
public RotatingServerAdvice.KeyDirectory getCurrent()
public void beforeReceive(MessageSource<?> source)
RotatingServerAdvice.RotationPolicybeforeReceive in interface RotatingServerAdvice.RotationPolicysource - the message source.public void afterReceive(boolean messageReceived,
MessageSource<?> source)
RotatingServerAdvice.RotationPolicyafterReceive in interface RotatingServerAdvice.RotationPolicymessageReceived - true if a message was received.source - the message source.protected void configureSource(MessageSource<?> source)
protected void onRotation(MessageSource<?> source)
MessageSource after the server is rotated, if necessary.
The default implementation updates the remote directory for known MessageSource implementations that require it,
specifically, instances of AbstractRemoteFileStreamingMessageSource, and
AbstractInboundFileSynchronizingMessageSource, and does nothing otherwise.
Subclasses may override this method to support other MessageSource types.source - the MessageSource.