当前位置: 首页>>代码示例>>Java>>正文


Java RequestEventListener类代码示例

本文整理汇总了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();
  }
 
开发者ID:apache,项目名称:lens,代码行数:21,代码来源:LensApplicationListener.java

示例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;
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:8,代码来源:TimingApplicationEventListener.java

示例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();
}
 
开发者ID:tbugrara,项目名称:dropwizard-jooq,代码行数:15,代码来源:JooqTransactionalApplicationListenerTest.java

示例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();
}
 
开发者ID:tbugrara,项目名称:dropwizard-jooq,代码行数:14,代码来源:JooqTransactionalApplicationListenerTest.java

示例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();

}
 
开发者ID:tbugrara,项目名称:dropwizard-jooq,代码行数:14,代码来源:JooqTransactionalApplicationListenerTest.java

示例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);
}
 
开发者ID:scottescue,项目名称:dropwizard-entitymanager,代码行数:8,代码来源:UnitOfWorkApplicationListenerTest.java

示例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);
}
 
开发者ID:scottescue,项目名称:dropwizard-entitymanager,代码行数:9,代码来源:UnitOfWorkApplicationListenerTest.java

示例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);
}
 
开发者ID:minnal,项目名称:minnal,代码行数:10,代码来源:JerseyApplicationEventListenerTest.java

示例11: onRequest

import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public RequestEventListener onRequest(RequestEvent requestEvent) {
    return new MetricsRequestEventListener(meterRegistry, tagsProvider, metricName, autoTimeRequests, annotationFinder);
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:5,代码来源:MetricsApplicationEventListener.java

示例12: onRequest

import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public RequestEventListener onRequest(RequestEvent requestEvent) {
    return null;
}
 
开发者ID:sscholl,项目名称:biblebot,代码行数:5,代码来源:JerseyEndpointLoggingListener.java

示例13: onRequest

import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public RequestEventListener onRequest(RequestEvent requestEvent) {
    return new APIxRequestEventListener();
}
 
开发者ID:groovylabs,项目名称:lyre,代码行数:5,代码来源:APIxListener.java

示例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();
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:5,代码来源:ExceptionListener.java


注:本文中的org.glassfish.jersey.server.monitoring.RequestEventListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。