Örnek
Şöyle yaparız
import javax.annotation.Priority;import javax.decorator.Decorator;import javax.decorator.Delegate;import javax.enterprise.inject.Any;import javax.inject.Inject;import javax.interceptor.Interceptor;@Decorator@Priority(Interceptor.Priority.APPLICATION)public class Manager implements Worker {@Inject@Delegate@Anyprivate Worker worker;@Overridepublic String work(String job) {return "will delegate to a programmer -> " + worker.work(job);}}
Hiç yorum yok:
Yorum Gönder