Examples of AdviceBinding


Examples of org.jboss.aop.advice.AdviceBinding

    */
   private synchronized AdviceBinding internalRemoveBinding(String name)
   {
      synchronized (bindings)
      {
         AdviceBinding binding = bindings.remove(name);
         if (binding == null)
         {
            return null;
         }
         Pointcut pointcut = binding.getPointcut();
         this.removePointcut(pointcut.getName());
         return binding;
      }
   }
View Full Code Here

Examples of org.jboss.aop.advice.AdviceBinding

   {
      Map<String, AdviceBinding> factories = manager.getBindings();
      StringBuffer buffer = new StringBuffer("");
      for (String name : factories.keySet())
      {
         AdviceBinding binding = factories.get(name);
         StringBuilder detail = new StringBuilder();
         if (binding != null)
         {
            detail.append(binding.getPointcut());
            detail.append("{");
            InterceptorFactory[] ifactories = binding.getInterceptorFactories();
            for (InterceptorFactory ifactory : ifactories)
            {
               detail.append(ifactory.getName());
            }
            detail.append("}");
View Full Code Here

Examples of org.jboss.aop.advice.AdviceBinding

     * @see org.jboss.profiler.AOPMonitoringServiceMBean#addPointcuts(java.lang.String)
     */
    private static final int ONE_MINUTE = 60000;

    public void addPointcut(String pointcutExpression) throws ParseException {
        AdviceBinding binding = new AdviceBinding("all("+pointcutExpression+")", null);
        binding.addInterceptor(MonitoringInterceptor.class);
        AspectManager.instance().addBinding(binding);
    }
View Full Code Here

Examples of org.jboss.aop.advice.AdviceBinding

    /* (non-Javadoc)
     * @see org.jboss.profiler.AOPProfilerServiceMBean#addPackage(java.lang.String)
     */
    public void addPointcut(String pointcutExpression) throws ParseException {
        AdviceBinding binding = new AdviceBinding("all("+pointcutExpression+")", null);
        binding.addInterceptor(ProfilerAgentInterceptor.class);
        AspectManager.instance().addBinding(binding);
    }
View Full Code Here

Examples of org.jboss.aop.advice.AdviceBinding

   @Override
   public synchronized void removeAdviceBindings(ArrayList<AdviceBinding> bindings)
   {
      for (int i = 0; i < bindings.size(); i++)
      {
         AdviceBinding binding = bindings.get(i);
         removeCallerPointcut(binding);
      }
      adviceBindings.removeAll(bindings);
      rebuildInterceptors();
      doesHaveAspects = adviceBindings.size() > 0;
View Full Code Here

Examples of org.jboss.aop.advice.AdviceBinding

   /**
    * Remove an interceptor pointcut with a given name
    */
   public void removeBinding(String name)
   {
      AdviceBinding binding = internalRemoveBinding(name);
      if (binding != null)
      {
         binding.clearAdvisors();
         dynamicStrategy.interceptorChainsUpdated();
      }
   }
View Full Code Here

Examples of org.jboss.aop.advice.AdviceBinding

    * Add an interceptor pointcut with a given name
    */
   public void addBinding(AdviceBinding binding)
   {
      Set<Advisor> affectedAdvisors = null;
      AdviceBinding removedBinding = null;
      synchronized(this)
      {
         removedBinding = internalRemoveBinding(binding.getName());
         affectedAdvisors = removedBinding == null ? null : new HashSet<Advisor>(removedBinding.getAdvisors());
         initPointcutsMap();
         initPointcutInfosMap();
         synchronized (pointcuts)
         {
            Pointcut pointcut = binding.getPointcut();
View Full Code Here

Examples of org.jboss.aop.advice.AdviceBinding

    */
   private synchronized AdviceBinding internalRemoveBinding(String name)
   {
      synchronized (bindingCollection)
      {
         AdviceBinding binding = bindingCollection.remove(name);
         if (binding == null)
         {
            return null;
         }
         Pointcut pointcut = binding.getPointcut();
         this.removePointcut(pointcut.getName());
         return binding;
      }
   }
View Full Code Here

Examples of org.jboss.aop.advice.AdviceBinding

   private void simplePopulateBindings(ArrayList<AdviceBinding> applicableBindings)
   {
      int size = bindings.size();
      for (int i = 0 ; i < size ; i++)
      {
         AdviceBinding binding = bindings.get(i);
         applyBinding(applicableBindings, binding);
      }
   }
View Full Code Here

Examples of org.jboss.aop.advice.AdviceBinding

      if (AspectManager.verbose && logger.isDebugEnabled()) logger.debug("populate bindings for " + info.getMethod() + " all bindings");
      int size = bindings.size();
      int minMatchLevel = 1000000;
      for (int i = 0 ; i < size ; i++)
      {
         AdviceBinding binding = bindings.get(i);
         PointcutMethodMatch match = pointcutMethodMatches.get(i);
         if (AspectManager.verbose && logger.isDebugEnabled()) logger.debug(match.getMatchLevel() + " " + match.getMatchedClass().getName() + " " + binding.getPointcut().getExpr() + " : " + binding.getInterceptorFactories().length);
        
         if (minMatchLevel > match.getMatchLevel() && !match.isInstanceOf())
         {
            minMatchLevel = match.getMatchLevel();
         }
      }

      if (AspectManager.verbose && logger.isDebugEnabled()) logger.debug("populate bindings for " + info.getMethod() + " actual bindings");
      for (int i = 0 ; i < size ; i++)
      {
         AdviceBinding binding = bindings.get(i);
         PointcutMethodMatch match = pointcutMethodMatches.get(i);
        
         if (match.isInstanceOf() || match.getMatchLevel() == minMatchLevel)
         {
            if (AspectManager.verbose && logger.isDebugEnabled()) logger.debug(match.getMatchLevel() + " " + match.getMatchedClass().getName() + " " + binding.getPointcut().getExpr() + " : " + binding.getInterceptorFactories().length);
            applyBinding(applicableBindings, binding);
         }
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.