Tabnine Logo
OperationTracker.run
Code IndexAdd Tabnine to your IDE (free)

How to use
run
method
in
org.apache.tapestry5.ioc.OperationTracker

Best Java code snippets using org.apache.tapestry5.ioc.OperationTracker.run (Showing top 20 results out of 315)

origin: org.apache.tapestry/tapestry-ioc

  @Override
  public void advise(MethodInvocation invocation)
  {
    tracker.run(description, toRunnable(invocation));
  }
}
origin: org.apache.tapestry/tapestry-ioc

@Override
public void run(String description, Runnable operation)
{
  operationTracker.run(description, operation);
}
origin: apache/tapestry-5

  @Override
  public void advise(MethodInvocation invocation)
  {
    tracker.run(description, toRunnable(invocation));
  }
}
origin: apache/tapestry-5

@Override
public void run(String description, Runnable operation)
{
  operationTracker.run(description, operation);
}
origin: apache/tapestry-5

public void run(String description, Runnable operation)
{
  tracker.run(description, operation);
}
origin: org.apache.tapestry/tapestry-webresources

private void loadScript(final Context context, final ScriptableObject scope, final Resource script)
{
  tracker.run(String.format("Loading script %s.", script),
      new Runnable()
      {
        @Override
        public void run()
        {
          InputStream in = null;
          Reader r = null;
          try
          {
            in = script.openStream();
            r = new InputStreamReader(in, "UTF-8");
            context.evaluateReader(scope, r, script.toString(), 1, null);
          } catch (IOException ex)
          {
            throw new RuntimeException(String.format("Unable to read script %s: %s",
                script,
                ExceptionUtils.toMessage(ex)
            ), ex);
          } finally
          {
            InternalUtils.close(r);
            InternalUtils.close(in);
          }
        }
      });
}
origin: apache/tapestry-5

@Override
public void advise(MethodInvocation invocation)
{
  Object[] parameters = extractParameters(invocation);
  String description = String.format(format, parameters);
  tracker.run(description, toRunnable(invocation));
}
origin: org.apache.tapestry/tapestry-ioc

@Override
public void advise(MethodInvocation invocation)
{
  Object[] parameters = extractParameters(invocation);
  String description = String.format(format, parameters);
  tracker.run(description, toRunnable(invocation));
}
origin: org.apache.tapestry/tapestry-ioc

  private void executeInitializationPLans(final T newInstance)
  {
    for (final InitializationPlan<T> plan : initializationPlans)
    {
      tracker.run(plan.getDescription(), new Runnable()
      {
        @Override
        public void run()
        {
          plan.initialize(newInstance);
        }
      });
    }
  }
}
origin: apache/tapestry-5

  private void executeInitializationPLans(final T newInstance)
  {
    for (final InitializationPlan<T> plan : initializationPlans)
    {
      tracker.run(plan.getDescription(), new Runnable()
      {
        @Override
        public void run()
        {
          plan.initialize(newInstance);
        }
      });
    }
  }
}
origin: org.apache.tapestry/tapestry-ioc

@Override
public void run(String description, Runnable operation)
{
  try
  {
    get().run(description, operation);
  } finally
  {
    cleanup();
  }
}
origin: apache/tapestry-5

@Override
public void run(String description, Runnable operation)
{
  try
  {
    get().run(description, operation);
  } finally
  {
    cleanup();
  }
}
origin: org.apache.tapestry/tapestry-ioc

private <T> void addToOrderedConfiguration(Orderer<T> orderer,
                      Map<String, OrderedConfigurationOverride<T>> overrides, Class<T> valueType, ServiceDef3 serviceDef,
                      final Module module)
{
  String serviceId = serviceDef.getServiceId();
  Set<ContributionDef2> contributions = module.getContributorDefsForService(serviceDef);
  if (contributions.isEmpty())
    return;
  Logger logger = getServiceLogger(serviceId);
  final ServiceResources resources = new ServiceResourcesImpl(this, module, serviceDef, proxyFactory, logger);
  for (final ContributionDef def : contributions)
  {
    final OrderedConfiguration<T> validating = new ValidatingOrderedConfigurationWrapper<T>(valueType,
        resources, typeCoercerProxy, orderer, overrides, def);
    String description = "Invoking " + def;
    logger.debug(description);
    operationTracker.run(description, new Runnable()
    {
      @Override
      public void run()
      {
        def.contribute(module, resources, validating);
      }
    });
  }
}
origin: org.apache.tapestry/tapestry-ioc

private <T> void addToUnorderedConfiguration(Collection<T> collection, Class<T> valueType, ServiceDef3 serviceDef,
                       final Module module)
{
  String serviceId = serviceDef.getServiceId();
  Set<ContributionDef2> contributions = module.getContributorDefsForService(serviceDef);
  if (contributions.isEmpty())
    return;
  Logger logger = getServiceLogger(serviceId);
  final ServiceResources resources = new ServiceResourcesImpl(this, module, serviceDef, proxyFactory, logger);
  for (final ContributionDef def : contributions)
  {
    final Configuration<T> validating = new ValidatingConfigurationWrapper<T>(valueType, resources,
        typeCoercerProxy, collection, serviceId);
    String description = "Invoking " + def;
    logger.debug(description);
    operationTracker.run(description, new Runnable()
    {
      @Override
      public void run()
      {
        def.contribute(module, resources, validating);
      }
    });
  }
}
origin: apache/tapestry-5

