Search in sources :

Example 1 with BeanData

use of jodd.petite.BeanData in project jodd by oblac.

the class SessionScope method remove.

public void remove(String name) {
    if (totalRegisteredDestroyableBeans() == 0) {
        return;
    }
    HttpSession session = getCurrentHttpSession();
    Map<String, BeanData> map = getSessionMap(session);
    if (map != null) {
        map.remove(name);
    }
}
Also used : HttpSession(javax.servlet.http.HttpSession) BeanData(jodd.petite.BeanData)

Example 2 with BeanData

use of jodd.petite.BeanData in project jodd by oblac.

the class SingletonScope method register.

public void register(BeanDefinition beanDefinition, Object bean) {
    BeanData beanData = new BeanData(beanDefinition, bean);
    instances.put(beanDefinition.getName(), beanData);
}
Also used : BeanData(jodd.petite.BeanData)

Example 3 with BeanData

use of jodd.petite.BeanData in project jodd by oblac.

the class ThreadLocalScope method register.

public void register(BeanDefinition beanDefinition, Object bean) {
    BeanData beanData = new BeanData(beanDefinition, bean);
    Map<String, BeanData> threadLocalMap = context.get();
    threadLocalMap.put(beanDefinition.getName(), beanData);
}
Also used : BeanData(jodd.petite.BeanData)

Example 4 with BeanData

use of jodd.petite.BeanData in project jodd by oblac.

the class RequestScope method lookup.

public Object lookup(String name) {
    HttpServletRequest servletRequest = getCurrentHttpRequest();
    Map<String, BeanData> map = getRequestMap(servletRequest);
    if (map == null) {
        return null;
    }
    BeanData beanData = map.get(name);
    if (beanData == null) {
        return null;
    }
    return beanData.getBean();
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) BeanData(jodd.petite.BeanData)

Example 5 with BeanData

use of jodd.petite.BeanData in project jodd by oblac.

the class RequestScope method register.

public void register(BeanDefinition beanDefinition, Object bean) {
    HttpServletRequest servletRequest = getCurrentHttpRequest();
    Map<String, BeanData> map = getRequestMap(servletRequest);
    if (map == null) {
        map = createRequestMap(servletRequest);
    }
    BeanData beanData = new BeanData(beanDefinition, bean);
    map.put(beanDefinition.getName(), beanData);
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) BeanData(jodd.petite.BeanData)

Aggregations

BeanData (jodd.petite.BeanData)9 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 HttpSession (javax.servlet.http.HttpSession)3