Package org.apache.sling.testing.mock.osgi.context

# 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

Modifier and Type
Method
Description
`final void`
`addAfterSetUpCallback(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterSetUpCallback)`
Add callback
`final void`
`addAfterTearDownCallback(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterTearDownCallback)`
Add callback
`final void`
`addBeforeSetUpCallback(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeSetUpCallback)`
Add callback
`final void`
`addBeforeTearDownCallback(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeTearDownCallback)`
Add callback
`final void`
`addPlugin(@NotNull ContextPlugin<? extends OsgiContextImpl> @NotNull ... plugin)`
Add plugin
`<T extends OsgiContextImpl>
void`
`executeAfterSetUpCallback(T context)`
Execute all after setup callbacks.
`<T extends OsgiContextImpl>
void`
`executeAfterTearDownCallback(T context)`
Execute all after teardown callbacks.
`<T extends OsgiContextImpl>
void`
`executeBeforeSetUpCallback(T context)`
Execute all before setup callbacks.
`<T extends OsgiContextImpl>
void`
`executeBeforeTearDownCallback(T context)`
Execute all before teardown callbacks.
`@NotNull Collection<ContextPlugin<? extends OsgiContextImpl>>`
`getPlugins()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### 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 type
  `V` - 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 Details

### addPlugin

@SafeVarargs public final void addPlugin(@NotNull @NotNull ContextPlugin<? extends OsgiContextImpl> @NotNull ... plugin)
Add plugin

Parameters:
  `plugin` - Plugin

### addBeforeSetUpCallback

@SafeVarargs public final void addBeforeSetUpCallback(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeSetUpCallback)
Add callback

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 void addAfterSetUpCallback(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterSetUpCallback)
Add callback

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 void addBeforeTearDownCallback(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeTearDownCallback)
Add callback

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 void addAfterTearDownCallback(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterTearDownCallback)
Add callback

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