taylor 2004/06/27 11:03:28
Modified: webapp/WEB-INF/conf/assembly jetspeed.groovy
Log:
never ending sync with never ending refactoring of nano/groovy
be *really* nice if we had error messages when groovy script has errors
otherwise why even bother using scripts, certainly doesn't make things easier as
this syntax here is about as cryptic as it gets
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.2 +70 -16 jakarta-jetspeed/webapp/WEB-INF/conf/assembly/jetspeed.groovy
Index: jetspeed.groovy
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/conf/assembly/jetspeed.groovy,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- jetspeed.groovy 26 Jun 2004 01:38:49 -0000 1.1
+++ jetspeed.groovy 27 Jun 2004 18:03:28 -0000 1.2
@@ -16,7 +16,7 @@
import org.picocontainer.defaults.DefaultPicoContainer
import org.picocontainer.defaults.ConstantParameter
import org.picocontainer.ComponentAdapter
-import org.picocontainer.defaults.ConstructorComponentAdapter
+import org.picocontainer.defaults.ConstructorInjectionComponentAdapter
import org.picocontainer.defaults.CachingComponentAdapter
import org.picocontainer.Parameter
import org.picocontainer.defaults.ComponentParameter
@@ -33,6 +33,8 @@
import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent
import org.apache.jetspeed.components.portletregistry.PortletRegistryComponent
+import java.util.Locale
+
import org.apache.jetspeed.capabilities.Capabilities
import org.apache.jetspeed.capabilities.impl.JetspeedCapabilities
@@ -105,6 +107,10 @@
import org.apache.jetspeed.om.common.portlet.MutablePortletEntity
import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite
+// Autodeploy
+import org.apache.jetspeed.deployment.impl.CatalinaAutoDeploymentServiceImpl
+import org.apache.jetspeed.fusion.tools.pamanager.FusionCatalinaPAM
+
/* *********************************************************
* U T I L I T Y C L O S U R E S *
@@ -115,17 +121,17 @@
{
key, clazz, parameters | return new CachingComponentAdapter(
new InterceptorAdapter(
- new ConstructorComponentAdapter(key, clazz, parameters),
+ new ConstructorInjectionComponentAdapter(key, clazz, parameters),
ThreadLocalDelegationStrategy
)
)
}
// Shorthand for creating a ConstantParameter
-cstParam = { key | return new ConstantParameter(key) }
+def cstParam(key){ return new ConstantParameter(key) }
// Shorthand for creating a ComponentParameter
-cmpParam = { key | return new ComponentParameter(key) }
+def cmpParam(key) { return new ComponentParameter(key) }
// Closure to perform easy building of Parameter[]
doParams =
@@ -139,8 +145,27 @@
}
return paramArray
}
-
-
+
+// Shorthand for a ConstructorInjectionComponentAdapter
+def constructorAdapter(key, clazz, parameters)
+{
+
+ return new ConstructorInjectionComponentAdapter(key, clazz, parameters)
+}
+
+// Shorthand for a CachingComponentAdapter
+def cachingAdapter(delegate)
+{
+ return new CachingComponentAdapter(delegate)
+}
+
+// Combine CachingComponentAdapter and ConstructorInjectionComponentAdapter
+// to create Singletons
+def singletonAdapter(key, clazz, parameters)
+{
+ return cachingAdapter(constructorAdapter(key, clazz, parameters))
+}
+
/* ******************************************************* */
ClassLoader cl = Thread.currentThread().getContextClassLoader()
@@ -154,7 +179,7 @@
FSSystemResourceUtilImpl resourceUtil = new
FSSystemResourceUtilImpl(applicationRoot)
// create the root container
-container = new DefaultPicoContainer()
+container = new DefaultPicoContainer(parent)
/* **********************************************************
@@ -206,20 +231,24 @@
/* **********************************************************
* Porlet Registry *
* ******************************************************** */
- container.registerComponentImplementation(
- PortletRegistryComponent,
- PortletRegistryComponentImpl,
- doParams([cmpParam(PersistenceStore)])
+ container.registerComponent(singletonAdapter(
+ PortletRegistryComponent,
+ PortletRegistryComponentImpl,
+ doParams([cmpParam(PersistenceStore)])
+ )
)
/* **********************************************************
* Portlet Entity *
* ******************************************************** */
-container.registerComponentImplementation(
- PortletEntityAccessComponent,
- PortletEntityAccessComponentImpl,
- doParams([cmpParam(PersistenceStore),
cmpParam(PortletRegistryComponent)])
-)
+container.registerComponent(singletonAdapter(
+ PortletEntityAccessComponent,
+ PortletEntityAccessComponentImpl,
+ doParams([cmpParam(PersistenceStore),
+ cmpParam(PortletRegistryComponent)]
+ )
+ )
+)
/* **********************************************************
* Capabilities *
* ******************************************************** */
@@ -386,6 +415,31 @@
PortletAggregator,
PortletAggregatorImpl,
doParams([cmpParam(PortletRenderer)])
+)
+
+/* **********************************************************
+ * Autodeployment *
+ * ******************************************************** */
+
+container.registerComponent(singletonAdapter(
+ "PAM",
+ FusionCatalinaPAM,
+ doParams([cmpParam(PortletRegistryComponent),
+ cstParam(Locale.getDefault())
+ ]
+ )
+ )
+)
+
+container.registerComponent(singletonAdapter(
+ "autodeployment",
+ CatalinaAutoDeploymentServiceImpl,
+ doParams([cmpParam("portal_configuration"),
+ cstParam(Locale.getDefault()),
+ cmpParam(PortletRegistryComponent),
+ cmpParam("PAM")]
+ )
+ )
)
return container
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]