public void compose(ComponentManager manager) throws ComponentException {
this.manager = manager;
setSelector((ComponentSelector)manager.lookup(Matcher.ROLE + "Selector"));
// Prepare the pattern, and keep matcher if ThreadSafe
PreparableMatcher matcher = (PreparableMatcher)selector.select(componentName);
if (matcher instanceof ThreadSafe) {
this.threadSafeMatcher = matcher;
}
try {
this.preparedPattern = matcher.preparePattern(this.pattern);
} catch(PatternException pe) {
String msg = "Invalid pattern '" + this.pattern + "' for matcher at " + this.getLocation();
throw new ComponentException(null, msg, pe);