Skip to content

Commit

Permalink
add an example of AutoCloseable component
Browse files Browse the repository at this point in the history
  • Loading branch information
xhanin committed Feb 3, 2015
1 parent 98f97f1 commit f756689
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package samplest.lifecycle;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import restx.factory.AutoStartable;
import restx.factory.Component;

/**
* Date: 3/2/15
* Time: 21:56
*/
@Component
public class AutoCloseableSample implements AutoStartable, AutoCloseable {
private static final Logger logger = LoggerFactory.getLogger(AutoCloseableSample.class);

@Override
public void start() {
logger.info("starting {}", this);
}

@Override
public void close() throws Exception {
logger.info("closing {}", this);
}
}

0 comments on commit f756689

Please sign in to comment.