cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r392548 - in /cocoon/trunk/core: cocoon-blocks-fw/cocoon-blocks-fw-tests/ cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/ cocoon-blocks-fw/cocoon-blocks-fw-tests/src/ cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/ cocoon-blocks-fw/coco...
Date Sat, 08 Apr 2006 15:44:02 GMT
Author: reinhard
Date: Sat Apr  8 08:43:57 2006
New Revision: 392548

URL: http://svn.apache.org/viewcvs?rev=392548&view=rev
Log:
Initial work together with Daniel to make Cocoon work with OSGi

Added:
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.classpath   (with props)
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.project   (with props)
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.wtpmodules   (with props)
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/MANIFEST.MF   (with
props)
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/components.xml   (with
props)
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/build.properties   (with props)
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/pom.xml   (with props)
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/cocoon/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/cocoon/App.java
  (with props)
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/AppTest.java
  (with props)
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AllOSGiTests.java
  (with props)
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiLoggerTest.java
  (with props)
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSettingsTest.java
  (with props)
    cocoon/trunk/core/cocoon-core/META-INF/
    cocoon/trunk/core/cocoon-core/META-INF/MANIFEST.MF   (with props)
    cocoon/trunk/core/cocoon-core/META-INF/components.xml   (with props)
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/ECMConfigurationFileNotSetException.java
  (with props)
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiLogger.java
  (with props)
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSettings.java
  (with props)
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringECMFactory.java
  (with props)
