1 8 14 package jfun.yan; 15 16 import jfun.yan.factory.Pool; 17 18 42 public abstract class DecoratingComponent extends DelegatingComponent { 43 44 48 public DecoratingComponent(Component cc) { 49 super(cc); 50 } 51 56 protected abstract Component decorate(Component c); 57 public Component singleton(){ 58 final Component result = decorate(getDelegateTarget().singleton()); 59 return result; } 61 public Component singleton(Pool scope){ 62 final Component result = decorate(getDelegateTarget().singleton(scope)); 63 return result; } 65 public Component guard(){ 66 return decorate(getDelegateTarget().guard()); 67 } 68 public Component proxy(){ 69 return decorate(getDelegateTarget().proxy()); 70 } 71 public Component proxy(Class itf){ 72 return decorate(getDelegateTarget().proxy(itf)); 73 } 74 public Component proxy(Class [] itfs){ 75 return decorate(getDelegateTarget().proxy(itfs)); 76 } 77 public boolean isSingleton(){ 78 return getDelegateTarget().isSingleton(); 79 } 80 } 81 | Popular Tags |