[Sunxacml-commit] sunxacml/com/sun/xacml ConfigurationStore.java,1.5,1.6
Brought to you by:
farrukh_najmi,
sethp
From: Seth P. <se...@us...> - 2004-05-27 19:39:44
|
Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5659/com/sun/xacml Modified Files: ConfigurationStore.java Log Message: added a useDefaultFactories convenience method Index: ConfigurationStore.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/ConfigurationStore.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ConfigurationStore.java 24 May 2004 20:55:06 -0000 1.5 --- ConfigurationStore.java 27 May 2004 19:39:35 -0000 1.6 *************** *** 38,41 **** --- 38,42 ---- import com.sun.xacml.attr.AttributeFactory; + import com.sun.xacml.attr.AttributeFactoryProxy; import com.sun.xacml.attr.AttributeProxy; import com.sun.xacml.attr.BaseAttributeFactory; *************** *** 44,47 **** --- 45,49 ---- import com.sun.xacml.combine.BaseCombiningAlgFactory; import com.sun.xacml.combine.CombiningAlgFactory; + import com.sun.xacml.combine.CombiningAlgFactoryProxy; import com.sun.xacml.combine.CombiningAlgorithm; import com.sun.xacml.combine.StandardCombiningAlgFactory; *************** *** 273,277 **** /** * Private helper that parses the file and sets up the DOM tree. - * FIXME: add schema validation support before 1.2 is final */ private Node getRootNode(File configFile) throws ParsingException { --- 275,278 ---- *************** *** 655,660 **** * Private helper that gets the constructor arguments for a given class. * Right now this just supports String and List, but it's trivial to ! * add support for other types...the question is what types are needed. ! * FIXME: decide on what types will be supported */ private List getArgs(Node root) { --- 656,661 ---- * Private helper that gets the constructor arguments for a given class. * Right now this just supports String and List, but it's trivial to ! * add support for other types should that be needed. Right now, it's not ! * clear that there's any need for other types. */ private List getArgs(Node root) { *************** *** 879,881 **** --- 880,913 ---- } + /** + * Uses the default configuration to re-set the default factories used + * by the system (attribute, combining algorithm, and function). If + * a default is not provided for a given factory, then that factory + * will not be set as the system's default. + */ + public void useDefaultFactories() { + // set the default attribute factory, if it exists here + if (defaultAttributeFactory != null) { + AttributeFactory.setDefaultFactory(new AttributeFactoryProxy() { + public AttributeFactory getFactory() { + return defaultAttributeFactory; + } + }); + } + + // set the default combining algorithm factory, if it exists here + if (defaultCombiningFactory != null) { + CombiningAlgFactory. + setDefaultFactory(new CombiningAlgFactoryProxy() { + public CombiningAlgFactory getFactory() { + return defaultCombiningFactory; + } + }); + } + + // set the default function factories, if they exists here + if (defaultFunctionFactoryProxy != null) + FunctionFactory.setDefaultFactory(defaultFunctionFactoryProxy); + } + } |