Stripes Injection Enricher

Java EE Injection Enricher for the Stripes Framework

Лицензия

Лицензия

Категории

Категории

Stripe Прикладные библиотеки Financial
Группа

Группа

com.samaxes.stripes
Идентификатор

Идентификатор

stripes-injection-enricher
Последняя версия

Последняя версия

1.0.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

Stripes Injection Enricher
Java EE Injection Enricher for the Stripes Framework
Ссылка на сайт

Ссылка на сайт

https://github.com/StripesFramework/stripes-injection-enricher
Организация-разработчик

Организация-разработчик

samaxes
Система контроля версий

Система контроля версий

http://github.com/StripesFramework/stripes-injection-enricher

Скачать stripes-injection-enricher

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.samaxes.stripes/stripes-injection-enricher/ -->
<dependency>
    <groupId>com.samaxes.stripes</groupId>
    <artifactId>stripes-injection-enricher</artifactId>
    <version>1.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.samaxes.stripes/stripes-injection-enricher/
implementation 'com.samaxes.stripes:stripes-injection-enricher:1.0.3'
// https://jarcasting.com/artifacts/com.samaxes.stripes/stripes-injection-enricher/
implementation ("com.samaxes.stripes:stripes-injection-enricher:1.0.3")
'com.samaxes.stripes:stripes-injection-enricher:jar:1.0.3'
<dependency org="com.samaxes.stripes" name="stripes-injection-enricher" rev="1.0.3">
  <artifact name="stripes-injection-enricher" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.samaxes.stripes', module='stripes-injection-enricher', version='1.0.3')
)
libraryDependencies += "com.samaxes.stripes" % "stripes-injection-enricher" % "1.0.3"
[com.samaxes.stripes/stripes-injection-enricher "1.0.3"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
net.sourceforge.stripes : stripes Необязательный jar 1.5.7

test (4)

Идентификатор библиотеки Тип Версия
org.jboss.arquillian.junit : arquillian-junit-container jar
org.jboss.shrinkwrap.resolver : shrinkwrap-resolver-api-maven jar
org.jboss.shrinkwrap.resolver : shrinkwrap-resolver-impl-maven jar
junit : junit jar 4.11

Модули Проекта

Данный проект не имеет модулей.

Stripes Injection Enricher

Stripes Injection Enricher enriches Stripes Framework objects by satisfying injection points specified declaratively using annotations.
There are three injection-based enrichers provided by Stripes Injection Enricher out of the box:

  • @Resource - Java EE resource injections
  • @EJB - EJB session bean reference injections
  • @Inject - CDI injections

The first two enrichers use JNDI to lookup the instance to inject.
The CDI injections are handled by treating the Stripes object as a bean capable of receiving standard CDI injections.

The @Resource annotation gives you access to any object which is available via JNDI.
It follows the standard rules for @Resource (as defined in the Section 2.3 of the Common Annotations for the Java Platform specification).

The @EJB annotation performs a JNDI lookup for the EJB session bean reference using EJB 3.1 portable global JNDI names.
If no matching beans were found in those locations the injection will fail.

However, you can manually set the JNDI name to lookup using the mappedName attribute for @EJB, as well as the attributes mappedName and name attributes for @Resource:

public class MyActionBean implements ActionBean {

    @Inject
    private FooService fooService;

    @EJB
    // or manually @EJB(mappedName = "java:global[/<app-name>]/<module-name>/BarService")
    private BarService barService;

    @Resource(name = "greeting")
    // same as @Resource(mappedName = "java:comp/env/greeting")
    private String greeting;

}

Note: In order for CDI injections to work, the web archive must be a bean archive. That means adding a beans.xml file (can be empty) to the WEB-INF directory.

Configuration

Maven dependency

Add Stripes Injection Enricher dependency to your project:

<dependency>
    <groupId>com.samaxes.stripes</groupId>
    <artifactId>stripes-injection-enricher</artifactId>
    <version>VERSION</version>
</dependency>

Stripes filter configuration

Add Stripes Injection Enricher to Stripes filter Extension.Packages configuration in web.xml:

<init-param>
    <param-name>Extension.Packages</param-name>
    <param-value>com.samaxes.stripes.inject</param-value>
</init-param>

Requirements

Stripes Injection Enricher requires a Java EE 6-compliant application server providing support for JSR-299 (CDI).
It has been tested with the following application servers:

  • GlassFish 3.1
  • JBoss AS 7
  • JBoss AS 6

License

This distribution is licensed under the terms of the Apache License, Version 2.0 (see LICENSE.txt).

com.samaxes.stripes

Stripes Framework

Версии библиотеки

Версия
1.0.3
1.0.2
1.0.1
1.0