Class ZkEventProcessDefinitionSourceImpl

  extended by
All Implemented Interfaces:
org.springframework.aop.framework.AopInfrastructureBean,, ZkEventProcessDefinitionSource

public class ZkEventProcessDefinitionSourceImpl
extends java.lang.Object
implements ZkEventProcessDefinitionSource

Default implementation of ZkEventProcessDefinitionSource.

Stores an ordered map of compiled Component paths and event name to ConfigAttributeDefinitions and provides Component path and event matching against the items stored in this map using the configured UrlMatcher.

The order of registering the regular expressions using the addSecureEvent(java.lang.String, java.lang.String, java.util.Collection) is very important. The matching is done per the following rules:

  1. The event-specific matches will take precedence over any Component paths which are registered without an event name.
  2. The system will identify the first matching expression for a given Component path. It will not proceed to evaluate later expressions if a match has already been found.
Accordingly, the most specific expressions should be registered first, with the most general regular expressions registered last.

See Also:

Field Summary
protected  org.apache.commons.logging.Log logger
Constructor Summary
ZkEventProcessDefinitionSourceImpl( pathMatcher)
ZkEventProcessDefinitionSourceImpl( pathMatcher, java.util.LinkedHashMap requestMap)
          Builds the internal request map from the supplied map.
Method Summary
 void addSecureEvent(java.lang.String path, java.lang.String event, java.util.Collection<> attr)
 java.util.Collection<> getAllConfigAttributes()
 java.util.Collection<> getAttributes(java.lang.Object object)
 java.util.Collection getConfigAttributeDefinitions()
 java.util.Collection<> lookupAttributes(java.lang.String path, java.lang.String event)
          Performs the actual lookup of the relevant ConfigAttributeDefinition for the specified Event.
 boolean supports(java.lang.Class clazz)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected final org.apache.commons.logging.Log logger
Constructor Detail


public ZkEventProcessDefinitionSourceImpl( pathMatcher)


public ZkEventProcessDefinitionSourceImpl( pathMatcher,
                                          java.util.LinkedHashMap requestMap)
Builds the internal request map from the supplied map. The key elements should be of type EventProcessKey, which contains a Component path and an event name (may be null). The path stored in the key will depend on the type of the supplied UrlMatcher.

pathMatcher - typically an ant or regular expression matcher.
requestMap - order-preserving map of .
Method Detail


public void addSecureEvent(java.lang.String path,
                           java.lang.String event,
                           java.util.Collection<> attr)


public java.util.Collection<> getAttributes(java.lang.Object object)
                                                                                        throws java.lang.IllegalArgumentException
Specified by:
getAttributes in interface


public java.util.Collection<> lookupAttributes(java.lang.String path,
                                                                                                  java.lang.String event)
Performs the actual lookup of the relevant ConfigAttributeDefinition for the specified Event.

By default, iterates through the stored Path map and calls the UrlMatcher.pathMatchesUrl(Object pattern, String path) method until a match is found.

Subclasses can override if required to perform any modifications to the path.

path - the Component path to retrieve configuration attributes for
event - the event name
the ConfigAttributeDefinition that applies to the specified Event or null if no match is foud


public java.util.Collection getConfigAttributeDefinitions()


public boolean supports(java.lang.Class clazz)
Specified by:
supports in interface


public java.util.Collection<> getAllConfigAttributes()
Specified by:
getAllConfigAttributes in interface

Copyright © 2005-2007 Potix Corporation. All Rights Reserved.