本文整理汇总了Java中org.glassfish.jersey.server.monitoring.RequestEventListener类的典型用法代码示例。如果您正苦于以下问题:Java RequestEventListener类的具体用法?Java RequestEventListener怎么用?Java RequestEventListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RequestEventListener类属于org.glassfish.jersey.server.monitoring包,在下文中一共展示了RequestEventListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRequest
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
/** The req listener. */
/*
* (non-Javadoc)
*
* @see
* org.glassfish.jersey.server.monitoring.ApplicationEventListener#onRequest(org.glassfish.jersey.server.monitoring
* .RequestEvent)
*/
@Override
public RequestEventListener onRequest(RequestEvent requestEvent) {
// Request start events are sent to application listener and not request listener
if (RequestEvent.Type.START == requestEvent.getType()) {
MetricsService metricsSvc = LensServices.get().getService(MetricsService.NAME);
if (metricsSvc != null) {
metricsSvc.incrCounter(LensRequestListener.class, LensRequestListener.HTTP_REQUESTS_STARTED);
}
}
return new LensRequestListener();
}
示例2: onRequest
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public RequestEventListener onRequest(RequestEvent event) {
if (Timer.enabled()) {
return new TimingRequestEventListener(nextReqId ++);
}
return null;
}
示例3: execute
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
private void execute() {
this.listener.onEvent(this.appEvent);
final RequestEventListener requestListener = this.listener
.onRequest(this.requestStartEvent);
requestListener.onEvent(this.requestMethodStartEvent);
requestListener.onEvent(this.responseFiltersStartEvent);
}
开发者ID:mtakaki,项目名称:CredentialStorageService-dw-hibernate,代码行数:8,代码来源:UnitOfWorkApplicationListenerTest.java
示例4: executeWithException
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
private void executeWithException() {
this.listener.onEvent(this.appEvent);
final RequestEventListener requestListener = this.listener
.onRequest(this.requestStartEvent);
requestListener.onEvent(this.requestMethodStartEvent);
requestListener.onEvent(this.requestMethodExceptionEvent);
}
开发者ID:mtakaki,项目名称:CredentialStorageService-dw-hibernate,代码行数:8,代码来源:UnitOfWorkApplicationListenerTest.java
示例5: commitsAndClosesOnSuccessfulFinish
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Test
public void commitsAndClosesOnSuccessfulFinish() throws SQLException, NoSuchMethodException {
prepareAppEvent("methodWithDefaultAnnotation");
listener.onEvent(appEvent);
RequestEventListener requestListener = listener.onRequest(requestStartEvent);
when(requestFinishEvent.isSuccess()).thenReturn(true);
requestListener.onEvent(requestFinishEvent);
verify(connection).commit();
verify(connection).close();
verify(connection, never()).rollback();
}
示例6: doesNotCommitOrCloseOnUnsuccessfulFinish
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Test
public void doesNotCommitOrCloseOnUnsuccessfulFinish() throws SQLException, NoSuchMethodException {
prepareAppEvent("methodWithDefaultAnnotation");
listener.onEvent(appEvent);
RequestEventListener requestListener = listener.onRequest(requestStartEvent);
when(requestFinishEvent.isSuccess()).thenReturn(false);
requestListener.onEvent(requestFinishEvent);
verify(connection, never()).commit();
verify(connection, never()).close();
}
示例7: rollbackAndCloseOnException
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Test
public void rollbackAndCloseOnException() throws SQLException, NoSuchMethodException {
prepareAppEvent("methodWithDefaultAnnotation");
listener.onEvent(appEvent);
RequestEventListener requestListener = listener.onRequest(requestStartEvent);
requestListener.onEvent(requestMethodExceptionEvent);
verify(connection).rollback();
verify(connection).close();
verify(connection, never()).commit();
}
示例8: execute
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
private void execute() {
listener.onEvent(appEvent);
RequestEventListener requestListener = listener.onRequest(requestStartEvent);
requestListener.onEvent(requestMethodStartEvent);
requestListener.onEvent(responseFiltersStartEvent);
requestListener.onEvent(responseFinishedEvent);
}
示例9: executeWithException
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
private void executeWithException() {
listener.onEvent(appEvent);
RequestEventListener requestListener = listener.onRequest(requestStartEvent);
requestListener.onEvent(requestMethodStartEvent);
requestListener.onEvent(requestMethodExceptionEvent);
requestListener.onEvent(responseFiltersStartEvent);
requestListener.onEvent(responseFinishedEvent);
}
示例10: shouldReturnOpenSessionInViewFilterOnRequestEvent
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Test
public void shouldReturnOpenSessionInViewFilterOnRequestEvent() {
DatabaseConfiguration configuration = mock(DatabaseConfiguration.class);
JerseyApplicationEventListener listener = new JerseyApplicationEventListener(configuration);
RequestEvent requestEvent = mock(RequestEvent.class);
RequestEventListener eventListener = listener.onRequest(requestEvent);
assertTrue(eventListener instanceof OpenSessionInViewFilter);
assertEquals(((OpenSessionInViewFilter)eventListener).getConfiguration(), configuration);
}
示例11: onRequest
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public RequestEventListener onRequest(RequestEvent requestEvent) {
return new MetricsRequestEventListener(meterRegistry, tagsProvider, metricName, autoTimeRequests, annotationFinder);
}
示例12: onRequest
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public RequestEventListener onRequest(RequestEvent requestEvent) {
return null;
}
示例13: onRequest
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public RequestEventListener onRequest(RequestEvent requestEvent) {
return new APIxRequestEventListener();
}
示例14: onRequest
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public synchronized RequestEventListener onRequest(RequestEvent requestEvent) {
return null;
}
开发者ID:durimkryeziu,项目名称:jersey-2.x-webapp-for-servlet-container,代码行数:5,代码来源:SampleApplicationEventListener.java
示例15: onRequest
import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public RequestEventListener onRequest(RequestEvent requestEvent) {
return new ExceptionRequestEventListener();
}