Modified:
    cocoon/trunk/core/cocoon-core/pom.xml

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.classpath
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.classpath?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.classpath (added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.classpath Sat Apr  8 08:43:57
2006
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry output="target/test-classes" kind="src" path="src/test/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar" kind="var"
path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.classpath
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.project
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.project?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.project (added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.project Sat Apr  8 08:43:57
2006
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>cocoon-blocks-fw-tests</name>
+	<comment></comment>
+	<projects>
+		<project>cocoon-core</project>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.common.modulecore.ComponentStructuralBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+	</natures>
+</projectDescription>

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.project
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.wtpmodules
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.wtpmodules?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.wtpmodules (added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.wtpmodules Sat Apr  8 08:43:57
2006
@@ -0,0 +1,8 @@
+<project-modules id="moduleCoreId">
+  <wb-module deploy-name="cocoon-blocks-fw-tests">
+    <module-type module-type-id="jst.utility">
+      <property name="java-output-path" value="/target/classes"/>
+    </module-type>
+    <wb-resource deploy-path="/" source-path="src/main/java"/>
+  </wb-module>
+</project-modules>
\ No newline at end of file

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.wtpmodules
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/MANIFEST.MF?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/MANIFEST.MF (added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/MANIFEST.MF Sat Apr
 8 08:43:57 2006
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: cocoon_blocks_fw_tests
+Bundle-SymbolicName: cocoon_blocks_fw_tests
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Service-Component: META-INF/components.xml
+Import-Package: junit.framework,
+ junit.textui,
+ org.apache.avalon.framework.logger,
+ org.apache.cocoon.core,
+ org.osgi.service.component

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/MANIFEST.MF
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/components.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/components.xml?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/components.xml (added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/components.xml Sat
Apr  8 08:43:57 2006
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">  
+  
+  <scr:component name="org.apache.cocoon.osgitests.OSGiSettingsTest">
+    <scr:implementation class="org.apache.cocoon.osgitests.OSGiSettingsTest"/>  
+    <scr:reference name="settings"
+      interface="org.apache.cocoon.core.Settings"
+      bind="setSettings"/>  
+  </scr:component>    
+  
+  <scr:component name="org.apache.cocoon.osgitests.OSGiLoggerTest">
+    <scr:implementation class="org.apache.cocoon.osgitests.OSGiLoggerTest"/>  
+    <scr:reference name="logger"
+      interface="org.apache.avalon.framework.logger.Logger"
+      bind="setLogger"/>  
+  </scr:component>
+  
+  <scr:component name="org.apache.cocoon.osgitests.allOSGiTests">
+    <scr:implementation class="org.apache.cocoon.osgitests.AllOSGiTests"/>  
+  </scr:component>  
+
+</components>
\ No newline at end of file

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/components.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/build.properties
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/build.properties?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/build.properties (added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/build.properties Sat Apr  8
08:43:57 2006
@@ -0,0 +1,4 @@
+source.. = src/main/java/,\
+           src/test/java/
+bin.includes = META-INF/,\
+               .

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/build.properties
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/pom.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/pom.xml?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/pom.xml (added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/pom.xml Sat Apr  8 08:43:57
2006
@@ -0,0 +1,18 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.cocoon</groupId>
+  <artifactId>cocoon-blocks-fw-tests</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>Maven Quick Start Archetype</name>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/pom.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/cocoon/App.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/cocoon/App.java?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/cocoon/App.java
(added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/cocoon/App.java
Sat Apr  8 08:43:57 2006
@@ -0,0 +1,13 @@
+package org.apache.cocoon;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/cocoon/App.java
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/AppTest.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/AppTest.java?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/AppTest.java
(added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/AppTest.java
Sat Apr  8 08:43:57 2006
@@ -0,0 +1,38 @@
+package org.apache.cocoon;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+    extends TestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( AppTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+        assertTrue( true );
+    }
+}

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/AppTest.java
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AllOSGiTests.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AllOSGiTests.java?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AllOSGiTests.java
(added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AllOSGiTests.java
Sat Apr  8 08:43:57 2006
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.osgitests;
+
+import junit.framework.TestCase;
+import junit.textui.TestRunner;
+
+import org.osgi.service.component.ComponentContext;
+
+public class AllOSGiTests extends TestCase {
+
+    protected void activate(ComponentContext componentContext) {
+    	TestRunner.run(OSGiLoggerTest.class);
+    	TestRunner.run(OSGiSettingsTest.class);
+    }
+	
+}

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AllOSGiTests.java
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiLoggerTest.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiLoggerTest.java?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiLoggerTest.java
(added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiLoggerTest.java
Sat Apr  8 08:43:57 2006
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.osgitests;
+
+import junit.framework.TestCase;
+
+import org.apache.avalon.framework.logger.Logger;
+
+public class OSGiLoggerTest extends TestCase {
+
+	private static Logger logger;
+
+	protected Logger getLogger() {
+		return logger;
+	}
+
+	protected void setLogger(Logger logger) {
+		this.logger = logger;
+	}
+	
+	public void testIsServiceAvailable() {
+		logger.debug("testIsServiceAvailable");
+	}
+	
+}

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiLoggerTest.java
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSettingsTest.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSettingsTest.java?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSettingsTest.java
(added)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSettingsTest.java
Sat Apr  8 08:43:57 2006
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.osgitests;
+
+import junit.framework.TestCase;
+
+import org.apache.cocoon.core.Settings;
+
+public class OSGiSettingsTest extends TestCase {
+
+	private static Settings settings;
+
+	protected Settings getSettings() {
+		return settings;
+	}
+
+	protected void setSettings(final Settings settings) {
+		OSGiSettingsTest.settings = settings;
+	}
+
+	public void testIsServiceAvailable() {
+//		assertNotNull(settings);
+	}
+	
+}

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSettingsTest.java
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-core/META-INF/MANIFEST.MF?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-core/META-INF/MANIFEST.MF (added)
+++ cocoon/trunk/core/cocoon-core/META-INF/MANIFEST.MF Sat Apr  8 08:43:57 2006
@@ -0,0 +1,132 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: cocoon_core
+Bundle-SymbolicName: cocoon_core
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Service-Component: META-INF/components.xml
+Bundle-ClassPath: ant-1.6.5.jar,
+ ant-launcher-1.6.5.jar,
+ ant-optional-1.5.1.jar,
+ ant-trax-1.6.5.jar,
+ avalon-framework-api-4.3.jar,
+ avalon-framework-impl-4.3.jar,
+ avalon-logkit-2.1.jar,
+ commons-cli-1.0.jar,
+ commons-collections-3.1.jar,
+ commons-io-1.1.jar,
+ commons-jci-r306555.jar,
+ commons-jexl-1.0.jar,
+ commons-jxpath-1.2.jar,
+ commons-lang-2.1.jar,
+ commons-logging-1.0.4.jar,
+ concurrent-1.3.4.jar,
+ ehcache-1.1.jar,
+ excalibur-component-2.1.jar,
+ excalibur-instrument-api-2.1.jar,
+ excalibur-instrument-mgr-api-2.1.jar,
+ excalibur-instrument-mgr-impl-2.1.jar,
+ excalibur-logger-2.1.jar,
+ excalibur-pool-api-2.1.jar,
+ excalibur-pool-impl-2.1.jar,
+ excalibur-pool-instrumented-2.1.jar,
+ excalibur-sourceresolve-2.1.jar,
+ excalibur-store-2.1.jar,
+ excalibur-testcase-2.1.jar,
+ excalibur-xmlutil-2.1.jar,
+ jakarta-bcel-20040329.jar,
+ jakarta-regexp-1.4.jar,
+ js-1.6R2.jar,
+ log4j-1.2.13.jar,
+ mx4j-3.0.1.jar,
+ spring-1.2.6.jar,
+ xalan-2.7.0.jar,
+ xercesImpl-2.7.1.jar,
+ xml-apis-1.3.02.jar,
+ xmlbeans-1.0.3.jar,
+ xml-resolver-1.1.jar,
+ easymock-1.1.jar,
+ jmock-1.0.1.jar,
+ junit-3.8.1.jar,
+ xmlunit-0.8.jar
+Export-Package: junit.framework,
+ junit.textui,
+ org.apache.avalon.framework.logger,
+ org.apache.cocoon,
+ org.apache.cocoon.acting,
+ org.apache.cocoon.bean,
+ org.apache.cocoon.bean.helpers,
+ org.apache.cocoon.caching,
+ org.apache.cocoon.caching.impl,
+ org.apache.cocoon.components,
+ org.apache.cocoon.components.classloader,
+ org.apache.cocoon.components.crawler,
+ org.apache.cocoon.components.fam,
+ org.apache.cocoon.components.flow,
+ org.apache.cocoon.components.flow.javascript,
+ org.apache.cocoon.components.flow.javascript.fom,
+ org.apache.cocoon.components.flow.util,
+ org.apache.cocoon.components.modules.input,
+ org.apache.cocoon.components.modules.output,
+ org.apache.cocoon.components.notification,
+ org.apache.cocoon.components.persistence,
+ org.apache.cocoon.components.pipeline,
+ org.apache.cocoon.components.pipeline.impl,
+ org.apache.cocoon.components.resolver,
+ org.apache.cocoon.components.sax,
+ org.apache.cocoon.components.source,
+ org.apache.cocoon.components.source.helpers,
+ org.apache.cocoon.components.source.impl,
+ org.apache.cocoon.components.source.impl.validity,
+ org.apache.cocoon.components.store.impl,
+ org.apache.cocoon.components.thread,
+ org.apache.cocoon.components.treeprocessor,
+ org.apache.cocoon.components.treeprocessor.sitemap,
+ org.apache.cocoon.components.treeprocessor.variables,
+ org.apache.cocoon.components.xpointer,
+ org.apache.cocoon.components.xpointer.parser,
+ org.apache.cocoon.components.xslt,
+ org.apache.cocoon.core,
+ org.apache.cocoon.core.container,
+ org.apache.cocoon.core.container.spring,
+ org.apache.cocoon.core.container.util,
+ org.apache.cocoon.core.servlet,
+ org.apache.cocoon.environment,
+ org.apache.cocoon.environment.commandline,
+ org.apache.cocoon.environment.commandline.test,
+ org.apache.cocoon.environment.http,
+ org.apache.cocoon.environment.impl,
+ org.apache.cocoon.environment.internal,
+ org.apache.cocoon.environment.mock,
+ org.apache.cocoon.environment.wrapper,
+ org.apache.cocoon.generation,
+ org.apache.cocoon.i18n,
+ org.apache.cocoon.matching,
+ org.apache.cocoon.matching.helpers,
+ org.apache.cocoon.matching.modular,
+ org.apache.cocoon.reading,
+ org.apache.cocoon.selection,
+ org.apache.cocoon.serialization,
+ org.apache.cocoon.servlet,
+ org.apache.cocoon.servlet.multipart,
+ org.apache.cocoon.sitemap,
+ org.apache.cocoon.sitemap.impl,
+ org.apache.cocoon.transformation,
+ org.apache.cocoon.transformation.helpers,
+ org.apache.cocoon.transformation.pagination,
+ org.apache.cocoon.util,
+ org.apache.cocoon.util.jmx,
+ org.apache.cocoon.util.jxpath,
+ org.apache.cocoon.util.location,
+ org.apache.cocoon.util.test,
+ org.apache.cocoon.xml,
+ org.apache.cocoon.xml.dom,
+ org.apache.cocoon.xml.xlink,
+ org.springframework.beans,
+ org.springframework.beans.factory,
+ org.springframework.beans.factory.config
+Import-Package: javax.servlet;version="2.3.0",
+ javax.servlet.http;version="2.3.0",
+ org.osgi.framework,
+ org.osgi.service.component,
+ org.osgi.service.log

Propchange: cocoon/trunk/core/cocoon-core/META-INF/MANIFEST.MF
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-core/META-INF/components.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-core/META-INF/components.xml?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-core/META-INF/components.xml (added)
+++ cocoon/trunk/core/cocoon-core/META-INF/components.xml Sat Apr  8 08:43:57 2006
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+  
+  <scr:component name="org.apache.cocoon.core.osgi.logger">
+    <scr:implementation class="org.apache.cocoon.core.osgi.OSGiLogger"/>
+    <scr:property name="logLevel" value="debug"/>    
+    <scr:service>
+      <scr:provide interface="org.apache.avalon.framework.logger.Logger"/>
+    </scr:service>    
+    <scr:reference name="logger"
+                   interface="org.osgi.service.log.LogService"
+                   bind="setLogService"/>
+  </scr:component>
+  
+  <scr:component name="org.apache.cocoon.core.osgi.settings">
+    <scr:implementation class="org.apache.cocoon.core.osgi.OSGiSettings"/>
+    <scr:service>
+      <scr:provide interface="org.apache.cocoon.core.Settings"/>
+    </scr:service>
+    <scr:reference name="logger"
+      interface="org.apache.avalon.framework.logger.Logger"
+      bind="setLogger"/>    
+  </scr:component>
+  
+  <scr:component name="org.apache.cocoon.osgi.springEcmFactory">
+    <scr:implementation class="org.apache.cocoon.core.osgi.SpringECMFactory"/>
+    <scr:property name="configFile" value="/META-INF/cocoon.xconf"/>
+    <scr:service>
+      <scr:provide interface="org.springframework.beans.factory.config.ConfigureableListableBeanFactory"/>
+    </scr:service>    
+    <scr:reference name="logger"
+      interface="org.apache.avalon.framework.logger.Logger"
+      bind="setLogger"/>
+    <scr:reference name="settings"
+      interface="org.apache.cocoon.core.Settings"
+      bind="setSettings"/>      
+  </scr:component>  
+  
+</components>
\ No newline at end of file

Propchange: cocoon/trunk/core/cocoon-core/META-INF/components.xml
------------------------------------------------------------------------------
    svn:executable = *

Modified: cocoon/trunk/core/cocoon-core/pom.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-core/pom.xml?rev=392548&r1=392547&r2=392548&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/pom.xml (original)
+++ cocoon/trunk/core/cocoon-core/pom.xml Sat Apr  8 08:43:57 2006
@@ -195,6 +195,18 @@
       <artifactId>commons-jexl</artifactId>
       <version>1.0</version>
     </dependency>
+    
+    <!-- OSGi -->
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>osgi_R4_core</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>osgi_R4_compendium</artifactId>
+      <version>1.0</version>
+    </dependency>    
 
     <!--  test dependencies  -->
     <dependency>

Added: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/ECMConfigurationFileNotSetException.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/ECMConfigurationFileNotSetException.java?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/ECMConfigurationFileNotSetException.java
(added)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/ECMConfigurationFileNotSetException.java
Sat Apr  8 08:43:57 2006
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.core.osgi;
+
+/**
+ * @version $Id$
+ */
+public class ECMConfigurationFileNotSetException extends RuntimeException{
+
+	public ECMConfigurationFileNotSetException(String msg) {
+		super(msg);
+	}
+
+}

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/ECMConfigurationFileNotSetException.java
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiLogger.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiLogger.java?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiLogger.java
(added)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiLogger.java
Sat Apr  8 08:43:57 2006
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.core.osgi;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.avalon.framework.logger.Logger;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.log.LogService;
+
+/**
+ * @version $Id$
+ */
+public class OSGiLogger implements Logger {
+	
+	/** Set the default loglevel to 4 which is DEBUG */
+	private static final int DEFAULT_LOG_LEVEL = 4;
+
+    private String category = "";
+    private LogService logService;
+	private ComponentContext componentContext;
+	private int logLevel;
+    
+    protected void activate(ComponentContext componentContext) {
+    	this.componentContext = componentContext;
+    	String logLevelProperty = (String) this.componentContext.getProperties().get("logLevel");
+    	if(logLevelProperty == null) {
+    		logLevel = DEFAULT_LOG_LEVEL;
+    	}
+    	else if(logLevelProperty.equalsIgnoreCase("ERROR")) {
+    		logLevel = LogService.LOG_ERROR;
+    	}
+    	else if(logLevelProperty.equalsIgnoreCase("WARN")) {
+    		logLevel = LogService.LOG_WARNING;
+    	}    
+    	else if(logLevelProperty.equalsIgnoreCase("INFO")) {
+    		logLevel = LogService.LOG_INFO;
+    	}      	
+    	else if(logLevelProperty.equalsIgnoreCase("DEBUG")) {
+    		logLevel = LogService.LOG_DEBUG;
+    	}
+    }
+
+    protected String getCategory() {
+		return category;
+	}
+
+	protected void setCategory(String category) {
+		this.category = category;
+	}
+
+	protected LogService getLogService() {
+		return logService;
+	}
+
+	protected void setLogService(LogService logService) {
+		this.logService = logService;
+	}
+
+    
+    private void log(int level, String msg) {
+        if (level <= this.logLevel) {
+            logService.log(level, "[" + category + "] " + msg);
+        }
+    }
+    
+    private void log(int level, String msg, Throwable thr) {
+        if (level <= this.logLevel) {
+            logService.log(level, msg, thr);
+        }
+    }
+    
+    private static Map loggers = Collections.synchronizedMap(new HashMap());
+
+    protected Logger getLoggerForCategory(String category) {
+        Logger result = (Logger) loggers.get(category);
+        if (result == null) {
+            result = new OSGiLogger();
+            ((OSGiLogger) result).setCategory(category);
+            ((OSGiLogger) result).setLogLevel(this.logLevel);
+            loggers.put(category, result);
+        }
+        return result;
+    }   
+    
+    private boolean isLevelEnabled(int level) {
+        return level <= this.logLevel;
+    }
+
+    
+    // ~~~~~~~~~~~~~~~~~~~ logging methods ~~~~~~~~~~~~~~~~~~~~~~~
+    
+    public Logger getChildLogger(String category) {
+        return getLoggerForCategory(this.category.length() == 0 ? category : this.category
+ "." + category);
+    }   
+    
+    public void debug(String msg) {
+        log(LogService.LOG_DEBUG, msg);
+    }
+
+    public void debug(String msg, Throwable thr) {
+        log(LogService.LOG_DEBUG, msg, thr);
+        
+    }
+
+    public boolean isDebugEnabled() {
+        return isLevelEnabled(LogService.LOG_DEBUG);
+    }
+
+    public void info(String msg) {
+        log(LogService.LOG_INFO, msg);
+    }
+
+    public void info(String msg, Throwable thr) {
+        log(LogService.LOG_INFO, msg, thr);
+    }
+
+    public boolean isInfoEnabled() {
+        return isLevelEnabled(LogService.LOG_INFO);
+    }
+
+    public void warn(String msg) {
+        log(LogService.LOG_WARNING, msg);
+    }
+
+    public void warn(String msg, Throwable thr) {
+        log(LogService.LOG_WARNING, msg, thr);
+    }
+
+    public boolean isWarnEnabled() {
+        return isLevelEnabled(LogService.LOG_WARNING);
+    }
+
+    public void error(String msg) {
+        log(LogService.LOG_ERROR, msg);
+    }
+
+    public void error(String msg, Throwable thr) {
+        log(LogService.LOG_ERROR, msg, thr);
+    }
+
+    public boolean isErrorEnabled() {
+        return isLevelEnabled(LogService.LOG_ERROR);
+    }
+
+    public void fatalError(String msg) {
+        // OSGi has no "fatal" level
+        log(LogService.LOG_ERROR, msg);
+    }
+
+    public void fatalError(String msg, Throwable thr) {
+        // OSGi has no "fatal" level
+        log(LogService.LOG_ERROR, msg, thr);
+    }
+
+    public boolean isFatalErrorEnabled() {
+        // OSGi has no "fatal" level
+       return isLevelEnabled(LogService.LOG_ERROR);
+    }
+
+	protected int getLogLevel() {
+		return logLevel;
+	}
+
+	protected void setLogLevel(int logLevel) {
+		this.logLevel = logLevel;
+	}
+
+}

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiLogger.java
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSettings.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSettings.java?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSettings.java
(added)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSettings.java
Sat Apr  8 08:43:57 2006
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.core.osgi;
+
+import org.apache.avalon.framework.logger.Logger;
+import org.apache.cocoon.core.CoreUtil;
+import org.apache.cocoon.core.MutableSettings;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * @version $Id$
+ */
+public class OSGiSettings extends MutableSettings {
+	
+    private Logger logger;
+
+	protected void activate(ComponentContext componentContext) {
+    	CoreUtil.initSettingsFiles(this, this.logger);
+        // componentContext.getBundleContext().getDataFile("cocoon-files");
+    	this.makeReadOnly();
+    }
+
+	protected Logger getLogger() {
+		return logger;
+	}
+
+	protected void setLogger(Logger logger) {
+		this.logger = logger;
+	}
+
+}

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSettings.java
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringECMFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringECMFactory.java?rev=392548&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringECMFactory.java
(added)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringECMFactory.java
Sat Apr  8 08:43:57 2006
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.core.osgi;
+
+import java.beans.PropertyEditor;
+import java.io.FileNotFoundException;
+import java.net.URL;
+
+import org.apache.avalon.framework.context.DefaultContext;
+import org.apache.avalon.framework.logger.Logger;
+import org.apache.cocoon.core.CoreUtil;
+import org.apache.cocoon.core.MutableSettings;
+import org.apache.cocoon.core.Settings;
+import org.apache.cocoon.core.container.spring.AvalonEnvironment;
+import org.apache.cocoon.core.container.spring.BeanFactoryUtil;
+import org.apache.cocoon.core.container.spring.ConfigReader;
+import org.apache.cocoon.core.container.spring.ConfigurationInfo;
+import org.osgi.service.component.ComponentContext;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+
+/**
+ * @version $Id$
+ */
+public class OSGiSpringECMFactory implements ConfigurableBeanFactory {
+	
+	private static final String MANIFEST_FILE = "/META-INF/MANIFEST.MF";
+
+	private static final Object CONFIG_FILE = "configFile";
+	
+    private Logger logger;
+	private Settings settings;
+	private ConfigurableBeanFactory beanFactory;
+
+	protected Settings getSettings() {
+		return this.settings;
+	}
+
+	protected void setSettings(final Settings settings) {
+		this.settings = settings;
+	}	
+	
+	protected Logger getLogger() {
+		return this.logger;
+	}
+
+	protected void setLogger(Logger logger) {
+		this.logger = logger;
+	}
+	
+	protected void activate(ComponentContext componentContext) throws Exception {
+		URL manifestUrl = componentContext.getBundleContext().getBundle().getResource(MANIFEST_FILE);
+		String contextPath = manifestUrl.toString();
+		contextPath = manifestUrl.toString().substring(0, contextPath.length() - MANIFEST_FILE.length());
+		
+		DefaultContext avalonContext = CoreUtil.createContext(this.settings, null, contextPath,
null, null);
+		
+		AvalonEnvironment avalonEnvironment = new AvalonEnvironment();
+		avalonEnvironment.context = avalonContext;
+		avalonEnvironment.logger = this.logger;		
+		
+		// get the configuration file property
+		String configFile= (String) componentContext.getProperties().get(CONFIG_FILE);
+		if(configFile == null) {
+			throw new ECMConfigurationFileNotSetException("You have to provide a ECM configurationf
file!");
+		}
+		
+		this.beanFactory = BeanFactoryUtil.createRootBeanFactory(avalonEnvironment);
+//		ConfigurationInfo springBeanConfiguration = ConfigReader.readConfiguration(source, env)
+    }
+
+	// ~~~~~~~~~~~~~~~ delegating ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	
+	public void addBeanPostProcessor(BeanPostProcessor beanPostProcessor) {
+		this.beanFactory.addBeanPostProcessor(beanPostProcessor);
+	}
+
+	public boolean containsSingleton(String arg0) {
+		return this.beanFactory.containsSingleton(arg0);
+	}
+
+	public void destroySingletons() {
+		this.beanFactory.destroySingletons();
+	}
+
+	public int getBeanPostProcessorCount() {
+		return this.beanFactory.getBeanPostProcessorCount();
+	}
+
+	public void registerAlias(String arg0, String arg1) throws BeansException {
+		this.beanFactory.registerAlias(arg0, arg1);
+	}
+
+	public void registerCustomEditor(Class arg0, PropertyEditor arg1) {
+		this.beanFactory.registerCustomEditor(arg0, arg1);
+	}
+
+	public void registerSingleton(String arg0, Object arg1) throws BeansException {
+		this.beanFactory.registerSingleton(arg0, arg1);
+	}
+
+	public void setParentBeanFactory(BeanFactory arg0) {
+		this.beanFactory.setParentBeanFactory(arg0);
+	}
+
+	public BeanFactory getParentBeanFactory() {
+		return this.beanFactory.getParentBeanFactory();
+	}
+
+	public boolean containsBean(String arg0) {
+		return this.beanFactory.containsBean(arg0);
+	}
+
+	public String[] getAliases(String arg0) throws NoSuchBeanDefinitionException {
+		return this.beanFactory.getAliases(arg0);
+	}
+
+	public Object getBean(String arg0) throws BeansException {
+		return this.beanFactory.getBean(arg0);
+	}
+
+	public Object getBean(String arg0, Class arg1) throws BeansException {
+		return this.beanFactory.getBean(arg0, arg1);
+	}
+
+	public Class getType(String arg0) throws NoSuchBeanDefinitionException {
+		return this.beanFactory.getType(arg0);
+	}
+
+	public boolean isSingleton(String arg0) throws NoSuchBeanDefinitionException {
+		return this.beanFactory.isSingleton(arg0);
+	}
+	
+
+}

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringECMFactory.java
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message