Examples of InstanceAdvisor


Examples of org.jboss.aop.InstanceAdvisor

         Object callingObject = ((CallerInvocation) invocation).getCallingObject();

         if (callingObject == null) return invocation.invokeNext(); // called from static method
        
         Advised advised = (Advised) callingObject;
         InstanceAdvisor advisor = advised._getInstanceAdvisor();
         Interceptor interceptor = (Interceptor) advisor.getPerInstanceAspect(aspectDefinition);
         return interceptor.invoke(invocation);        
        
      }
      else
      {
         Object targetObject = invocation.getTargetObject();
         if (targetObject == null) return invocation.invokeNext(); // static method call or static field call

         InstanceAdvisor instanceAdvisor = null;
         if (targetObject instanceof Advised)
         {
            Advised advised = (Advised) targetObject;
            instanceAdvisor = advised._getInstanceAdvisor();
         }
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor

         Object callingObject = ((CallerInvocation) invocation).getCallingObject();

         if (callingObject == null) return invocation.invokeNext(); // called from static method
        
         Advised advised = (Advised) callingObject;
         InstanceAdvisor advisor = advised._getInstanceAdvisor();
         aspect = advisor.getPerInstanceJoinpointAspect(joinpoint, aspectDefinition);
      }
      else
      {
         Object targetObject = invocation.getTargetObject();
         if (targetObject == null) return invocation.invokeNext(); // static method call or static field call

         InstanceAdvisor instanceAdvisor = null;
         if (targetObject instanceof Advised)
         {
            Advised advised = (Advised) targetObject;
            instanceAdvisor = advised._getInstanceAdvisor();
         }
         else
         {
            Advisor advisor = invocation.getAdvisor();
            if (advisor == null)
            {
               return invocation.invokeNext();
            }
            else if (advisor instanceof InstanceAdvisor)
            {
               instanceAdvisor = (InstanceAdvisor) advisor;
            }
            else if (advisor instanceof ClassProxyContainer && invocation instanceof ContainerProxyMethodInvocation)
            {
               ContainerProxyMethodInvocation pi = (ContainerProxyMethodInvocation)invocation;
               instanceAdvisor = pi.getProxy().getInstanceAdvisor();
            }
            else
            {
               return invocation.invokeNext();
            }
         }
         aspect = instanceAdvisor.getPerInstanceJoinpointAspect(joinpoint, aspectDefinition);
     
     
      if (!initialized)
      {
         init(adviceName, aspect.getClass());
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor

   void put(Fqn fqn, Object obj, String field) throws CacheException
   {
      CachedType type = cache.getCachedType(obj.getClass());

      InstanceAdvisor advisor = null;
      Interceptor interceptor = null;

      if (obj instanceof Advised)
      {
         advisor = ((Advised) obj)._getInstanceAdvisor();
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor

      catch (Exception e)
      {
         log.warn("Could not initialize final fields on object: " + ObjectUtil.identityString(obj));
      }

      InstanceAdvisor advisor = ((Advised) obj)._getInstanceAdvisor();
      CacheFieldInterceptor interceptor = new CacheFieldInterceptor(pCache_, fqn, type);
      interceptor.setAopInstance(pojoInstance);
      util_.attachInterceptor(obj, advisor, interceptor);
      return obj;
   }
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor

   void put(Fqn<?> fqn, Fqn<?> referencingFqn, Object obj) throws CacheException
   {
      CachedType type = pCache_.getCachedType(obj.getClass());
      // We have a clean slate then.
      InstanceAdvisor advisor = ((Advised) obj)._getInstanceAdvisor();
      // TODO workaround for deserialiased objects
      if (advisor == null)
      {
         advisor = new ClassInstanceAdvisor(obj);
         ((Advised) obj)._setInstanceAdvisor(advisor);
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor

   }

   Object remove(Fqn<?> fqn, Object result, Class<?> clazz) throws CacheException
   {
      CachedType type = pCache_.getCachedType(clazz);
      InstanceAdvisor advisor = ((Advised) result)._getInstanceAdvisor();
      for (Iterator i = type.getFields().iterator(); i.hasNext();)
      {
         Field field = (Field) (((FieldPersistentReference) i.next())).get();
         Object value = null;
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor

   private static ClassProxy createProxy(Class clazz, AbstractCollectionInterceptor interceptor)
           throws Exception
   {
      ClassProxy result = ClassProxyFactory.newInstance(clazz);
      InstanceAdvisor advisor = result._getInstanceAdvisor();
      advisor.appendInterceptor(interceptor);

      // Also take care of just toString()
      try
      {
         String bindName = clazz.getName() + ".toString";
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor

      return CollectionInterceptorUtil.createProxy(clazz, new CachedSetInterceptor(cache, fqn, clazz, obj));
   }

   public static AbstractCollectionInterceptor getInterceptor(ClassProxy proxy)
   {
      InstanceAdvisor advisor = proxy._getInstanceAdvisor();
      return (AbstractCollectionInterceptor) AopUtil.findCollectionInterceptor(advisor);
   }
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor

   }

   private Domain getInstanceDomain(Object obj)
   {
      Advised advised = ((Advised) obj);
      InstanceAdvisor advisor = advised._getInstanceAdvisor();
      return advisor.getDomain();
   }
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor

   private boolean isMultipleReferencedPut(Object obj)
   {
      Interceptor interceptor = null;
      if (obj instanceof Advised)
      {
         InstanceAdvisor advisor = ((Advised) obj)._getInstanceAdvisor();
         if (advisor == null)
         {
            throw new PojoCacheException("_putObject(): InstanceAdvisor is null for: " + obj);
         }
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.