Search in sources :

Example 6 with BeanData

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

the class RequestScope method remove.

public void remove(String name) {
    HttpServletRequest servletRequest = getCurrentHttpRequest();
    Map<String, BeanData> map = getRequestMap(servletRequest);
    if (map != null) {
        map.remove(name);
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) BeanData(jodd.petite.BeanData)

Example 7 with BeanData

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

the class SessionScope method lookup.

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

Example 8 with BeanData

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

the class SessionScope method register.

public void register(BeanDefinition beanDefinition, Object bean) {
    HttpSession session = getCurrentHttpSession();
    Map<String, BeanData> map = getSessionMap(session);
    if (map == null) {
        map = registerSessionBeans(session);
    }
    BeanData beanData = new BeanData(beanDefinition, bean);
    map.put(beanDefinition.getName(), beanData);
    registerDestroyableBeans(beanData);
}
Also used : HttpSession(javax.servlet.http.HttpSession) BeanData(jodd.petite.BeanData)

Example 9 with BeanData

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

the class ThreadLocalScope method lookup.

public Object lookup(String name) {
    Map<String, BeanData> threadLocalMap = context.get();
    BeanData beanData = threadLocalMap.get(name);
    if (beanData == null) {
        return null;
    }
    return beanData.getBean();
}
Also used : BeanData(jodd.petite.BeanData)

Aggregations

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