|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfun.yan.Component
jfun.yan.DelegatingComponent
jfun.yan.DecoratingComponent
public abstract class DecoratingComponent
Base class for component decorators that do not change the result returned from the target component it decorates and causes no side-effect by itself other than those caused by the target component.
Some decorator classes of Component may want to forward calls to singleton(), guard(), proxy() to the Component that it delegates and then re-decorate the result.
This class provides the basic facility for this logic. Implement the decorate() method and this class will forward and re-decorate for you.
Use it with caution because it could cause infinite loop if used inappropriately
Codehaus.org.
| Constructor Summary | |
|---|---|
DecoratingComponent(Component cc)
Create a new DeleratingComponent object. |
|
| Method Summary | |
|---|---|
protected abstract Component |
decorate(Component c)
Decorate a Component object. |
Component |
guard()
Decorate this Component so that the new Component object guards against infinite dependency loop. |
boolean |
isSingleton()
Determines if the component always return the same instance and has no side-effect that causes difference when called the second time. |
Component |
proxy()
Create a new Component object that uses dynamic proxy to transform the return value 'this' Component creates to a dynamic proxy. |
Component |
proxy(java.lang.Class itf)
Create a new Component object that uses dynamic proxy to transform the return value 'this' Component creates to a dynamic proxy. |
Component |
proxy(java.lang.Class[] itfs)
Create a new Component object that uses dynamic proxy to transform the return value 'this' Component creates to a dynamic proxy. |
Component |
singleton()
Create a new Component that utilizes singleton pattern when creating instance. |
Component |
singleton(Pool scope)
Create a new Component that utilizes singleton pattern within a scope specified by the provided Pool object when creating instance. |
| Methods inherited from class jfun.yan.DelegatingComponent |
|---|
create, equals, getDelegateTarget, getState, getType, hashCode, isConcrete, toString, verify |
| Methods inherited from class jfun.yan.Component |
|---|
bean, bean, bean, bind, bind, bindArgument, bindArguments, bindProperties, bindProperty, cast, factory, factory, factory, factory, factory, field, field, field, followedBy, followedBy, followedBy, fromArguments, fromProperties, getter, getter, ifelse, ignoreProperty, incomplete, label, label, map, method, method, method, method, method, mutate, option, optional, optionalParameter, optionalParameters, optionalProperties, optionalProperty, recover, repeat, seal, seq, setter, setter, subsume, synchronize, withArgument, withArgument, withArguments, withArguments, withDefaultArgument, withDefaultProperty, withProperties, withProperties, withProperties, withProperty, withProperty, withState |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DecoratingComponent(Component cc)
cc - the Component object to decorate.| Method Detail |
|---|
protected abstract Component decorate(Component c)
c - the Component to decorate.
public Component singleton()
Component
singleton in class Componentpublic Component singleton(Pool scope)
Component
singleton in class Componentscope - the scope of the singleton pattern.
public Component guard()
Component
guard in class Componentpublic Component proxy()
Component
proxy in class Componentpublic Component proxy(java.lang.Class itf)
Component
proxy in class Componentitf - the interface to proxy to.
public Component proxy(java.lang.Class[] itfs)
Component
proxy in class Componentitfs - the interfaces to proxy to.
public boolean isSingleton()
CreatorThis information may be useful to certain optimizations.
isSingleton in interface CreatorisSingleton in class DelegatingComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||