--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Awesome, thanks for the milestone!
Cheers,
Martin
--
A related question : Global.java is going away. How is that replaced ? In our case, we need to initialise some Actors. We do roughly ;system = ActorSystem.create("messaging");Camel camel = CamelExtension.get(system);CamelContext camelContext = camel.context();ActorRef ref = system.actorOf(....);in a class called by Global.onStart(). What is the replacement for this ?
The Plugin architecture is marked deprecated in 2.4.0-M3. I've got that working, but I'm not sure how long that will remain. I would go for a eager singleton, but that also isn't an option.
On 12 Mar 2015 18:04, "Igmar Palsenberg" <ig...@palsenberg.com> wrote:
>
> Hi,
>
>
>>
>> I'm pleased to announce the release of Play 2.4.0-M3! This should be the last milestone before we go into the RC phase, and as with the other milestones, I want to stress that this release is still experimental, there are still things that can and will change between now and the RC phase, particularly in the area of configuration. Do not upgrade your production application to this release, it's just for experimenting with.
>>
>
> This release has broken the hooks into ApplicationLifecycle.
>
> We do :
>
> ... extends AbstratModule {
> configure() {
> bind(SomeClass.class).toProvider(SomeClassProvider.class).in(Singleton.class);
> }
>
> @Inject
> SomeClass(ApplicationLifecycle applicationLifecycle) {
> // Register shutdown hook
> }
>
> This used to work. Now we get a :
>
> Error injecting constructor, java.lang.IncompatibleClassChangeError: Found interface play.Application, but class was expected
> Any clues on this ?
That's a binary compatibility error, something needs to be recompiled against 2.4.0-M3, either your application, or a library you're depending on.
> A related question : Global.java is going away. How is that replaced ? In our case, we need to initialise some Actors. We do roughly ;
>
> system = ActorSystem.create("messaging");
> Camel camel = CamelExtension.get(system);
> CamelContext camelContext = camel.context();
>
> ActorRef ref = system.actorOf(....);
>
> in a class called by Global.onStart(). What is the replacement for this ?
Bind a component that depends on ActorSystem as an eager singleton, and create the actors in that components constructor.
>
>
>
> Regards,
>
>
> Igmar
>
> --
> 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.
I'm pleased to announce the release of Play 2.4.0-M3! This should be the last milestone before we go into the RC phase, and as with the other milestones, I want to stress that this release is still experimental, there are still things that can and will change between now and the RC phase, particularly in the area of configuration. Do not upgrade your production application to this release, it's just for experimenting with.The focus of this milestone has been testing, we've introduced quite a number of new APIs that should allow certain types of testing much easier:
It would be very handy if the Application.configuration() object was available before the application is bootstrapped. I need some keys from that in order to properly setup DI bindings, but I can't :public class CacheModule extends AbstractModule {protected void configure() {Configuration config = Play.application().configuration().getConfig("");// Rest of the DI code}}This blows up with the infamous "There is no started application" error. This severely limits what can be done with Guice modules. I also can't use a regular Play Module : That doesn't give me access to the Guice Binder, what I need.
If you can't use Guice modules because need Play-specific stuff and you can't use Play modules because you need Guice-specific stuff, you may need to extend GuiceApplicationLoader, which knows about both. Look at GuiceApplicationLoader and override the load method. You can use your own ApplicationLoader class by setting the "play.application.loader" config setting.
It doesn't look like the Scala 2.10 artifacts were published for this release.
--
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.
--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-dev+unsub...@googlegroups.com.
Is an RC on the way or will there be more milestones before?/Johan
--
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.
I'm pleased to announce the release of Play 2.4.0-M3! This should be the last milestone before we go into the RC phase, and as with the other milestones, I want to stress that this release is still experimental, there are still things that can and will change between now and the RC phase, particularly in the area of configuration. Do not upgrade your production application to this release, it's just for experimenting with.The focus of this milestone has been testing, we've introduced quite a number of new APIs that should allow certain types of testing much easier:
--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
It's there:What do your ivy reports say? See https://www.playframework.com/documentation/2.4.x/SBTDebugging for details on how to access them.
--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
James made an example to work with Play 2.4 and Spring that you should check out
https://github.com/jroper/play-spring
Singleton
class Application @Inject() (
userService: UserService,
registrationValidators : RegistrationValidators
)
extends Controller with play.api.i18n.I18nSupport {
def login = LoggedOutAction {
implicit request =>
Ok(views.html.logged_out.login())
}
UserActions.scala:
trait LoggedOutAction extends ActionBuilder[Request] {
def invokeBlock[A](req: Request[A], block: Request[A] => Future[Result]): Future[Result] =
if(UserAuth.isLoggedIn(req)){
Future(Results.TemporaryRedirect("/logout?url="+req.uri))
} else {
block(req)
}
}
object LoggedOutAction extends LoggedOutActionI getclass Application needs to be abstract, since method messagesApi in trait I18nSupport of type => play.api.i18n.MessagesApi is not defined
any clues ?Thx, Dominik
Hi Dominik,
As Ben pointed out, you really need to start with my PoC for spring support:
https://github.com/jroper/play-spring
We created the Play inject APIs specifically to abstract over providing bindings so that another DI provider, eg spring, can reuse the Play modules defined by each library, and not need to provide their own set of bindings. We intentionally crippled that API so that spring integration could be made to work, eg, it doesn't support binding parameterized types because spring doesn't support autowiring by parameterized types. The spring integration is not easy, spring is not designed to be configured programmatically (no, what spring calls programmatic configuration is not programmatic, it's declarative, annotations etc declare bindings in Java code rather than declaring in xml, there's nothing programmatic about that) and its legacy as an xml based system really shines through (every bean must have a string based id, for example). But it's possible.
My PoC worked for a very old snapshot of play 2.4, and will need to be updated as APIs have since changed. It does not support providing any custom configuration yet.
Regards,
James
I've pushed a change that lets Guice modules access the Play configuration. This allows you to create dynamic Guice bindings based on config. Here's a Java example:This change is going to be in the next milestone, hopefully the next couple of days.