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


Java AroundTimeout类代码示例

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


AroundTimeout类属于javax.interceptor包,在下文中一共展示了AroundTimeout类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: beanTimeoutAround

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
@AroundTimeout
public Object beanTimeoutAround(final InvocationContext context) throws Exception {
    synchronized (result) {
        assertNotNull(context.getTimer());
        result.add(Call.BEAN_BEFORE_AROUNDTIMEOUT);

        Object ret = null;
        try {
            ret = context.proceed();
        } catch (final Throwable t) {
            throw new Exception(t);
        } finally {
            result.add(Call.BEAN_AFTER_AROUNDTIMEOUT);
            countDownLatch.countDown();
        }

        return ret;
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:20,代码来源:ScheduleTest.java

示例2: aroundTimeout

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
@AroundTimeout
public Object aroundTimeout(InvocationContext ic) throws Exception {
	logger.info("Executing " + ic.getTimer());
	Object[] parameters = (Object[]) ic.getParameters();
	logger.info("parameters are: " + parameters.length);
	return ic.proceed();
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:8,代码来源:ExcludingInterceptor.java

示例3: intercept

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
@AroundTimeout
@AroundInvoke
public Object intercept( final InvocationContext context )
  throws Exception
{
  final long startTime = currentTimeMillis();
  Object result = null;
  Throwable exception = null;
  try
  {
    result = context.proceed();
    return result;
  }
  catch ( final Exception | Error e )
  {
    exception = e;
    throw e;
  }
  finally
  {
    //Should be able to run regardless of whether transaction in rollback
    final long endTime = currentTimeMillis();
    final String message =
      describeCall( context.getMethod(), context.getParameters(), result, exception );
    getAuditService().auditJobCall( getAuditContext().getUsername(),
                                    getJobTypeName( context ),
                                    new Date( startTime ),
                                    new Date( startTime ),
                                    new Date( endTime ),
                                    getAuditContext().getChangesNetworkCost(),
                                    getAuditContext().getResultNetworkCost(),
                                    message );
  }
}
 
开发者ID:stocksoftware,项目名称:iris-audit,代码行数:35,代码来源:AbstractLoggingInterceptor.java

示例4: testDeclaringInterceptorClass

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
/**
 * Should not get any failure message, as we explicitly configure the methods in the base class
 *
 * @return
 */
@Keys
public EjbJar testDeclaringInterceptorClass() {
    final EjbJar ejbJar = new EjbJar();
    final Interceptor subInterceptor = ejbJar.addInterceptor(new org.apache.openejb.jee.Interceptor(SubInterceptor.class));
    subInterceptor.getPostConstruct().add(new LifecycleCallback(BaseInterceptor.class.getName(), "interceptPostConstruct"));
    subInterceptor.getPreDestroy().add(new LifecycleCallback(BaseInterceptor.class.getName(), "interceptPreDestroy"));
    subInterceptor.getAroundInvoke().add(new org.apache.openejb.jee.AroundInvoke(BaseInterceptor.class.getName(), "interceptAroundInvoke"));
    subInterceptor.getAroundTimeout().add(new org.apache.openejb.jee.AroundTimeout(BaseInterceptor.class.getName(), "interceptAroundTimeout"));
    return ejbJar;
}
 
开发者ID:apache,项目名称:tomee,代码行数:16,代码来源:CheckInvalidInterceptorTest.java

示例5: beanTimeoutAround

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
@AroundTimeout
public Object beanTimeoutAround(final InvocationContext context) throws Exception {
    assertNotNull(context.getTimer());
    result.add(Call.BEAN_BEFORE_AROUNDTIMEOUT);
    final Object ret = context.proceed();
    result.add(Call.BEAN_AFTER_AROUNDTIMEOUT);
    return ret;
}
 
开发者ID:apache,项目名称:tomee,代码行数:9,代码来源:TimeoutAroundTest.java

示例6: interceptorTimeoutAround

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
@AroundTimeout
public Object interceptorTimeoutAround(final InvocationContext context) throws Exception {
    assertNotNull(context.getTimer());
    result.add(Call.INTERCEPTOR_BEFORE_AROUNDTIMEOUT);
    final Object ret = context.proceed();
    result.add(Call.INTERCEPTOR_AFTER_AROUNDTIMEOUT);
    return ret;
}
 
开发者ID:apache,项目名称:tomee,代码行数:9,代码来源:TimeoutAroundTest.java

示例7: meteredTimeout

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
@AroundTimeout
private Object meteredTimeout(InvocationContext context) throws Exception {
    return meteredCallable(context, context.getMethod());
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:5,代码来源:MeteredInterceptor.java

示例8: countedTimeout

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
@AroundTimeout
private Object countedTimeout(InvocationContext context) throws Exception {
    return countedCallable(context, context.getMethod());
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:5,代码来源:CountedInterceptor.java

示例9: timedTimeout

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
@AroundTimeout
private Object timedTimeout(InvocationContext context) throws Exception {
    return timedCallable(context, context.getMethod());
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:5,代码来源:TimedInterceptor.java

示例10: guaranteeConstructionComplete

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
@AroundTimeout
@AroundInvoke
private Object guaranteeConstructionComplete(InvocationContext context) throws Exception {
    construct.get();
    return context.proceed();
}
 
开发者ID:apache,项目名称:tomee,代码行数:7,代码来源:SlowStarter.java

示例11: AroundTimeout

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
public Method AroundTimeout() throws NoSuchMethodException {
    return this.getClass().getMethod("AroundTimeout");
}
 
开发者ID:apache,项目名称:tomee,代码行数:4,代码来源:StatsInterceptor.java

示例12: aroundTimeout

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
@AroundTimeout
public void aroundTimeout() {
}
 
开发者ID:apache,项目名称:tomee,代码行数:4,代码来源:CheckInvalidAroundTimeoutTest.java

示例13: interceptAroundTimeout

import javax.interceptor.AroundTimeout; //导入依赖的package包/类
@AroundTimeout
public void interceptAroundTimeout() {
}
 
开发者ID:apache,项目名称:tomee,代码行数:4,代码来源:CheckInvalidInterceptorTest.java


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