@Provider public class UnitOfWorkApplicationListener extends Object implements org.glassfish.jersey.server.monitoring.ApplicationEventListener
RequestEventListener
that updates the relevant metric for suitably annotated methods when it gets the
request events indicating that the method is about to be invoked, or just got done
being invoked.Constructor and Description |
---|
UnitOfWorkApplicationListener() |
UnitOfWorkApplicationListener(String name,
org.hibernate.SessionFactory sessionFactory)
Construct an application event listener using the given name and session factory.
|
Modifier and Type | Method and Description |
---|---|
void |
onEvent(org.glassfish.jersey.server.monitoring.ApplicationEvent event) |
org.glassfish.jersey.server.monitoring.RequestEventListener |
onRequest(org.glassfish.jersey.server.monitoring.RequestEvent event) |
void |
registerSessionFactory(String name,
org.hibernate.SessionFactory sessionFactory)
Register a session factory with the given name.
|
public UnitOfWorkApplicationListener()
public UnitOfWorkApplicationListener(String name, org.hibernate.SessionFactory sessionFactory)
UnitOfWorkApplicationListener
should be added to a Jersey ResourceConfig
as a singleton.name
- a name of a Hibernate bundlesessionFactory
- a SessionFactory
public void registerSessionFactory(String name, org.hibernate.SessionFactory sessionFactory)
name
- a name of a Hibernate bundlesessionFactory
- a SessionFactory
public void onEvent(org.glassfish.jersey.server.monitoring.ApplicationEvent event)
onEvent
in interface org.glassfish.jersey.server.monitoring.ApplicationEventListener
public org.glassfish.jersey.server.monitoring.RequestEventListener onRequest(org.glassfish.jersey.server.monitoring.RequestEvent event)
onRequest
in interface org.glassfish.jersey.server.monitoring.ApplicationEventListener
Copyright © 2011. All rights reserved.