private <K, V> void addToMappedConfiguration(Map<K, V> map, Map<K, MappedConfigurationOverride<K, V>> overrides,
                       Map<K, ContributionDef> keyToContribution, Class<K> keyClass, Class<V> valueType, ServiceDef3 serviceDef,
                       final Module module)
{
  String serviceId = serviceDef.getServiceId();
  Set<ContributionDef2> contributions = module.getContributorDefsForService(serviceDef);
  if (contributions.isEmpty())
    return;
  Logger logger = getServiceLogger(serviceId);
  final ServiceResources resources = new ServiceResourcesImpl(this, module, serviceDef, proxyFactory, logger);
  for (final ContributionDef def : contributions)
  {
    final MappedConfiguration<K, V> validating = new ValidatingMappedConfigurationWrapper<K, V>(valueType,
        resources, typeCoercerProxy, map, overrides, serviceId, def, keyClass, keyToContribution);
    String description = "Invoking " + def;
    logger.debug(description);
    operationTracker.run(description, new Runnable()
    {
      @Override
      public void run()
      {
        def.contribute(module, resources, validating);
      }
    });
  }
}
origin: org.apache.tapestry/tapestry-ioc

private <K, V> void addToMappedConfiguration(Map<K, V> map, Map<K, MappedConfigurationOverride<K, V>> overrides,
                       Map<K, ContributionDef> keyToContribution, Class<K> keyClass, Class<V> valueType, ServiceDef3 serviceDef,
                       final Module module)
{
  String serviceId = serviceDef.getServiceId();
  Set<ContributionDef2> contributions = module.getContributorDefsForService(serviceDef);
  if (contributions.isEmpty())
    return;
  Logger logger = getServiceLogger(serviceId);
  final ServiceResources resources = new ServiceResourcesImpl(this, module, serviceDef, proxyFactory, logger);
  for (final ContributionDef def : contributions)
  {
    final MappedConfiguration<K, V> validating = new ValidatingMappedConfigurationWrapper<K, V>(valueType,
        resources, typeCoercerProxy, map, overrides, serviceId, def, keyClass, keyToContribution);
    String description = "Invoking " + def;
    logger.debug(description);
    operationTracker.run(description, new Runnable()
    {
      @Override
      public void run()
      {
        def.contribute(module, resources, validating);
      }
    });
  }
}
origin: apache/tapestry-5

private <T> void addToUnorderedConfiguration(Collection<T> collection, Class<T> valueType, ServiceDef3 serviceDef,
                       final Module module)
{
  String serviceId = serviceDef.getServiceId();
  Set<ContributionDef2> contributions = module.getContributorDefsForService(serviceDef);
  if (contributions.isEmpty())
    return;
  Logger logger = getServiceLogger(serviceId);
  final ServiceResources resources = new ServiceResourcesImpl(this, module, serviceDef, proxyFactory, logger);
  for (final ContributionDef def : contributions)
  {
    final Configuration<T> validating = new ValidatingConfigurationWrapper<T>(valueType, resources,
        typeCoercerProxy, collection, serviceId);
    String description = "Invoking " + def;
    logger.debug(description);
    operationTracker.run(description, new Runnable()
    {
      @Override
      public void run()
      {
        def.contribute(module, resources, validating);
      }
    });
  }
}
origin: apache/tapestry-5

  public void transform(final PlasticClass plasticClass, TransformationSupport support, final MutableComponentModel model)
  {
    for (final PlasticField field : F.flow(plasticClass.getUnclaimedFields()).filter(MATCHER))
    {
      final String fieldName = field.getName();

      tracker.run(String.format("Injecting field  %s.%s", plasticClass.getClassName(), fieldName), new Runnable()
      {
        public void run()
        {
          try
          {
            boolean success = injectionProvider.provideInjection(field, locator, model);

            if (success)
            {
              field.claim("@Inject");
            }
          } catch (RuntimeException ex)
          {
            throw new RuntimeException(String.format("Error obtaining injected value for field %s.%s: %s", plasticClass.getClassName(), fieldName, ExceptionUtils.toMessage(ex)), ex);
          }
        }
      });
    }
  }
}
origin: apache/tapestry-5

  public void handlePageRender(final PageRenderRequestParameters parameters, final ComponentRequestHandler handler) throws IOException
  {
    final Holder<IOException> holder = Holder.create();

    tracker.run("Handling page render request for page " + parameters.getLogicalPageName(),
        new Runnable()
        {
          public void run()
          {
            try
            {
              handler.handlePageRender(parameters);
            } catch (IOException e)
            {
              holder.put(e);
            }
          }
        }
    );

    if (holder.hasValue())
    {
      throw holder.get();
    }
  }
}
origin: apache/tapestry-5

  public void advise(final MethodInvocation invocation)
  {
    final ComponentEvent event = (ComponentEvent) invocation.getParameter(0);
    boolean matches = !event.isAborted() && event.matches(eventType, "", minContextValues);
    if (matches)
    {
      tracker.run(operationDescription, new Runnable()
      {
        public void run()
        {
          Component instance = (Component) invocation.getInstance();
          handler.handleEvent(instance, event);
        }
      });
    }
    // Order of operations is key here. This logic takes precedence; base class event dispatch and event handler methods
    // in the class come AFTER.
    invocation.proceed();
    if (matches)
    {
      invocation.setReturnValue(true);
    }
  }
}
org.apache.tapestry5.iocOperationTrackerrun

Javadoc

Executes the operation. If the operation throws a RuntimeException it will be logged and rethrown wrapped as a org.apache.tapestry5.ioc.internal.OperationException.

Popular methods of OperationTracker

  • invoke
    As with #run(String,Runnable), but the operation may return a value.
  • perform
    As with #invoke(String,Invokable), but the operation may throw an java.io.IOException.

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now