-
Notifications
You must be signed in to change notification settings - Fork 1
UsingCDIWithJUEL
Sebastian Hoß edited this page Oct 3, 2013
·
3 revisions
To use CDI together with JUEL, declare the following dependencies
<dependencies>
<dependency>
<groupId>com.github.sebhoss.contract</groupId>
<artifactId>contract-cdi</artifactId>
<version>${contracts-version}</version>
</dependency>
<dependency>
<groupId>com.github.sebhoss.contract</groupId>
<artifactId>contract-juel</artifactId>
<version>${contracts-version}</version>
</dependency>
</dependencies>then expose the provided @JUEL ContractContextFactory as the @Default ContractContextFactory
import javax.enterprise.inject.Default; import javax.enterprise.inject.Produces;import com.github.sebhoss.contract.annotation.JUEL; import com.github.sebhoss.contract.verifier.ContractContextFactory;class ContractContextFactoryProducer {@Produces @Default ContractContextFactory contextFactory(final @JUEL ContractContextFactory juelFactory) { return juelFactory; }}
and annotate your business methods as usual using unified expression language. Consult the example project for more details.