public class

JndiIntegration

extends Object
java.lang.Object
   ↳ com.google.inject.jndi.JndiIntegration

Class Overview

Integrates Guice with JNDI. Requires a binding to javax.naming.Context.

Summary

Public Methods
static <T> Provider<T> fromJndi(Class<T> type, String name)
Creates a provider which looks up objects in JNDI using the given name.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static Provider<T> fromJndi (Class<T> type, String name)

Creates a provider which looks up objects in JNDI using the given name. Example usage:

 bind(DataSource.class).toProvider(fromJndi(DataSource.class, "java:..."));