guice Questions
8
Solved
Is it possible to tell Guice to call some method (i.e. init()) after
instantinating an object of given type?
I look for functionality similar to @PostConstruct annotation in EJB 3 (and Spring).
Dulcet asked 19/1, 2010 at 12:18
7
Solved
I have this code where I read the input from a request input stream and use a JacksonMapper to convert into a POJO. Its running in a jetty 7 container with guice support.
@Override
protected void ...
4
Solved
I'm new to Guice and here is a naive question. I learned that we could bind String to a particular value through:
bind(String.class)
.annotatedWith(Names.named("JDBC URL"))
.toInstance("jdbc:m...
6
Solved
Java 8, Guice 4.0 and Akka 2.3.9 here. I am trying to figure out how to annotate my actor classes with JSR330-style @Inject annotations, and then wire them all up via Guice.
But literally every si...
3
We have a Spring framework based application and need to integrate a component that is built using Google Guice.
Can anybody give us some advice on how this can be done?
We came across the follo...
3
Solved
I am not sure if the issue is the technologies involved, or my understanding of the technologies.
I have an html5 application written in javascript and html hosted on an apache 2.2 server.
I have...
Kinser asked 3/5, 2013 at 4:56
3
My application uses Guice for Dependency Injection and consists of several modules, some depend on an instance of class X and some need to be able to run independently of the main application.
So i...
1
Solved
I know that dagger creates injection at compile time by generating code and hence its performance is better than Guice, which do it at runtime. But specifically for case of lambda, I see it mention...
Sapphire asked 2/5, 2019 at 2:5
3
Solved
I am new to Guice and I was wondering how far I can take it.
I have an interface UserInfo with multiple implementing classes GoogleUserInfo, FacebookUserInfo, TwitterUserInfo etc. These classes are...
Marinmarina asked 14/4, 2013 at 18:6
3
Solved
With Google Guice or Gin I can specify parameter with are not controlled by the dependency injection framework:
class SomeEditor {
@Inject
public SomeEditor(SomeClassA a, @Assisted("stage") S...
1
I'm using Sitebricks with Guice to implement REST service and I have a set of methods like this:
@Get
@At("/:version/har/mostRecentEntry/assertResponseTimeWithin")
public Reply<?> doSomethin...
Mindful asked 20/3, 2019 at 7:54
1
Solved
I am looking for a way to dynamically select the correct dependency during runtime using google guice.
My usecase is a kotlin application which can work with either sqlite or h2 databases dependin...
2
Solved
Lombok misses field's annotation while auto generating constructor. Is there a way to retain field's annotation in constructor input params?
Class to generate constructor,
@RequiredArgsConstructo...
5
Solved
I stuck with a simple refactoring from plain Java to Spring. Application has a "Container" object which instantiates its parts at runtime. Let me explain with the code:
public class Conta...
Gaius asked 7/1, 2015 at 0:55
5
Solved
I'm starting a new Java web app from scratch.
I don't have much experience on Spring Framework, but I know I'd like to use some of its features, such as Transaccions Management.
On the other han...
Carolynncarolynne asked 10/1, 2014 at 23:0
3
Solved
I'm writing a JavaFX application in Kotlin with the following controller definition:
class MainController {
@Inject private lateinit var componentDescriptors: List<ComponentDescriptor>
/*...
Oversupply asked 14/4, 2016 at 13:49
1
Solved
My application structure is like
I created an annotation as below:-
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface SampleAnnotation {
}
Then created a Sample ...
Dartmouth asked 5/11, 2018 at 7:19
2
Solved
Is there way to bind a method interceptor to a provider rather than an instance?
e.g. I use the code below to bind interceptors how would I bind INTERCEPTOR to a provider and then to the annotatio...
11
Solved
From what I can find online, the state of the art for Guice + Jersey integration has stagnated since 2008 when it appears both teams reached an impasse. The crux of the issue is that JAX-RS annotat...
1
Solved
I am injection multiple concretes of the same interface.
I figured out the Guide "code it up" convention.
My code currently spits out
[INFO] App - About to ship. (abc)
[INFO] App - ShipperInterf...
Mihe asked 11/9, 2018 at 15:30
2
Solved
I'd like to get Jersey2 and Guice to cooperate together, which is apparently rather difficult. I've seen some solution to this involving using the HK2-to-Guice bridge. But the bridge rely on gettin...
Monochromatism asked 19/10, 2017 at 7:51
2
I have upgraded Dropwizard in my project and facing issue while running unit tests, although service start up works fine and all APIs are behaving normally, problem is coming only while running tes...
Cough asked 17/4, 2017 at 13:37
1
Solved
I want to inject dependency with Generic type using Guice. Find below example in scala which replicate the issue.
ProductModel.scala
trait BaseProduct
case class Product() extends BaseProduct
...
Gainor asked 13/6, 2018 at 6:31
2
Solved
I'm working on a fairly large project that has a lot of injections. We're currently using a class that implements Provider for each injection that needs one, and they mostly have one line get metho...
Hawaiian asked 28/1, 2015 at 21:36
7
Solved
Using Guice, is it a good practice to get a new injector in each JUnit test class, as each test class should be independant?
Shaun asked 12/4, 2011 at 10:39
© 2022 - 2024 — McMap. All rights reserved.