1
package org.hisp.dhis.webwork.configuration;
4
* This is a modified com.opensymphony.xwork.config.XmlConfigurationProvider.
5
* The modification makes it possible to load xwork.xml files from inside JAR
8
* What kind of license should be put here?
11
import java.io.IOException;
12
import java.io.InputStream;
13
import java.lang.reflect.Modifier;
14
import java.net.MalformedURLException;
16
import java.util.ArrayList;
17
import java.util.HashMap;
18
import java.util.Iterator;
19
import java.util.LinkedHashMap;
20
import java.util.List;
23
import java.util.TreeSet;
25
import org.apache.commons.logging.Log;
26
import org.apache.commons.logging.LogFactory;
27
import org.w3c.dom.Document;
28
import org.w3c.dom.Element;
29
import org.w3c.dom.Node;
30
import org.w3c.dom.NodeList;
31
import org.xml.sax.InputSource;
33
import com.opensymphony.util.ClassLoaderUtil;
34
import com.opensymphony.util.FileManager;
35
import com.opensymphony.util.TextUtils;
36
import com.opensymphony.xwork.Action;
37
import com.opensymphony.xwork.ActionSupport;
38
import com.opensymphony.xwork.ObjectFactory;
39
import com.opensymphony.xwork.XworkException;
40
import com.opensymphony.xwork.config.Configuration;
41
import com.opensymphony.xwork.config.ConfigurationException;
42
import com.opensymphony.xwork.config.ConfigurationProvider;
43
import com.opensymphony.xwork.config.ConfigurationUtil;
44
import com.opensymphony.xwork.config.ExternalReferenceResolver;
45
import com.opensymphony.xwork.config.entities.ActionConfig;
46
import com.opensymphony.xwork.config.entities.ExceptionMappingConfig;
47
import com.opensymphony.xwork.config.entities.ExternalReference;
48
import com.opensymphony.xwork.config.entities.InterceptorConfig;
49
import com.opensymphony.xwork.config.entities.InterceptorStackConfig;
50
import com.opensymphony.xwork.config.entities.PackageConfig;
51
import com.opensymphony.xwork.config.entities.ResultConfig;
52
import com.opensymphony.xwork.config.entities.ResultTypeConfig;
53
import com.opensymphony.xwork.config.providers.InterceptorBuilder;
54
import com.opensymphony.xwork.config.providers.XmlHelper;
55
import com.opensymphony.xwork.util.DomHelper;
56
import com.opensymphony.xwork.util.location.Location;
59
* @version $Id: UrlXmlConfigurationProvider.java 6335 2008-11-20 11:11:26Z larshelg $
61
@SuppressWarnings( { "unused", "unchecked" } )
62
public class UrlXmlConfigurationProvider
63
implements ConfigurationProvider
65
private static final Log LOG = LogFactory.getLog( UrlXmlConfigurationProvider.class );
67
private Configuration configuration;
69
private Set includedFileNames = new TreeSet();
71
private String configFileName = "xwork.xml";
73
public UrlXmlConfigurationProvider( String filename )
75
this.configFileName = filename;
78
public UrlXmlConfigurationProvider( String filename, ClassLoader loader )
80
this.configFileName = filename;
87
public boolean equals( Object o )
94
if ( !(o instanceof UrlXmlConfigurationProvider) )
99
final UrlXmlConfigurationProvider UrlXmlConfigurationProvider = (UrlXmlConfigurationProvider) o;
101
if ( (configFileName != null) ? (!configFileName.equals( UrlXmlConfigurationProvider.configFileName ))
102
: (UrlXmlConfigurationProvider.configFileName != null) )
110
public int hashCode()
112
return ((configFileName != null) ? configFileName.hashCode() : 0);
115
public void init( Configuration configuration )
117
this.configuration = configuration;
118
includedFileNames.clear();
122
loadConfigurationFile( configFileName, null );
124
catch ( ConfigurationException e )
128
catch ( Exception e )
130
LOG.fatal( "Could not load XWork configuration file, failing", e );
131
throw new ConfigurationException( "Error loading configuration file " + configFileName, e );
136
* Tells whether the ConfigurationProvider should reload its configuration.
137
* This method should only be called if
138
* ConfigurationManager.isReloadingConfigs() is true.
140
* @return true if the file has been changed since the last time we read it
142
public boolean needsReload()
144
boolean needsReload = FileManager.fileNeedsReloading( configFileName );
145
Iterator fileNameIterator = includedFileNames.iterator();
147
while ( !needsReload && (fileNameIterator.hasNext()) )
149
String fileName = (String) fileNameIterator.next();
150
needsReload = FileManager.fileNeedsReloading( fileName );
156
protected InputStream getInputStream( String fileName )
157
throws ConfigurationException
161
URL url = new URL( fileName );
162
return url.openStream();
164
catch ( MalformedURLException e )
166
return FileManager.loadFile( fileName, this.getClass() );
168
catch ( IOException e )
170
throw new ConfigurationException( "The source of " + fileName + " is not accsesable.", e );
174
protected void addAction( Element actionElement, PackageConfig packageContext )
175
throws ConfigurationException
177
String name = actionElement.getAttribute( "name" );
178
String className = actionElement.getAttribute( "class" );
179
String methodName = actionElement.getAttribute( "method" );
180
Location location = DomHelper.getLocationObject( actionElement );
182
// methodName should be null if it's not set
183
methodName = (methodName.trim().length() > 0) ? methodName.trim() : null;
185
// if you don't specify a class on <action/>, it defaults to
187
if ( !TextUtils.stringSet( className ) )
189
className = ActionSupport.class.getName();
192
if ( !verifyAction( className, name, location ) )
197
Map actionParams = XmlHelper.getParams( actionElement );
203
results = buildResults( actionElement, packageContext );
205
catch ( ConfigurationException e )
207
throw new ConfigurationException( "Error building results for action " + name + " in namespace "
208
+ packageContext.getNamespace(), e, actionElement );
211
List interceptorList = buildInterceptorList( actionElement, packageContext );
213
List externalrefs = buildExternalRefs( actionElement, packageContext );
215
List exceptionMappings = buildExceptionMappings( actionElement, packageContext );
217
ActionConfig actionConfig = new ActionConfig( methodName, className, actionParams, results, interceptorList,
218
externalrefs, exceptionMappings, packageContext.getName() );
219
actionConfig.setLocation( location );
220
packageContext.addActionConfig( name, actionConfig );
222
if ( LOG.isDebugEnabled() )
225
+ (TextUtils.stringSet( packageContext.getNamespace() ) ? (packageContext.getNamespace() + "/") : "")
226
+ name + " in '" + packageContext.getName() + "' package:" + actionConfig );
230
protected boolean verifyAction( String className, String name, Location loc )
234
Class clazz = ObjectFactory.getObjectFactory().getClassInstance( className );
235
if ( ObjectFactory.getObjectFactory().isNoArgConstructorRequired() )
237
if ( !Modifier.isPublic( clazz.getModifiers() ) )
239
LOG.error( "Action class [" + className + "] is not public, skipping action [" + name + "]" );
242
clazz.getConstructor( new Class[] {} );
246
catch ( ClassNotFoundException e )
248
LOG.error( "Action class [" + className + "] not found, skipping action [" + name + "] at " + loc, e );
251
catch ( NoSuchMethodException e )
253
LOG.error( "Action class [" + className + "] does not have a public no-arg constructor,"
254
+ " skipping action [" + name + "] at " + loc, e );
257
catch ( Exception ex )
259
throw new ConfigurationException( ex, loc );
264
* Create a PackageConfig from an XML element representing it.
266
protected void addPackage( Element packageElement )
267
throws ConfigurationException
269
PackageConfig newPackage = buildPackageContext( packageElement );
271
// Check for allready existing configurations ..
272
PackageConfig check = configuration.getPackageConfig( newPackage.getName() );
275
if ( LOG.isDebugEnabled() )
277
LOG.debug( "Package is allready loaded! " + newPackage.getName() );
282
if ( LOG.isDebugEnabled() )
284
LOG.debug( "Loaded " + newPackage );
287
// add result types (and default result) to this package
288
addResultTypes( newPackage, packageElement );
290
// load the interceptors and interceptor stacks for this package
291
loadInterceptors( newPackage, packageElement );
293
// load the default interceptor reference for this package
294
loadDefaultInterceptorRef( newPackage, packageElement );
296
// load the global result list for this package
297
loadGlobalResults( newPackage, packageElement );
299
// load the global exception handler list for this package
300
loadGobalExceptionMappings( newPackage, packageElement );
303
NodeList actionList = packageElement.getElementsByTagName( "action" );
305
for ( int i = 0; i < actionList.getLength(); i++ )
307
Element actionElement = (Element) actionList.item( i );
308
addAction( actionElement, newPackage );
311
// load the default action reference for this package
312
loadDefaultActionRef( newPackage, packageElement );
313
configuration.addPackageConfig( newPackage.getName(), newPackage );
317
protected void addResultTypes( PackageConfig packageContext, Element element )
319
NodeList resultTypeList = element.getElementsByTagName( "result-type" );
321
for ( int i = 0; i < resultTypeList.getLength(); i++ )
323
Element resultTypeElement = (Element) resultTypeList.item( i );
324
String name = resultTypeElement.getAttribute( "name" );
325
String className = resultTypeElement.getAttribute( "class" );
326
String def = resultTypeElement.getAttribute( "default" );
328
Location loc = DomHelper.getLocationObject( resultTypeElement );
330
Class clazz = verifyResultType( className, loc );
333
String paramName = null;
336
paramName = (String) clazz.getField( "DEFAULT_PARAM" ).get( null );
338
catch ( Throwable t )
340
// if we get here, the result type doesn't have a default
343
ResultTypeConfig resultType = new ResultTypeConfig( name, className, paramName );
344
resultType.setLocation( DomHelper.getLocationObject( resultTypeElement ) );
346
Map params = XmlHelper.getParams( resultTypeElement );
348
if ( !params.isEmpty() )
350
resultType.setParams( params );
352
packageContext.addResultTypeConfig( resultType );
354
// set the default result type
355
if ( "true".equals( def ) )
357
packageContext.setDefaultResultType( name );
363
protected Class verifyResultType( String className, Location loc )
367
return ObjectFactory.getObjectFactory().getClassInstance( className );
369
catch ( ClassNotFoundException e )
371
LOG.warn( "Result class [" + className + "] doesn't exist (ClassNotFoundException) at " + loc.toString()
374
catch ( NoClassDefFoundError e )
376
LOG.warn( "Result class [" + className + "] doesn't exist (NoClassDefFoundError) at " + loc.toString()
383
protected List buildExternalRefs( Element element, PackageConfig context )
384
throws ConfigurationException
386
List refs = new ArrayList();
387
NodeList externalRefList = element.getElementsByTagName( "external-ref" );
390
String refValue = null;
394
for ( int i = 0; i < externalRefList.getLength(); i++ )
396
Element refElement = (Element) externalRefList.item( i );
398
if ( refElement.getParentNode().equals( element ) )
400
refName = refElement.getAttribute( "name" );
402
// If the external ref is not declared explicitly, we can
404
// reference type using it's name and try resolving the
405
// reference using it's class type
406
if ( refElement.getChildNodes().getLength() > 0 )
408
refValue = refElement.getChildNodes().item( 0 ).getNodeValue();
411
requiredTemp = refElement.getAttribute( "required" );
413
if ( (requiredTemp == null) || "".equals( requiredTemp ) )
419
required = Boolean.valueOf( requiredTemp ).booleanValue();
422
refs.add( new ExternalReference( refName, refValue, required ) );
429
protected List buildInterceptorList( Element element, PackageConfig context )
430
throws ConfigurationException
432
List interceptorList = new ArrayList();
433
NodeList interceptorRefList = element.getElementsByTagName( "interceptor-ref" );
435
for ( int i = 0; i < interceptorRefList.getLength(); i++ )
437
Element interceptorRefElement = (Element) interceptorRefList.item( i );
439
if ( interceptorRefElement.getParentNode().equals( element ) )
441
List interceptors = lookupInterceptorReference( context, interceptorRefElement );
442
interceptorList.addAll( interceptors );
446
return interceptorList;
450
* This method builds a package context by looking for the parents of this
451
* new package. <p/> If no parents are found, it will return a root package.
453
protected PackageConfig buildPackageContext( Element packageElement )
455
String parent = packageElement.getAttribute( "extends" );
456
String abstractVal = packageElement.getAttribute( "abstract" );
457
boolean isAbstract = Boolean.valueOf( abstractVal ).booleanValue();
458
String name = TextUtils.noNull( packageElement.getAttribute( "name" ) );
459
String namespace = TextUtils.noNull( packageElement.getAttribute( "namespace" ) );
461
// RM* Load the ExternalReferenceResolver if one has been set
462
ExternalReferenceResolver erResolver = null;
464
String externalReferenceResolver = TextUtils
465
.noNull( packageElement.getAttribute( "externalReferenceResolver" ) );
467
PackageConfig cfg = null;
468
if ( !("".equals( externalReferenceResolver )) )
472
erResolver = (ExternalReferenceResolver) ObjectFactory.getObjectFactory().buildBean(
473
externalReferenceResolver, null );
475
catch ( ClassNotFoundException e )
477
// TODO this should be localized
478
String msg = "Could not find External Reference Resolver: " + externalReferenceResolver + ". "
481
throw new ConfigurationException( msg, e, packageElement );
483
catch ( Exception e )
485
// TODO this should be localized
486
String msg = "Could not create External Reference Resolver: " + externalReferenceResolver + ". "
489
throw new ConfigurationException( msg, e, packageElement );
493
if ( !TextUtils.stringSet( TextUtils.noNull( parent ) ) )
496
cfg = new PackageConfig( name, namespace, isAbstract, erResolver );
499
{ // has parents, let's look it up
501
List parents = ConfigurationUtil.buildParentsFromString( configuration, parent );
503
if ( parents.size() <= 0 )
505
LOG.error( "Unable to find parent packages " + parent );
507
cfg = new PackageConfig( name, namespace, isAbstract, erResolver );
511
cfg = new PackageConfig( name, namespace, isAbstract, erResolver, parents );
517
cfg.setLocation( DomHelper.getLocationObject( packageElement ) );
523
* Build a map of ResultConfig objects from below a given XML element.
525
protected Map buildResults( Element element, PackageConfig packageContext )
527
NodeList resultEls = element.getElementsByTagName( "result" );
529
Map results = new LinkedHashMap();
531
for ( int i = 0; i < resultEls.getLength(); i++ )
533
Element resultElement = (Element) resultEls.item( i );
535
if ( resultElement.getParentNode().equals( element ) )
537
String resultName = resultElement.getAttribute( "name" );
538
String resultType = resultElement.getAttribute( "type" );
540
// if you don't specify a name on <result/>, it defaults to
542
if ( !TextUtils.stringSet( resultName ) )
544
resultName = Action.SUCCESS;
547
// there is no result type, so let's inherit from the parent
549
if ( !TextUtils.stringSet( resultType ) )
551
resultType = packageContext.getFullDefaultResultType();
553
// now check if there is a result type now
554
if ( !TextUtils.stringSet( resultType ) )
556
// uh-oh, we have a problem
557
LOG.error( "No result type specified for result named '" + resultName
558
+ "', perhaps the parent package does not specify the result type?" );
562
ResultTypeConfig config = (ResultTypeConfig) packageContext.getAllResultTypeConfigs().get( resultType );
564
if ( config == null )
566
throw new ConfigurationException( "There is no result type defined for type '" + resultType
567
+ "' mapped with name '" + resultName + "'", resultElement );
570
String resultClass = config.getClazz();
572
// invalid result type specified in result definition
573
if ( resultClass == null )
575
LOG.error( "Result type '" + resultType + "' is invalid. Modify your xwork.xml file." );
578
Map resultParams = XmlHelper.getParams( resultElement );
580
if ( resultParams.size() == 0 ) // maybe we just have a body -
581
// therefore a default parameter
583
// if <result ...>something</result> then we add a parameter
584
// of 'something' as this is the most used result param
585
if ( (resultElement.getChildNodes().getLength() == 1)
586
&& (resultElement.getChildNodes().item( 0 ).getNodeType() == Node.TEXT_NODE) )
588
resultParams = new LinkedHashMap();
590
String paramName = config.getDefaultResultParam();
591
if ( paramName != null )
593
String paramValue = resultElement.getChildNodes().item( 0 ).getNodeValue();
594
if ( paramValue != null )
596
paramValue = paramValue.trim();
598
resultParams.put( paramName, paramValue );
602
LOG.warn( "no default parameter defined for result of type " + config.getName() );
607
// create new param map, so that the result param can override
609
Map params = new LinkedHashMap();
610
Map configParams = config.getParams();
611
if ( configParams != null )
613
params.putAll( configParams );
615
params.putAll( resultParams );
617
ResultConfig resultConfig = new ResultConfig( resultName, resultClass, params );
618
resultConfig.setLocation( DomHelper.getLocationObject( element ) );
619
results.put( resultConfig.getName(), resultConfig );
627
* Build a map of ResultConfig objects from below a given XML element.
629
protected List buildExceptionMappings( Element element, PackageConfig packageContext )
631
NodeList exceptionMappingEls = element.getElementsByTagName( "exception-mapping" );
633
List exceptionMappings = new ArrayList();
635
for ( int i = 0; i < exceptionMappingEls.getLength(); i++ )
637
Element ehElement = (Element) exceptionMappingEls.item( i );
639
if ( ehElement.getParentNode().equals( element ) )
641
String emName = ehElement.getAttribute( "name" );
642
String exceptionClassName = ehElement.getAttribute( "exception" );
643
String exceptionResult = ehElement.getAttribute( "result" );
645
Map params = XmlHelper.getParams( ehElement );
647
if ( !TextUtils.stringSet( emName ) )
649
emName = exceptionResult;
652
ExceptionMappingConfig ehConfig = new ExceptionMappingConfig( emName, exceptionClassName,
653
exceptionResult, params );
654
ehConfig.setLocation( DomHelper.getLocationObject( ehElement ) );
655
exceptionMappings.add( ehConfig );
659
return exceptionMappings;
662
protected void loadDefaultInterceptorRef( PackageConfig packageContext, Element element )
664
NodeList resultTypeList = element.getElementsByTagName( "default-interceptor-ref" );
666
if ( resultTypeList.getLength() > 0 )
668
Element defaultRefElement = (Element) resultTypeList.item( 0 );
669
packageContext.setDefaultInterceptorRef( defaultRefElement.getAttribute( "name" ) );
673
protected void loadDefaultActionRef( PackageConfig packageContext, Element element )
675
NodeList resultTypeList = element.getElementsByTagName( "default-action-ref" );
677
if ( resultTypeList.getLength() > 0 )
679
Element defaultRefElement = (Element) resultTypeList.item( 0 );
680
packageContext.setDefaultActionRef( defaultRefElement.getAttribute( "name" ) );
685
* Load all of the global results for this package from the XML element.
687
protected void loadGlobalResults( PackageConfig packageContext, Element packageElement )
689
NodeList globalResultList = packageElement.getElementsByTagName( "global-results" );
691
if ( globalResultList.getLength() > 0 )
693
Element globalResultElement = (Element) globalResultList.item( 0 );
694
Map results = buildResults( globalResultElement, packageContext );
695
packageContext.addGlobalResultConfigs( results );
700
* Load all of the global results for this package from the XML element.
702
protected void loadGobalExceptionMappings( PackageConfig packageContext, Element packageElement )
704
NodeList globalExceptionMappingList = packageElement.getElementsByTagName( "global-exception-mappings" );
706
if ( globalExceptionMappingList.getLength() > 0 )
708
Element globalExceptionMappingElement = (Element) globalExceptionMappingList.item( 0 );
709
List exceptionMappings = buildExceptionMappings( globalExceptionMappingElement, packageContext );
710
packageContext.addGlobalExceptionMappingConfigs( exceptionMappings );
714
// protected void loadIncludes(Element rootElement, DocumentBuilder db)
715
// throws Exception {
716
// NodeList includeList = rootElement.getElementsByTagName("include");
718
// for (int i = 0; i < includeList.getLength(); i++) {
719
// Element includeElement = (Element) includeList.item(i);
720
// String fileName = includeElement.getAttribute("file");
721
// includedFileNames.add(fileName);
722
// loadConfigurationFile(fileName, db);
725
protected InterceptorStackConfig loadInterceptorStack( Element element, PackageConfig context )
726
throws ConfigurationException
728
String name = element.getAttribute( "name" );
730
InterceptorStackConfig config = new InterceptorStackConfig( name );
731
config.setLocation( DomHelper.getLocationObject( element ) );
732
NodeList interceptorRefList = element.getElementsByTagName( "interceptor-ref" );
734
for ( int j = 0; j < interceptorRefList.getLength(); j++ )
736
Element interceptorRefElement = (Element) interceptorRefList.item( j );
737
List interceptors = lookupInterceptorReference( context, interceptorRefElement );
738
config.addInterceptors( interceptors );
744
protected void loadInterceptorStacks( Element element, PackageConfig context )
745
throws ConfigurationException
747
NodeList interceptorStackList = element.getElementsByTagName( "interceptor-stack" );
749
for ( int i = 0; i < interceptorStackList.getLength(); i++ )
751
Element interceptorStackElement = (Element) interceptorStackList.item( i );
753
InterceptorStackConfig config = loadInterceptorStack( interceptorStackElement, context );
755
context.addInterceptorStackConfig( config );
759
protected void loadInterceptors( PackageConfig context, Element element )
760
throws ConfigurationException
762
NodeList interceptorList = element.getElementsByTagName( "interceptor" );
764
for ( int i = 0; i < interceptorList.getLength(); i++ )
766
Element interceptorElement = (Element) interceptorList.item( i );
767
String name = interceptorElement.getAttribute( "name" );
768
String className = interceptorElement.getAttribute( "class" );
770
Map params = XmlHelper.getParams( interceptorElement );
771
InterceptorConfig config = new InterceptorConfig( name, className, params );
772
config.setLocation( DomHelper.getLocationObject( interceptorElement ) );
774
context.addInterceptorConfig( config );
777
loadInterceptorStacks( element, context );
780
// protected void loadPackages(Element rootElement) throws
781
// ConfigurationException {
782
// NodeList packageList = rootElement.getElementsByTagName("package");
784
// for (int i = 0; i < packageList.getLength(); i++) {
785
// Element packageElement = (Element) packageList.item(i);
786
// addPackage(packageElement);
789
private void loadConfigurationFile( String fileName, Element includeElement )
791
if ( !includedFileNames.contains( fileName ) )
793
if ( LOG.isDebugEnabled() )
795
LOG.debug( "Loading xwork configuration from: " + fileName );
798
includedFileNames.add( fileName );
801
InputStream is = null;
805
is = getInputStream( fileName );
809
throw new Exception( "Could not open file " + fileName );
812
InputSource in = new InputSource( is );
814
// FIXME: we shouldn't be doing this lookup twice
817
in.setSystemId( ClassLoaderUtil.getResource( fileName, getClass() ).toString() );
819
catch ( Exception e )
821
in.setSystemId( fileName );
824
Map dtdMappings = new HashMap();
825
dtdMappings.put( "-//OpenSymphony Group//XWork 1.1.1//EN", "xwork-1.1.1.dtd" );
826
dtdMappings.put( "-//OpenSymphony Group//XWork 1.1//EN", "xwork-1.1.dtd" );
827
dtdMappings.put( "-//OpenSymphony Group//XWork 1.0//EN", "xwork-1.0.dtd" );
829
doc = DomHelper.parse( in, dtdMappings );
831
catch ( XworkException e )
834
if ( includeElement != null )
836
System.out.println( e );
837
throw new ConfigurationException( e, includeElement );
841
throw new ConfigurationException( e );
844
catch ( Exception e )
846
final String s = "Caught exception while loading file " + fileName;
848
// throw new ConfigurationException(s, e, includeElement);
849
throw new ConfigurationException( s, e );
859
catch ( IOException e )
861
LOG.error( "Unable to close input stream", e );
866
Element rootElement = doc.getDocumentElement();
867
NodeList children = rootElement.getChildNodes();
868
int childSize = children.getLength();
870
for ( int i = 0; i < childSize; i++ )
872
Node childNode = children.item( i );
874
if ( childNode instanceof Element )
876
Element child = (Element) childNode;
878
final String nodeName = child.getNodeName();
880
if ( nodeName.equals( "package" ) )
884
else if ( nodeName.equals( "include" ) )
886
String includeFileName = child.getAttribute( "file" );
887
loadConfigurationFile( includeFileName, child );
892
if ( LOG.isDebugEnabled() )
894
LOG.debug( "Loaded xwork configuration from: " + fileName );
900
* Looks up the Interceptor Class from the interceptor-ref name and creates
901
* an instance, which is added to the provided List, or, if this is a ref to
902
* a stack, it adds the Interceptor instances from the List to this stack.
904
* @param interceptorRefElement Element to pull interceptor ref data from
905
* @param context The PackageConfig to lookup the interceptor from
906
* @return A list of Interceptor objects
908
private List lookupInterceptorReference( PackageConfig context, Element interceptorRefElement )
909
throws ConfigurationException
911
String refName = interceptorRefElement.getAttribute( "name" );
912
Map refParams = XmlHelper.getParams( interceptorRefElement );
914
return InterceptorBuilder.constructInterceptorReference( context, refName, refParams );