Class ContextPlugins
- java.lang.Object
-
- org.apache.sling.testing.mock.osgi.context.ContextPlugins
-
@ProviderType public final class ContextPlugins extends Object
Collects list of context plugins.
-
-
Constructor Summary
Constructors Constructor Description ContextPlugins()
Start with empty list.ContextPlugins(@NotNull ContextCallback<T> afterSetUpCallback)
Start with some callbacks.ContextPlugins(@NotNull ContextCallback<U> afterSetUpCallback, @NotNull ContextCallback<V> beforeTearDownCallback)
Start with some callbacks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends OsgiContextImpl>
voidaddAfterSetUpCallback(@NotNull ContextCallback<T> @NotNull ... afterSetUpCallback)
Add callback<T extends OsgiContextImpl>
voidaddAfterTearDownCallback(@NotNull ContextCallback<T> @NotNull ... afterTearDownCallback)
Add callback<T extends OsgiContextImpl>
voidaddBeforeSetUpCallback(@NotNull ContextCallback<T> @NotNull ... beforeSetUpCallback)
Add callback<T extends OsgiContextImpl>
voidaddBeforeTearDownCallback(@NotNull ContextCallback<T> @NotNull ... beforeTearDownCallback)
Add callback<T extends OsgiContextImpl>
voidaddPlugin(@NotNull ContextPlugin<T> @NotNull ... plugin)
Add plugin<T extends OsgiContextImpl>
voidexecuteAfterSetUpCallback(T context)
Execute all after setup callbacks.<T extends OsgiContextImpl>
voidexecuteAfterTearDownCallback(T context)
Execute all after teardown callbacks.<T extends OsgiContextImpl>
voidexecuteBeforeSetUpCallback(T context)
Execute all before setup callbacks.<T extends OsgiContextImpl>
voidexecuteBeforeTearDownCallback(T context)
Execute all before teardown callbacks.@NotNull Collection<ContextPlugin<? extends OsgiContextImpl>>
getPlugins()
-
-
-
Constructor Detail
-
ContextPlugins
public ContextPlugins()
Start with empty list.
-
ContextPlugins
public ContextPlugins(@NotNull @NotNull ContextCallback<T> afterSetUpCallback)
Start with some callbacks.- Type Parameters:
T
- context type- Parameters:
afterSetUpCallback
- Allows the application to register an own callback function that is called after the built-in setup rules are executed.
-
ContextPlugins
public ContextPlugins(@NotNull @NotNull ContextCallback<U> afterSetUpCallback, @NotNull @NotNull ContextCallback<V> beforeTearDownCallback)
Start with some callbacks.- Type Parameters:
U
- context typeV
- context type- Parameters:
afterSetUpCallback
- Allows the application to register an own callback function that is called after the built-in setup rules are executed.beforeTearDownCallback
- Allows the application to register an own callback function that is called before the built-in teardown rules are executed.
-
-
Method Detail
-
addPlugin
@SafeVarargs public final <T extends OsgiContextImpl> void addPlugin(@NotNull @NotNull ContextPlugin<T> @NotNull ... plugin)
Add plugin- Type Parameters:
T
- context type- Parameters:
plugin
- Plugin
-
addBeforeSetUpCallback
@SafeVarargs public final <T extends OsgiContextImpl> void addBeforeSetUpCallback(@NotNull @NotNull ContextCallback<T> @NotNull ... beforeSetUpCallback)
Add callback- Type Parameters:
T
- context type- Parameters:
beforeSetUpCallback
- Allows the application to register an own callback function that is called before the built-in setup rules are executed.
-
addAfterSetUpCallback
@SafeVarargs public final <T extends OsgiContextImpl> void addAfterSetUpCallback(@NotNull @NotNull ContextCallback<T> @NotNull ... afterSetUpCallback)
Add callback- Type Parameters:
T
- context type- Parameters:
afterSetUpCallback
- Allows the application to register an own callback function that is called after the built-in setup rules are executed.
-
addBeforeTearDownCallback
@SafeVarargs public final <T extends OsgiContextImpl> void addBeforeTearDownCallback(@NotNull @NotNull ContextCallback<T> @NotNull ... beforeTearDownCallback)
Add callback- Type Parameters:
T
- context type- Parameters:
beforeTearDownCallback
- Allows the application to register an own callback function that is called before the built-in teardown rules are executed.
-
addAfterTearDownCallback
@SafeVarargs public final <T extends OsgiContextImpl> void addAfterTearDownCallback(@NotNull @NotNull ContextCallback<T> @NotNull ... afterTearDownCallback)
Add callback- Type Parameters:
T
- context type- Parameters:
afterTearDownCallback
- Allows the application to register an own callback function that is after before the built-in teardown rules are executed.
-
getPlugins
@NotNull public @NotNull Collection<ContextPlugin<? extends OsgiContextImpl>> getPlugins()
- Returns:
- All plugins
-
executeBeforeSetUpCallback
public <T extends OsgiContextImpl> void executeBeforeSetUpCallback(@NotNull T context)
Execute all before setup callbacks.- Type Parameters:
T
- context type- Parameters:
context
- Context
-
executeAfterSetUpCallback
public <T extends OsgiContextImpl> void executeAfterSetUpCallback(@NotNull T context)
Execute all after setup callbacks.- Type Parameters:
T
- context type- Parameters:
context
- Context
-
executeBeforeTearDownCallback
public <T extends OsgiContextImpl> void executeBeforeTearDownCallback(@NotNull T context)
Execute all before teardown callbacks.- Type Parameters:
T
- context type- Parameters:
context
- Context
-
executeAfterTearDownCallback
public <T extends OsgiContextImpl> void executeAfterTearDownCallback(@NotNull T context)
Execute all after teardown callbacks.- Type Parameters:
T
- context type- Parameters:
context
- Context
-
-