Package ejava.examples.webtier.web
Class JPAFilter
- java.lang.Object
-
- ejava.examples.webtier.web.JPAFilter
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
containerManaged
private static ThreadLocal<EntityManager>
em
private EntityManagerFactory
emf
private static org.slf4j.Logger
logger
private static String
PU_NAME
-
Constructor Summary
Constructors Constructor Description JPAFilter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
closeEntityManager()
void
destroy()
private void
doDump(int level, StringBuilder text, Context context, String name)
void
doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
private void
dump(Context context, String name)
static EntityManager
getEntityManager()
protected String
getPad(int level)
void
init(FilterConfig config)
private EntityManager
initEntityManager()
protected boolean
isContext(String className)
-
-
-
Field Detail
-
logger
private static org.slf4j.Logger logger
-
PU_NAME
private static final String PU_NAME
- See Also:
- Constant Field Values
-
containerManaged
private boolean containerManaged
-
emf
private EntityManagerFactory emf
-
em
private static ThreadLocal<EntityManager> em
-
-
Method Detail
-
init
public void init(FilterConfig config) throws ServletException
- Specified by:
init
in interfaceFilter
- Throws:
ServletException
-
doFilter
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
- Specified by:
doFilter
in interfaceFilter
- Throws:
IOException
ServletException
-
initEntityManager
private EntityManager initEntityManager() throws ServletException
- Throws:
ServletException
-
closeEntityManager
private void closeEntityManager()
-
getEntityManager
public static final EntityManager getEntityManager()
-
doDump
private void doDump(int level, StringBuilder text, Context context, String name) throws NamingException
- Throws:
NamingException
-
isContext
protected boolean isContext(String className)
-
getPad
protected String getPad(int level)
-
-