Guice scoped proxy extension

Allows to bind classes as scoped proxy using Google's Guice

License

License

Categories

Categories

GUI User Interface Guice Application Layer Libs Dependency Injection
GroupId

GroupId

de.skuzzle.inject
ArtifactId

ArtifactId

guice-scoped-proxy-extension
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

Guice scoped proxy extension
Allows to bind classes as scoped proxy using Google's Guice

Download guice-scoped-proxy-extension

How to add to project

<!-- https://jarcasting.com/artifacts/de.skuzzle.inject/guice-scoped-proxy-extension/ -->
<dependency>
    <groupId>de.skuzzle.inject</groupId>
    <artifactId>guice-scoped-proxy-extension</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/de.skuzzle.inject/guice-scoped-proxy-extension/
implementation 'de.skuzzle.inject:guice-scoped-proxy-extension:0.2.0'
// https://jarcasting.com/artifacts/de.skuzzle.inject/guice-scoped-proxy-extension/
implementation ("de.skuzzle.inject:guice-scoped-proxy-extension:0.2.0")
'de.skuzzle.inject:guice-scoped-proxy-extension:jar:0.2.0'
<dependency org="de.skuzzle.inject" name="guice-scoped-proxy-extension" rev="0.2.0">
  <artifact name="guice-scoped-proxy-extension" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.skuzzle.inject', module='guice-scoped-proxy-extension', version='0.2.0')
)
libraryDependencies += "de.skuzzle.inject" % "guice-scoped-proxy-extension" % "0.2.0"
[de.skuzzle.inject/guice-scoped-proxy-extension "0.2.0"]

Dependencies

compile (7)

Group / Artifact Type Version
cglib : cglib jar 3.2.10
com.google.guava : guava jar 27.0-jre
org.ow2.asm : asm jar 7.0
com.google.inject : guice jar 4.2.2
javax.inject : javax.inject jar 1
junit : junit jar 4.12
org.mockito : mockito-all jar 1.10.19

provided (1)

Group / Artifact Type Version
org.objenesis : objenesis jar 3.0.1

Project Modules

There are no modules declared in this project.

Build Status Maven Central Coverage Status JavaDoc

Guice Scoped Proxies

Bind classes as scoped proxies to inject them into wider scopes without the need to use a Provider.

Sample usage:

public class MyModule extends AbstractModule {

    @Override
    public void configure() {
        ScopedProxyBinder.using(binder())
                .bind(MyInterface.class)
                .to(MyInterfaceImpl.class)
                .in(SessionScoped.class);
    }
}

Now you can inject MyInterface into every scope as if it were a Singleton or as if it were a Provider<MyInterface>.

Known Issues

  • Currently it is not possible to add untargetted bindings. You always have to name the implementing class by using either of the provided to(...) methods.

Versions

Version
0.2.0
0.1.0