Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*     */ package org.jboss.aop.microcontainer.lifecycle;
 /*     */ 
 /*     */ import java.io.StringReader;
 /*     */ import java.util.ArrayList;
 /*     */ import java.util.List;
 /*     */ import org.jboss.aop.Advisor;
 /*     */ import org.jboss.aop.pointcut.TypeMatcher;
 /*     */ import org.jboss.aop.pointcut.Util;
 /*     */ import org.jboss.aop.pointcut.ast.ASTStart;
/*     */ 
/*     */ public class LifecycleCallbackBinding
/*     */ {
/*     */   protected String name;
/*     */   protected ClassExpression classes;
/*     */   protected ASTStart ast;
/*     */   Object controllerState;
/*     */ 
/*     */   public LifecycleCallbackBinding(String nameString classStringString typeExpressionObject controllerState)
/*     */     throws Exception
/*     */   {
/*  71 */     this.name = name;
/*     */ 
/*  73 */     if ((classString == null) && (typeExpression == null))
/*     */     {
/*  75 */       throw new RuntimeException("Need either classString or typeExpression");
/*     */     }
/*  77 */     if ((classString != null) && (typeExpression != null))
/*     */     {
/*  79 */       throw new RuntimeException("Should not use both classString and typeExpression");
/*     */     }
/*     */ 
/*  82 */     if (classString != null)
/*     */     {
/*  84 */       this.classes = new ClassExpression(classString);
/*     */     }
/*  86 */     else if (typeExpression != null)
/*     */     {
/*  88 */       this.ast = new TypeExpressionParser(new StringReader(typeExpression)).Start();
/*     */     }
/*     */ 
/*  91 */     this.controllerState = controllerState;
/*     */   }
/*     */ 
/*     */   public String getName()
/*     */   {
/*  96 */     return this.name;
/*     */   }
/*     */ 
/*     */   public void addLifecycleCallback(String beanString installMethodString uninstallMethod)
/*     */   {
/* 101 */     this.lifecycleCallbackDefinitions.add(new LifecycleCallbackDefinition(bean, installMethod, uninstallMethod));
/*     */   }
/*     */ 
/*     */   {
/* 106 */     return this.lifecycleCallbackDefinitions;
/*     */   }
/*     */ 
/*     */   public boolean equals(Object obj)
/*     */   {
/* 111 */     if (obj == thisreturn true;
/* 112 */     if (!(obj instanceof LifecycleCallbackBinding)) return false;
/* 113 */     return ((LifecycleCallbackBinding)obj).getName().equals(this.name);
/*     */   }
/*     */ 
/*     */   public int hashCode()
/*     */   {
/* 118 */     return this.name.hashCode();
/*     */   }
/*     */ 
/*     */   public boolean matches(Advisor advisorClass clazz)
/*     */   {
/* 123 */     if (this.classes != null)
/*     */     {
/* 125 */       return Util.matchesClassExpr(this.classes, clazz, advisor);
/*     */     }
/*     */ 
/* 129 */     TypeMatcher matcher = new TypeMatcher(advisor, clazz);
/* 130 */     return ((Boolean)this.ast.jjtAccept(matcher, null)).booleanValue();
/*     */   }
/*     */ 
/*     */   public Object getControllerState()
/*     */   {
/* 136 */     return this.controllerState;
/*     */   }
/*     */ }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/jboss-embedded-all.jar
 * Qualified Name:     org.jboss.aop.microcontainer.lifecycle.LifecycleCallbackBinding
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X