Revision: 1059
http://stripes.svn.sourceforge.net/stripes/?rev=1059&view=rev
Author: bengunter
Date: 2009-02-26 15:50:33 +0000 (Thu, 26 Feb 2009)
Log Message:
-----------
STS-614: Added setObjectFactory(DefaultObjectFactory) to the
ObjectPostProcessor interface. The method is called when a post-processor is
added to an object factory. Post processors can get the object factory's
configuration by calling DefaultObjectFactory.getConfiguration(), which has
been made public.
Modified Paths:
--------------
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultObjectFactory.java
trunk/stripes/src/net/sourceforge/stripes/controller/ObjectPostProcessor.java
Modified:
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultObjectFactory.java
===================================================================
---
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultObjectFactory.java
2009-02-26 14:45:11 UTC (rev 1058)
+++
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultObjectFactory.java
2009-02-26 15:50:33 UTC (rev 1059)
@@ -109,7 +109,7 @@
}
/** Get the {...@link Configuration} that was passed into {...@link
#init(Configuration)}. */
- protected Configuration getConfiguration() {
+ public Configuration getConfiguration() {
return configuration;
}
@@ -163,6 +163,8 @@
" for ", targetType);
list.add(postProcessor);
}
+
+ postProcessor.setObjectFactory(this);
}
/**
Modified:
trunk/stripes/src/net/sourceforge/stripes/controller/ObjectPostProcessor.java
===================================================================
---
trunk/stripes/src/net/sourceforge/stripes/controller/ObjectPostProcessor.java
2009-02-26 14:45:11 UTC (rev 1058)
+++
trunk/stripes/src/net/sourceforge/stripes/controller/ObjectPostProcessor.java
2009-02-26 15:50:33 UTC (rev 1059)
@@ -23,6 +23,21 @@
*/
public interface ObjectPostProcessor<T> {
/**
+ * <p>
+ * Accept a reference to a {...@link DefaultObjectFactory} instance that
is using this
+ * post-processor. This method is called by the object factory when the
post-processor is passed
+ * to {...@link
DefaultObjectFactory#addPostProcessor(ObjectPostProcessor)}.
+ * </p>
+ * <p>
+ * In normal usage, this method will never be called more than once.
However, implementations
+ * should guard against multiple calls if that would cause a problem.
+ * </p>
+ *
+ * @param factory The object factory that is now using this post-processor.
+ */
+ void setObjectFactory(DefaultObjectFactory factory);
+
+ /**
* Do whatever post-processing is necessary on the object and return it.
It is not absolutely
* required that this method return exactly the same object that was
passed to it, but it is
* strongly recommended.
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development