Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*     */ package org.jboss.aop;
  /*     */ 
  /*     */ import java.lang.ref.WeakReference;
  /*     */ import java.util.ArrayList;
  /*     */ import org.jboss.aop.advice.Interceptor;
  /*     */ import org.jboss.aop.joinpoint.JoinPointBean;
  /*     */ import org.jboss.aop.joinpoint.Joinpoint;
  /*     */ import org.jboss.aop.metadata.SimpleMetaData;
 /*     */ 
 /*     */ public abstract class JoinPointInfo
 /*     */   implements JoinPointBean
 /*     */ {
 /*     */   private Interceptor[] interceptors;
 /*  36 */   private ArrayList interceptorChain = new ArrayList();
 /*     */   private WeakReference advisor;
 /*     */   protected volatile Joinpoint joinpoint;
 /*     */   protected WeakReference clazz;
 /*     */   private String adviceString;
 /*     */ 
 /*     */   protected JoinPointInfo()
 /*     */   {
 /*  48 */     this. = new WeakReference(null);
 /*     */   }
 /*     */ 
 /*     */   protected JoinPointInfo(Advisor advisorClass clazz)
 /*     */   {
 /*  53 */     setAdvisor(advisor);
 /*  54 */     this. = new WeakReference(clazz);
 /*     */   }
 /*     */ 
 /*     */   protected JoinPointInfo(JoinPointInfo other)
 /*     */   {
 /*  62 */     this. = other.advisor;
 /*  63 */     this. = other.clazz;
 /*  64 */     if (other.interceptors != null)
 /*     */     {
 /*  66 */       this. = new Interceptor[other.interceptors.length];
 /*  67 */       System.arraycopy(other.interceptors, 0, this., 0, other.interceptors.length);
 /*     */     }
 /*  69 */     if (other.interceptorChain != nullthis..addAll(this.);
 /*     */   }
 /*     */ 
 /*     */   protected void clear()
 /*     */   {
 /*  74 */     this..clear();
 /*  75 */     this. = null;
 /*     */   }
 /*     */ 
 /*     */   public Advisor getAdvisor()
 /*     */   {
 /*  80 */     if (this. == null)
 /*     */     {
 /*  82 */       return null;
 /*     */     }
 /*  84 */     return (Advisor)this..get();
 /*     */   }
 /*     */ 
 /*     */   public Class getClazz()
 /*     */   {
 /*  89 */     return (Class)this..get();
 /*     */   }
 /*     */ 
 /*     */   public void setAdvisor(Advisor advisor)
 /*     */   {
 /*  94 */     this. = new WeakReference(advisor);
 /*     */   }
 /*     */ 
 /*     */   public boolean hasAdvices()
 /*     */   {
 /*  99 */     return (this. != null) && (this..length > 0);
 /*     */   }
 /*     */ 
 /*     */   public boolean equalChains(JoinPointInfo other)
 /*     */   {
 /* 104 */     if ((this. == null) && (other.interceptors == null)) return true;
 /* 105 */     if ((this. == null) || (other.interceptors == null)) return false;
 /* 106 */     if (this..length != other.interceptors.lengthreturn false;
 /*     */ 
 /* 108 */     for (int i = 0; i < this..lengthi++)
 /*     */     {
 /* 110 */       if (!this.[i].equals(other.interceptors[i])) return false;
 /*     */     }
 /*     */ 
 /* 113 */     return true;
 /*     */   }
 /*     */ 
 /*     */   public Joinpoint getJoinpoint()
 /*     */   {
 /* 118 */     if (this. == null)
 /*     */     {
 /* 120 */       this. = internalGetJoinpoint();
 /*     */     }
 /* 122 */     return this.;
 /*     */   }
 /*     */ 
 /*     */   public ArrayList getInterceptorChain() {
 /* 126 */     return this.;
 /*     */   }
/*     */ 
/*     */   public Interceptor[] getInterceptors() {
/* 130 */     return this.;
/*     */   }
/*     */ 
/*     */   public void setInterceptors(Interceptor[] interceptors) {
/* 134 */     this. = null;
/* 135 */     this. = interceptors;
/*     */   }
/*     */   protected abstract Joinpoint internalGetJoinpoint();
/*     */ 
/*     */   public abstract JoinPointInfo copy();
/*     */ 
/* 143 */   public Object resolveClassMetaData(Object keyObject attr) { return getAdvisor().getClassMetaData().getMetaData(keyattr);
/*     */   }
/*     */ 
/*     */   public Object resolveClassAnnotation(Class annotation)
/*     */   {
/* 148 */     Advisor advisor = getAdvisor();
/* 149 */     if (advisor != null)
/*     */     {
/* 151 */       return advisor.resolveAnnotation(annotation);
/*     */     }
/* 153 */     return null;
/*     */   }
/*     */ 
/*     */   public Object resolveAnnotation(Class annotation)
/*     */   {
/* 158 */     return null;
/*     */   }
/*     */ 
/*     */   public void cloneChains(JoinPointInfo other)
/*     */   {
/* 163 */     this. = ((ArrayList)other.interceptorChain.clone());
/* 164 */     if (other.interceptors == null)
/*     */     {
/* 166 */       this. = null;
/*     */     }
/*     */     else
/*     */     {
/* 170 */       this. = ((Interceptor[])other.interceptors.clone());
/*     */     }
/*     */   }
/*     */ 
/*     */   public String getAdviceString()
/*     */   {
/* 176 */     if (this. == null)
/*     */     {
/* 178 */       if ((this. == null) || (this..length == 0))
/*     */       {
/* 180 */         return "";
/*     */       }
/*     */ 
/* 183 */       StringBuffer buf = new StringBuffer();
/* 184 */       for (int i = 0; i < this..lengthi++)
/*     */       {
/* 186 */         if (i > 0)
/*     */         {
/* 188 */           buf.append(",");
/*     */         }
/*     */ 
/* 191 */         GeneratedAdvisorInterceptor icptr = (GeneratedAdvisorInterceptor)this.[i];
/* 192 */         buf.append(icptr.getAdviceString());
/*     */       }
/*     */ 
/* 195 */       return buf.toString();
/*     */     }
/*     */ 
/* 198 */     return this.;
/*     */   }
/*     */ }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/jboss-embedded-all.jar
 * Qualified Name:     org.jboss.aop.JoinPointInfo
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X