Skip to content

Commit

Permalink
Tweak the startup and injection strategies.
Browse files Browse the repository at this point in the history
Modify resource docs.
  • Loading branch information
splendidbits committed Mar 25, 2018
1 parent 42276d8 commit fa2defd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 55 deletions.
2 changes: 0 additions & 2 deletions app/injection/modules/ApplicationModule.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package injection.modules;

import com.google.inject.AbstractModule;
import injection.providers.LifecycleListenerProvider;
import main.LifecycleListener;

/**
Expand All @@ -13,7 +12,6 @@ public class ApplicationModule extends AbstractModule {
@Override
protected void configure() {
bind(LifecycleListener.class)
.toProvider(LifecycleListenerProvider.class)
.asEagerSingleton();
}
}
29 changes: 0 additions & 29 deletions app/injection/providers/LifecycleListenerProvider.java

This file was deleted.

8 changes: 4 additions & 4 deletions app/main/LifecycleListener.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package main;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import io.ebean.EbeanServer;
import play.inject.ApplicationLifecycle;
import services.pushservices.TaskQueue;

import java.util.concurrent.CompletableFuture;

@Singleton
public class LifecycleListener {
public LifecycleListener(EbeanServer ebeanServer, ApplicationLifecycle applicationLifecycle, TaskQueue taskQueue) {
taskQueue.startup();

applicationLifecycle.addStopHook(() -> CompletableFuture.runAsync(() -> {
@Inject
public LifecycleListener(EbeanServer ebeanServer, ApplicationLifecycle applicationLifecycle) {
applicationLifecycle.addStopHook(() -> CompletableFuture.runAsync(() -> {
ebeanServer.shutdown(true, false);
}));
}
Expand Down
5 changes: 1 addition & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-ws-standalone-json" % "1.0.1",
"com.typesafe.play" %% "play-ws-standalone-xml" % "1.0.1",
"com.typesafe.play" %% "play-json" % "2.6.1",
"org.avaje" % "avaje-agentloader" % "2.1.2",
"io.ebean" % "ebean-agent" % "10.1.6",
"org.postgresql" % "postgresql" % "42.2.2",
"org.jetbrains" % "annotations" % "13.0",
"org.jsoup" % "jsoup" % "1.10.1",
Expand All @@ -34,9 +34,6 @@ libraryDependencies ++= Seq(
"org.mockito" % "mockito-all" % "2.0.2-beta" % Test
)

dependencyOverrides += "org.avaje.ebeanorm" % "avaje-ebeanorm" % "8.1.1"
dependencyOverrides += "org.avaje.ebeanorm" % "avaje-ebeanorm-agent" % "8.1.1"

testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-q")
//resolvers += ("Local Maven Repository" at "/Users/daniel/.ivy2/cache")

Expand Down
16 changes: 0 additions & 16 deletions resources/DATABASES_UP
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ GRANT ALL PRIVILEGES ON DATABASE commutealerts to splendidbits;
CREATE DATABASE pushservices;
GRANT ALL PRIVILEGES ON DATABASE pushservices to splendidbits;

CREATE DATABASE fluffylog;
GRANT ALL PRIVILEGES ON DATABASE fluffylog to splendidbits;

-----


Expand Down Expand Up @@ -52,16 +49,3 @@ GRANT ALL ON SCHEMA pushservices TO splendidbits;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA pushservices to splendidbits;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA pushservices TO splendidbits;

-----


CREATE SCHEMA fluffylog;

GRANT USAGE ON SCHEMA fluffylog TO splendidbits;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA fluffylog TO splendidbits;
ALTER DEFAULT PRIVILEGES IN SCHEMA fluffylog GRANT ALL ON TABLES TO splendidbits;

GRANT ALL ON SCHEMA fluffylog TO splendidbits;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA fluffylog to splendidbits;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA fluffylog TO splendidbits;

0 comments on commit fa2defd

Please sign in to comment.