public class ContextSensitivePattern<DemandedModel extends Resource,C> extends ResourcePattern<DemandedModel>
ResourcePatternthat allows to pass a context (which can be any object) to the pattern immediately after calling the constructor. The
contextfield will be set by the framework if the pattern is created using any of the methods in
ResourcePattern.accept()method is called (when retrieving patterns from existing resources), respectively before the
init()method is called (when creating resources using the pattern class). Hence, the context can be used in these methods for initialization of the pattern. Note however, that the
ResourcePattern.accept()of a single pattern may be called multiple times by the framework.
|Modifier and Type||Method and Description|
Override this method to initialize the pattern.
accept, equals, hashCode, toString
public void init()
ResourcePatternAccess.createResource(String, Class, Object)or
ResourcePatternAccess.addDecorator(Resource, String, Class, Object), after the
contexthas been set.