How to override a play internal module

134 views
Skip to first unread message

Saeed Zarinfam

unread,
Nov 13, 2016, 5:02:32 AM11/13/16
to Play Framework
According this issue, i am going to override DBModule or DBApiProvider. How can i register my provider or module in play framework and then disable the original one?

Greg Methvin

unread,
Nov 14, 2016, 9:28:30 PM11/14/16
to play-framework
You can add module names to play.modules.enabled to add your own modules, and add to play.modules.disabled to remove default modules:

play.modules {
  disabled += "play.api.db.DBModule"
  enabled += "com.example.MyDBModule"
}

You can also override default bindings and various other settings by using a custom GuiceApplicationLoader: https://www.playframework.com/documentation/2.5.x/ScalaDependencyInjection#Advanced:-Extending-the-GuiceApplicationLoader

On Sun, Nov 13, 2016 at 2:02 AM, Saeed Zarinfam <zarin...@gmail.com> wrote:
According this issue, i am going to override DBModule or DBApiProvider. How can i register my provider or module in play framework and then disable the original one?

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/fc0641ea-f4bb-4b79-bbcd-fedb389ef2e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Greg Methvin
Senior Software Engineer

Saeed Zarinfam

unread,
Nov 15, 2016, 1:11:35 AM11/15/16
to Play Framework
Thanks.


On Tuesday, November 15, 2016 at 5:58:30 AM UTC+3:30, Greg Methvin wrote:
You can add module names to play.modules.enabled to add your own modules, and add to play.modules.disabled to remove default modules:

play.modules {
  disabled += "play.api.db.DBModule"
  enabled += "com.example.MyDBModule"
}

You can also override default bindings and various other settings by using a custom GuiceApplicationLoader: https://www.playframework.com/documentation/2.5.x/ScalaDependencyInjection#Advanced:-Extending-the-GuiceApplicationLoader
On Sun, Nov 13, 2016 at 2:02 AM, Saeed Zarinfam <zarin...@gmail.com> wrote:
According this issue, i am going to override DBModule or DBApiProvider. How can i register my provider or module in play framework and then disable the original one?

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

Florian Pradines

unread,
Jan 17, 2017, 9:30:21 AM1/17/17
to Play Framework
Hi,

I have the same problem, could you share your code please?

Thanks,

Marcos Pereira

unread,
Jan 23, 2017, 11:33:15 AM1/23/17
to play-fr...@googlegroups.com
This is a good example:


Best,

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/e9893076-da0a-4d51-94ec-c6fd91967ded%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Marcos Pereira
Software Engineer, Lightbend.com

Florian Pradines

unread,
Feb 5, 2017, 10:05:44 AM2/5/17
to Play Framework
Thanks!


On Monday, January 23, 2017 at 5:33:15 PM UTC+1, Marcos Pereira wrote:
This is a good example:


Best,
On Tue, Jan 17, 2017 at 12:30 PM, Florian Pradines <florian....@gmail.com> wrote:
Hi,

I have the same problem, could you share your code please?

Thanks,

On Sunday, November 13, 2016 at 11:02:32 AM UTC+1, Saeed Zarinfam wrote:
According this issue, i am going to override DBModule or DBApiProvider. How can i register my provider or module in play framework and then disable the original one?

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages