Class OsgiContextBuilder


  • @ProviderType
    public final class OsgiContextBuilder
    extends Object
    Builder class for creating OsgiContext instances with different sets of parameters.
    • Constructor Detail

      • OsgiContextBuilder

        public OsgiContextBuilder()
        Create builder.
    • Method Detail

      • plugin

        @SafeVarargs
        @NotNull
        public final <T extends OsgiContextImpl> @NotNull OsgiContextBuilder plugin​(@NotNull
                                                                                    @NotNull ContextPlugin<T> @NotNull ... plugin)
        Type Parameters:
        T - context type
        Parameters:
        plugin - Context plugin which listens to context lifecycle events.
        Returns:
        this
      • beforeSetUp

        @SafeVarargs
        @NotNull
        public final <T extends OsgiContextImpl> @NotNull OsgiContextBuilder beforeSetUp​(@NotNull
                                                                                         @NotNull ContextCallback<T> @NotNull ... beforeSetUpCallback)
        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.
        Returns:
        this
      • afterSetUp

        @SafeVarargs
        @NotNull
        public final <T extends OsgiContextImpl> @NotNull OsgiContextBuilder afterSetUp​(@NotNull
                                                                                        @NotNull ContextCallback<T> @NotNull ... afterSetUpCallback)
        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.
        Returns:
        this
      • beforeTearDown

        @SafeVarargs
        @NotNull
        public final <T extends OsgiContextImpl> @NotNull OsgiContextBuilder beforeTearDown​(@NotNull
                                                                                            @NotNull ContextCallback<T> @NotNull ... beforeTearDownCallback)
        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.
        Returns:
        this
      • afterTearDown

        @SafeVarargs
        @NotNull
        public final <T extends OsgiContextImpl> @NotNull OsgiContextBuilder afterTearDown​(@NotNull
                                                                                           @NotNull ContextCallback<T> @NotNull ... afterTearDownCallback)
        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.
        Returns:
        this