Questions tagged [custom-scope]
20 questions
8
votes
1 answer
Spring Custom Scope Lifecycle Bean Termination
Question: How can I tell Spring that a set of beans with a custom scope should all be considered garbage, so that the next request on the same thread would not re-use their state?
What I've done: I've implemented a custom scope in Spring, to mimic…

Andrew Cotton
- 415
- 3
- 12
4
votes
1 answer
Espresso testing with Dagger 2 and custom scopes
After a recent migration to Dagger 2, the app I am working on is using an @ActivityScope for every feature. Each app feature is implemented using MVP pattern and has it's own local dagger Component setup which depends on the Application component…

The Riddler
- 107
- 8
4
votes
1 answer
Can Dagger 2 have scopes shorter than an Activity life?
I've been looking at Custom Scopes in Dagger 2 (this and this are the ones i'm trying to base my code in), and there's one thing that i still can't seem to understand, i see that you can create a component with a custom scope and then all the…

Jorge Aguilar
- 3,442
- 30
- 34
3
votes
2 answers
Dagger 2 Kotlin - @Named qualifier for @Binds method
I wanted to have @Named qualifier for object that's returned from @Binds method, but I noticed that's only possible through static provides method, which I couldn't figure out in practical implementation. So below is what I wanted to achieve.
I have…

Meghanath Ganji
- 41
- 3
3
votes
0 answers
How do you pass parameters and navigate to Spring managed bean with custom scope - view?
I would like to give you some context first.
The Context
I am currently developing a web application using Spring framework, where I would like to provide users with displaying/editing different instances of the same entity type of model in separate…

Kit Ostrihon
- 824
- 2
- 14
- 36
1
vote
0 answers
My custom "cdi" context is not getting applied/ called
I have a custom @InjectableContext which I register during my build step
@BuildStep
ContextConfiguratorBuildItem registerContext(ContextRegistrationPhaseBuildItem contextRegistrationPhase) {
return new ContextConfiguratorBuildItem(
…

Herr Derb
- 4,977
- 5
- 34
- 62
1
vote
1 answer
Un-scoped binding in modules vs Constructor injected binding in Dagger
I have an unscoped binding inside the appModule and the same class as constructor injected using the Singleton scope. when I add a declaration inside the appComponent for Foo, the generated code picks up the module binding without any DoubleCheck…

Saurabh Kumar
- 437
- 1
- 5
- 18
1
vote
1 answer
How to use shared scope in PhpStorm
As PhpStorm has mentioned that we can create 2 types of scope: local & shared.
How to use Shared scope for multiple developers??

Sumit
- 11
- 3
1
vote
1 answer
BeanManager always returns same reference
I am creating a custom CDI scope and am using the BeanManager to get an injection of my NavigationHandler custom class. But the beans it returns are quite strange.
So I use the BeanManager that way :
public class ScreenContext implements Context
{
…

Vulpo
- 873
- 1
- 9
- 25
1
vote
1 answer
Use injections in custom scope
Is it possible to use a @SessionScoped bean as a field in a custom scope's Context ?
I am writing a custom scope ("ScreenScoped") with CDI, so that it approximately has the same behavious than CDI's @ViewScoped (I do this because the latter is not…

Vulpo
- 873
- 1
- 9
- 25
1
vote
1 answer
Custom scope in CDI seems to require beans.xml
I created a custom scope in CDI.
@NormalScope(passivating = false)
@Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE,ElementType.METHOD,ElementType.FIELD})
@Inherited
public @interface MyScope { }
It works only if I had beans.xml with…

user1254591
- 21
- 8
0
votes
0 answers
Manage feature based hilt custom scope
My app is built with a Single Activity and it is feature-based multi-module. All UI is built using composable.
I want to create a custom scope for feature A. When the feature's journey is completed, its scope must be…

Shaon
- 2,496
- 26
- 27
0
votes
1 answer
Custom InjectableContext cannot differ between two injection points within the same bean in Quarkus
I try to implement a @TenantScope which can be used for stateful beans rather than using a nested map. For this I am implementing a io.quarkus.arc.InjectableContext.
I have it working so far, except if I have two injection points of the same type.…

Herr Derb
- 4,977
- 5
- 34
- 62
0
votes
1 answer
Xtext CustomScopeProvider Problems with adding candidates
I am working on an xtext Project where I have to customize the Scope Provider. I need to add up some possible candidates for the scope. The first part (getServiceInputs()) works fine but for the second one (addAll(sub.GetSubRecipeParameters()) not.…

umpapa
- 55
- 1
- 8
0
votes
0 answers
Intellij Idea. How to make custom scope pattern for hiding class files but show library folder?
Im writing software for external program and launching it. This program generates class files in project folder for each java file (its just compiles it and doing some work, that idea cannot do for some reasons).
I have around 60 classes at the…

NooneKnows
- 33
- 3