Class DurableQueueBuilder
java.lang.Object
org.j7m.middleware.messaging.DurableQueueBuilder
Builder for
LogBackedDurableQueue.
Durable logs created from directory(Path) are owned by the
queue and closed with it. Durable logs supplied through
durableLog(DurableLog) are borrowed by default and remain the
caller's responsibility unless ownedDurableLog(DurableLog) is used.
Instances are mutable and not thread-safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and recovers the queue service.Sets the clock.Sets a directory for a new file durable log.durableLog(org.j7m.middleware.api.durablelog.DurableLog value) Sets an existing durable log.inboxOptions(org.j7m.middleware.api.messaging.InboxOptions value) Sets inbox options.outboxOptions(org.j7m.middleware.api.messaging.OutboxOptions value) Sets outbox options.ownedDurableLog(org.j7m.middleware.api.durablelog.DurableLog value) Sets an existing durable log that will be closed by the queue.queueOptions(org.j7m.middleware.api.messaging.QueueOptions value) Sets queue options.
-
Constructor Details
-
DurableQueueBuilder
public DurableQueueBuilder()Creates a builder.
-
-
Method Details
-
durableLog
Sets an existing durable log.- Parameters:
value- durable log to use- Returns:
- this builder
-
ownedDurableLog
Sets an existing durable log that will be closed by the queue.- Parameters:
value- durable log to use and close- Returns:
- this builder
-
directory
Sets a directory for a new file durable log.- Parameters:
value- log directory- Returns:
- this builder
-
queueOptions
Sets queue options.- Parameters:
value- queue options- Returns:
- this builder
-
outboxOptions
Sets outbox options.- Parameters:
value- outbox options- Returns:
- this builder
-
inboxOptions
Sets inbox options.- Parameters:
value- inbox options- Returns:
- this builder
-
clock
Sets the clock.- Parameters:
value- clock used by queue time semantics- Returns:
- this builder
-
build
Builds and recovers the queue service.- Returns:
- recovered queue service
- Throws:
IllegalArgumentException- when neither directory nor durable log is configured
-