Class WhiteboardUtils
java.lang.Object
org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
JMX Domain name under which Oak related JMX MBeans are registered -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
getService
(@NotNull Whiteboard wb, @NotNull Class<T> type) Returns the one of the currently available services from the whiteboard of the tracked type.static <T> T
getService
(@NotNull Whiteboard wb, @NotNull Class<T> type, @Nullable Predicate<T> predicate) Returns the one of the currently available services from the whiteboard of the tracked type.static <T> @NotNull List<T>
getServices
(@NotNull Whiteboard wb, @NotNull Class<T> type) Returns the currently available services from the whiteboard of the tracked type.static <T> @NotNull List<T>
getServices
(@NotNull Whiteboard wb, @NotNull Class<T> type, @Nullable Predicate<T> predicate) Returns the currently available services from the whiteboard of the tracked type.static <T> Registration
registerMBean
(Whiteboard whiteboard, Class<T> iface, T bean, String type, String name) static <T> Registration
registerMBean
(Whiteboard whiteboard, Class<T> iface, T bean, String type, String name, Map<String, String> attrs) static Registration
scheduleWithFixedDelay
(Whiteboard whiteboard, Runnable runnable, long delayInSeconds) static Registration
scheduleWithFixedDelay
(Whiteboard whiteboard, Runnable runnable, long delayInSeconds, boolean runOnSingleClusterNode, boolean useDedicatedPool) static Registration
scheduleWithFixedDelay
(Whiteboard whiteboard, Runnable runnable, Map<String, Object> extraProps, long delayInSeconds, boolean runOnSingleClusterNode, boolean useDedicatedPool) static Registration
scheduleWithFixedDelay
(Whiteboard whiteboard, Runnable runnable, Map<String, Object> extraProps, long delayInSeconds, WhiteboardUtils.ScheduleExecutionInstanceTypes scheduleExecutionInstanceTypes, boolean useDedicatedPool)
-
Field Details
-
JMX_OAK_DOMAIN
JMX Domain name under which Oak related JMX MBeans are registered- See Also:
-
-
Constructor Details
-
WhiteboardUtils
public WhiteboardUtils()
-
-
Method Details
-
scheduleWithFixedDelay
public static Registration scheduleWithFixedDelay(Whiteboard whiteboard, Runnable runnable, long delayInSeconds) -
scheduleWithFixedDelay
public static Registration scheduleWithFixedDelay(Whiteboard whiteboard, Runnable runnable, long delayInSeconds, boolean runOnSingleClusterNode, boolean useDedicatedPool) -
scheduleWithFixedDelay
public static Registration scheduleWithFixedDelay(Whiteboard whiteboard, Runnable runnable, Map<String, Object> extraProps, long delayInSeconds, boolean runOnSingleClusterNode, boolean useDedicatedPool) -
scheduleWithFixedDelay
public static Registration scheduleWithFixedDelay(Whiteboard whiteboard, Runnable runnable, Map<String, Object> extraProps, long delayInSeconds, WhiteboardUtils.ScheduleExecutionInstanceTypes scheduleExecutionInstanceTypes, boolean useDedicatedPool) -
registerMBean
public static <T> Registration registerMBean(Whiteboard whiteboard, Class<T> iface, T bean, String type, String name) -
registerMBean
public static <T> Registration registerMBean(Whiteboard whiteboard, Class<T> iface, T bean, String type, String name, Map<String, String> attrs) -
getServices
@NotNull public static <T> @NotNull List<T> getServices(@NotNull @NotNull Whiteboard wb, @NotNull @NotNull Class<T> type) Returns the currently available services from the whiteboard of the tracked type. Note that the underlying tracker is closed automatically.- Parameters:
wb
- the whiteboardtype
- the service type- Returns:
- a list of services
-
getService
@Nullable public static <T> T getService(@NotNull @NotNull Whiteboard wb, @NotNull @NotNull Class<T> type) Returns the one of the currently available services from the whiteboard of the tracked type. Note that the underlying tracker is closed automatically.- Returns:
- one service or
null
-
getServices
@NotNull public static <T> @NotNull List<T> getServices(@NotNull @NotNull Whiteboard wb, @NotNull @NotNull Class<T> type, @Nullable @Nullable Predicate<T> predicate) Returns the currently available services from the whiteboard of the tracked type. Ifpredicate
is notnull
the returned list is limited to the ones that match the predicate. Note that the underlying tracker is stopped automatically after the services are returned.- Parameters:
wb
- the whiteboardtype
- the service typepredicate
- filtering predicate ornull
- Returns:
- a list of services
-
getService
@Nullable public static <T> T getService(@NotNull @NotNull Whiteboard wb, @NotNull @NotNull Class<T> type, @Nullable @Nullable Predicate<T> predicate) Returns the one of the currently available services from the whiteboard of the tracked type. Ifpredicate
is notnull
only a service that match the predicate is returned. Note that the underlying tracker is closed automatically.- Parameters:
wb
- the whiteboardtype
- the service typepredicate
- filtering predicate ornull
- Returns:
- one service or
null
-