Skip to content

Instantly share code, notes, and snippets.

@Ozsie
Last active April 15, 2018 12:43
Show Gist options
  • Save Ozsie/4e1762ba8cc27f76689ae070c2cb29e0 to your computer and use it in GitHub Desktop.
Save Ozsie/4e1762ba8cc27f76689ae070c2cb29e0 to your computer and use it in GitHub Desktop.
package com.github.ozsie.webfluxtest
import com.github.ozsie.webfluxtest.handlers.ItemHandler
import com.github.ozsie.webfluxtest.routers.router
import org.springframework.context.ApplicationContextInitializer
import org.springframework.context.support.GenericApplicationContext
import org.springframework.context.support.beans
// See application.properties context.initializer.classes entry
class Beans : ApplicationContextInitializer<GenericApplicationContext> {
override fun initialize(context: GenericApplicationContext) = beans {
bean { ItemHandler(ref()) }
bean { router(ref()) }
bean { init(ref()) }
}.initialize(context)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment