@@ -47,6 +47,34 @@ public NamedCacheBlockingDeque(String sName, NamedCache<QueueKey, E> cache)
47
47
cache .addMapListener (this , AlwaysFilter .INSTANCE (), true );
48
48
}
49
49
50
+ // ----- factory methods ------------------------------------------------
51
+
52
+ /**
53
+ * Create a {@link Builder} option.
54
+ * <p>
55
+ * The {@link Builder} can be passed as an option to the
56
+ * {@link Session#getDeque(String, Option...)} method to return
57
+ * a {@link NamedBlockingDeque} instead of a {@link NamedDeque}.
58
+ */
59
+ public Builder builder ()
60
+ {
61
+ return builder ("" );
62
+ }
63
+
64
+ /**
65
+ * Create a {@link Builder} option.
66
+ * <p>
67
+ * The {@link Builder} can be passed as an option to the
68
+ * {@link Session#getDeque(String, Option...)} method to return
69
+ * a {@link NamedBlockingDeque} instead of a {@link NamedDeque}.
70
+ *
71
+ * @param sNamePrefix the prefix to add to queue cache names
72
+ */
73
+ public Builder builder (String sNamePrefix )
74
+ {
75
+ return new Builder (sNamePrefix );
76
+ }
77
+
50
78
// ----- BlockingDeque methods ------------------------------------------
51
79
52
80
@ Override
@@ -378,6 +406,13 @@ public <E> NamedCacheDeque<E> build(String sName, NamedCache<QueueKey, E> cache)
378
406
return new SessionNamedBlockingDeque <>(session , blockingDeque , loader , typeAssertion );
379
407
}
380
408
409
+ // -----constants -------------------------------------------------------
410
+
411
+ /**
412
+ * The singleton instance of the default {@link Builder}.
413
+ */
414
+ public static Builder DEFAULT = new Builder ("" );
415
+
381
416
// ----- data members ---------------------------------------------------
382
417
383
418
/**
0 commit comments