qbit icon indicating copy to clipboard operation
qbit copied to clipboard

@PostCreate

Open RichardHightower opened this issue 8 years ago • 1 comments

    @QueueCallback(QueueCallbackType.INIT)
    fun connectionInit() {
        checkConnectionBreaker()
    }


    @QueueCallback(QueueCallbackType.SHUTDOWN)
    fun shutdown() {
        try {
            connectionBreaker.ifOk {
                it.close()
            }.cleanup { it.close() }
        } catch (ex : Exception) {
            logger.warn("unable to close connection", ex)
        }
    }

The above should also work like this


    @PostCreate
    fun connectionInit() {
        checkConnectionBreaker()
    }


    @PreDestroy
    fun shutdown() {
        try {
            connectionBreaker.ifOk {
                it.close()
            }.cleanup { it.close() }
        } catch (ex : Exception) {
            logger.warn("unable to close connection", ex)
        }
    }

RichardHightower avatar Jun 20 '16 20:06 RichardHightower

http://docs.oracle.com/javaee/5/api/javax/annotation/PostConstruct.html

RichardHightower avatar Jun 20 '16 20:06 RichardHightower