-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made BaseService an interface that extends Module and Service. Added the class DefaultService that extends AbstractIdleService and implements the new BaseService interface. Bumped version.
- Loading branch information
Showing
9 changed files
with
77 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
core/src/main/java/io/sinistral/proteus/services/DefaultService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package io.sinistral.proteus.services; | ||
|
||
import com.google.common.util.concurrent.AbstractIdleService; | ||
import com.google.inject.Binder; | ||
import com.google.inject.Inject; | ||
import com.google.inject.Singleton; | ||
import com.typesafe.config.Config; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* An abstract base class for a Proteus service. | ||
* | ||
* @author jbauer | ||
*/ | ||
@Singleton | ||
public abstract class DefaultService extends AbstractIdleService implements BaseService | ||
{ | ||
private static Logger log = LoggerFactory.getLogger(DefaultService.class.getCanonicalName()); | ||
|
||
/* | ||
* @see com.google.inject.AbstractModule#configure() | ||
*/ | ||
@Inject | ||
protected Config config; | ||
|
||
public DefaultService() | ||
{ | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* @see com.google.inject.Module#configure(com.google.inject.Binder) | ||
*/ | ||
@Override | ||
public void configure(Binder binder) | ||
{ | ||
|
||
} | ||
|
||
/* | ||
//* @see com.google.common.util.concurrent.AbstractIdleService#shutDown() | ||
*/ | ||
@Override | ||
protected void shutDown() throws Exception | ||
{ | ||
log.info("Stopping " + this.getClass().getSimpleName()); | ||
} | ||
|
||
/* | ||
* @see com.google.common.util.concurrent.AbstractIdleService#startUp() | ||
*/ | ||
@Override | ||
protected void startUp() throws Exception | ||
{ | ||
log.info("Starting " + this.getClass().getSimpleName()); | ||
} | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters