Package org.jboss.errai.ioc.client.api

Examples of org.jboss.errai.ioc.client.api.Timed


  @Override
  public List<? extends Statement> generateDecorator(InjectableInstance<Timed> ctx) {
    try {
      final MetaClass beanClass = ctx.getEnclosingType();
      final Timed timed = ctx.getAnnotation();


      final Statement methodInvokation
          = InjectUtil.invokePublicOrPrivateMethod(ctx.getInjectionContext(), Refs.get("beanInstance"),
          ctx.getMethod());

      final org.jboss.errai.common.client.util.TimeUnit timeUnit = timed.timeUnit();
      final int interval = timed.interval();

      final Statement timerDecl
          = Stmt.nestedCall(Stmt.newObject(Timer.class).extend()
          .publicOverridesMethod("run")
          .append(methodInvokation)
          .finish().finish());

      final String timerVarName = InjectUtil.getUniqueVarName();
      final Statement timerVar = Stmt.declareFinalVariable(timerVarName, Timer.class, timerDecl);

      final List<Statement> statements = new ArrayList<Statement>();
      //  statements.add(timerVar);

      final Statement timerExec;
      switch (timed.type()) {
        case REPEATING:
          timerExec = Stmt.loadVariable(timerVarName).invoke("scheduleRepeating", timeUnit.toMillis(interval));
          break;
        default:
        case DELAYED:
View Full Code Here

TOP

Related Classes of org.jboss.errai.ioc.client.api.Timed

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.