• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RequestEventListener类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.glassfish.jersey.server.monitoring.RequestEventListener的典型用法代码示例。如果您正苦于以下问题:Java RequestEventListener类的具体用法?Java RequestEventListener怎么用?Java RequestEventListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RequestEventListener类属于org.glassfish.jersey.server.monitoring包,在下文中一共展示了RequestEventListener类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: onRequest

import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public RequestEventListener onRequest(final RequestEvent event) {
    return new UnitOfWorkEventListener(this.methodMap, this.bundles);
}
 
开发者ID:mtakaki,项目名称:CredentialStorageService-dw-hibernate,代码行数:5,代码来源:UnitOfWorkApplicationListener.java


示例17: onRequest

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


示例18: onRequest

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


示例19: onRequest

import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public RequestEventListener onRequest(RequestEvent requestEvent) {
    // Do nothing per request
    return null;
}
 
开发者ID:yahoo,项目名称:fili,代码行数:6,代码来源:QueryParameterNormalizationFilter.java


示例20: onRequest

import org.glassfish.jersey.server.monitoring.RequestEventListener; //导入依赖的package包/类
@Override
public RequestEventListener onRequest(RequestEvent requestEvent) {
	requestCounter++;
	LOG.info("Request " + requestCounter + " started.");
	return new LoggingRequestEventListener(requestCounter);
}
 
开发者ID:geneontology,项目名称:minerva,代码行数:7,代码来源:LoggingApplicationEventListener.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BasicHeader类代码示例发布时间:2022-05-21
下一篇:
Java NetworkLayer类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap