cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r433975 [3/7] - in /cocoon/trunk: blocks/cocoon-ajax/cocoon-ajax-impl/ blocks/cocoon-axis/cocoon-axis-impl/src/main/java/org/apache/cocoon/components/axis/ blocks/cocoon-axis/cocoon-axis-impl/src/main/resources/org/apache/cocoon/components/...
Date Wed, 23 Aug 2006 08:25:26 GMT
Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.classpath
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.classpath?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.classpath (original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.classpath Wed Aug 23 01:25:01 2006
@@ -1,9 +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>
+<?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:eol-style = native

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.project
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.project?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.project (original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.project Wed Aug 23 01:25:01 2006
@@ -1,46 +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>
+<?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:eol-style = native

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/.wtpmodules
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/MANIFEST.MF
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/META-INF/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/build.properties
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/build.properties?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/build.properties (original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/build.properties Wed Aug 23 01:25:01 2006
@@ -1,4 +1,4 @@
-source.. = src/main/java/,\
-           src/test/java/
-bin.includes = META-INF/,\
-               .
+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:eol-style = native

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/cocoon/App.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/cocoon/App.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/cocoon/App.java (original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/main/java/org/apache/cocoon/App.java Wed Aug 23 01:25:01 2006
@@ -1,13 +1,13 @@
-package org.apache.cocoon;
-
-/**
- * Hello world!
- *
- */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
-}
+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:eol-style = native

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/AppTest.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/AppTest.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/AppTest.java (original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/AppTest.java Wed Aug 23 01:25:01 2006
@@ -1,38 +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 );
-    }
-}
+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:eol-style = native

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AbstractOSGiTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AbstractOSGiTestCase.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AbstractOSGiTestCase.java (original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AbstractOSGiTestCase.java Wed Aug 23 01:25:01 2006
@@ -1,25 +1,25 @@
-/*
- * 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;
-
-/**
- * @version $Id$
- */
-abstract class AbstractOSGiTestCase extends TestCase {
-
-}
+/*
+ * 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;
+
+/**
+ * @version $Id$
+ */
+abstract class AbstractOSGiTestCase extends TestCase {
+
+}

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AbstractOSGiTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AllOSGiTests.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AllOSGiTests.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AllOSGiTests.java (original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/AllOSGiTests.java Wed Aug 23 01:25:01 2006
@@ -1,30 +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);
-    }
-	
-}
+/*
+ * 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:eol-style = native

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiLoggerTest.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiLoggerTest.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiLoggerTest.java (original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiLoggerTest.java Wed Aug 23 01:25:01 2006
@@ -1,45 +1,45 @@
-/*
- * 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.textui.TestRunner;
-
-import org.apache.avalon.framework.logger.Logger;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * @version $Id$
- */
-public class OSGiLoggerTest extends AbstractOSGiTestCase {
-
-	private static Logger logger;
-
-	protected Logger getLogger() {
-		return logger;
-	}
-
-	protected void setLogger(Logger logger) {
-		OSGiLoggerTest.logger = logger;
-	}
-	
-	public void testIsServiceAvailable() {
-		logger.debug("testIsServiceAvailable");
-	}
-	
-    protected void activate(ComponentContext componentContext) {
-    	TestRunner.run(OSGiLoggerTest.class);
-    }	
-}
+/*
+ * 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.textui.TestRunner;
+
+import org.apache.avalon.framework.logger.Logger;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * @version $Id$
+ */
+public class OSGiLoggerTest extends AbstractOSGiTestCase {
+
+	private static Logger logger;
+
+	protected Logger getLogger() {
+		return logger;
+	}
+
+	protected void setLogger(Logger logger) {
+		OSGiLoggerTest.logger = logger;
+	}
+	
+	public void testIsServiceAvailable() {
+		logger.debug("testIsServiceAvailable");
+	}
+	
+    protected void activate(ComponentContext componentContext) {
+    	TestRunner.run(OSGiLoggerTest.class);
+    }	
+}

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

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSettingsTest.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSettingsTest.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSettingsTest.java (original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSettingsTest.java Wed Aug 23 01:25:01 2006
@@ -1,46 +1,46 @@
-/*
- * 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.textui.TestRunner;
-
-import org.apache.cocoon.core.Settings;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * @version $Id$
- */
-public class OSGiSettingsTest extends AbstractOSGiTestCase {
-
-	private static Settings settings;
-
-	protected Settings getSettings() {
-		return settings;
-	}
-
-	protected void setSettings(final Settings settings) {
-		OSGiSettingsTest.settings = settings;
-	}
-
-	public void testIsServiceAvailable() {
-		assertNotNull(settings);
-	}
-	
-    protected void activate(ComponentContext componentContext) {
-    	TestRunner.run(OSGiSettingsTest.class);
-    }	
-	
-}
+/*
+ * 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.textui.TestRunner;
+
+import org.apache.cocoon.core.Settings;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * @version $Id$
+ */
+public class OSGiSettingsTest extends AbstractOSGiTestCase {
+
+	private static Settings settings;
+
+	protected Settings getSettings() {
+		return settings;
+	}
+
+	protected void setSettings(final Settings settings) {
+		OSGiSettingsTest.settings = settings;
+	}
+
+	public void testIsServiceAvailable() {
+		assertNotNull(settings);
+	}
+	
+    protected void activate(ComponentContext componentContext) {
+    	TestRunner.run(OSGiSettingsTest.class);
+    }	
+	
+}

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

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSpringECMFactoryTest.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSpringECMFactoryTest.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSpringECMFactoryTest.java (original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSpringECMFactoryTest.java Wed Aug 23 01:25:01 2006
@@ -1,54 +1,54 @@
-/*
- * 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.textui.TestRunner;
-
-import org.apache.cocoon.core.osgi.CocoonSpringBeanRegistry;
-import org.apache.excalibur.store.Store;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * @version $Id$
- */
-public class OSGiSpringECMFactoryTest extends AbstractOSGiTestCase {
-
-	private static CocoonSpringBeanRegistry beanFactory;
-
-	public void testIfBeansAreAvailable() {
-		Store store = (Store) beanFactory.getBean(Store.ROLE);
-		assertNotNull(store);
-	}
-	
-	/**
-	 * @return the beanFactory
-	 */
-	protected CocoonSpringBeanRegistry getBeanFactory() {
-		return beanFactory;
-	}
-
-	/**
-	 * @param beanFactory the beanFactory to set
-	 */
-	protected void setBeanFactory(CocoonSpringBeanRegistry beanFactory) {
-		OSGiSpringECMFactoryTest.beanFactory = beanFactory;
-	}
-	
-    protected void activate(ComponentContext componentContext) {
-    	TestRunner.run(OSGiSpringECMFactoryTest.class);
-    }		
-	
-}
+/*
+ * 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.textui.TestRunner;
+
+import org.apache.cocoon.core.osgi.CocoonSpringBeanRegistry;
+import org.apache.excalibur.store.Store;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * @version $Id$
+ */
+public class OSGiSpringECMFactoryTest extends AbstractOSGiTestCase {
+
+	private static CocoonSpringBeanRegistry beanFactory;
+
+	public void testIfBeansAreAvailable() {
+		Store store = (Store) beanFactory.getBean(Store.ROLE);
+		assertNotNull(store);
+	}
+	
+	/**
+	 * @return the beanFactory
+	 */
+	protected CocoonSpringBeanRegistry getBeanFactory() {
+		return beanFactory;
+	}
+
+	/**
+	 * @param beanFactory the beanFactory to set
+	 */
+	protected void setBeanFactory(CocoonSpringBeanRegistry beanFactory) {
+		OSGiSpringECMFactoryTest.beanFactory = beanFactory;
+	}
+	
+    protected void activate(ComponentContext componentContext) {
+    	TestRunner.run(OSGiSpringECMFactoryTest.class);
+    }		
+	
+}

Propchange: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-tests/src/test/java/org/apache/cocoon/osgitests/OSGiSpringECMFactoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/core/cocoon-bootstrap/src/main/resources/META-INF/legacy/xconf/cocoon-bootstrap-realoding-classloader-factory.xconf
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-bootstrap/src/main/resources/META-INF/legacy/xconf/cocoon-bootstrap-realoding-classloader-factory.xconf?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-bootstrap/src/main/resources/META-INF/legacy/xconf/cocoon-bootstrap-realoding-classloader-factory.xconf (original)
+++ cocoon/trunk/core/cocoon-bootstrap/src/main/resources/META-INF/legacy/xconf/cocoon-bootstrap-realoding-classloader-factory.xconf Wed Aug 23 01:25:01 2006
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<!-- SVN $Id: cocoon-core.xconf 396505 2006-04-24 10:33:03Z antonio $ -->
-<components>
-
-  <!--+
-      | Reloading classloader
-      +-->
-  <component logger="core.classloader"
-    role="org.apache.cocoon.classloader.ClassLoaderFactory/reloading"
-    class="org.apache.cocoon.classloader.ReloadingClassLoaderFactory">
-  </component>
-
-</components>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<!-- SVN $Id: cocoon-core.xconf 396505 2006-04-24 10:33:03Z antonio $ -->
+<components>
+
+  <!--+
+      | Reloading classloader
+      +-->
+  <component logger="core.classloader"
+    role="org.apache.cocoon.classloader.ClassLoaderFactory/reloading"
+    class="org.apache.cocoon.classloader.ReloadingClassLoaderFactory">
+  </component>
+
+</components>

Propchange: cocoon/trunk/core/cocoon-bootstrap/src/main/resources/META-INF/legacy/xconf/cocoon-bootstrap-realoding-classloader-factory.xconf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-core/COB-INF/sitemap.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-core/COB-INF/sub/sitemap.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-core/COB-INF/sub/test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-core/COB-INF/test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-core/META-INF/MANIFEST.MF
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/core/cocoon-core/META-INF/components.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/META-INF/components.xml?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/META-INF/components.xml (original)
+++ cocoon/trunk/core/cocoon-core/META-INF/components.xml Wed Aug 23 01:25:01 2006
@@ -36,21 +36,21 @@
       bind="setSettings"/>      
   </scr:component>  
   
-  <scr:component name="org.apache.cocoon.core.BlockServlet">
-    <scr:implementation class="org.apache.cocoon.blocks.BlockServlet"/>
-    <scr:service>
-      <scr:provide interface="javax.servlet.Servlet"/>
-	</scr:service>
-	
-    <scr:property name="path" value="/sitemap-test"/>
-    <scr:property name="servletClass" value="org.apache.cocoon.sitemap.SitemapServlet"/>
-    <scr:property name="sitemapPath" value="/COB-INF/sitemap.xmap"/>            
-
-    <scr:reference name="org.springframework.web.context.WebApplicationContext.ROOT"
-      interface="org.apache.cocoon.core.osgi.CocoonSpringBeanRegistry"
-      target="(component.name=org.apache.cocoon.core.osgi.SpringEcmFactory)"/>         
-  </scr:component>
-
+  <scr:component name="org.apache.cocoon.core.BlockServlet">
+    <scr:implementation class="org.apache.cocoon.blocks.BlockServlet"/>
+    <scr:service>
+      <scr:provide interface="javax.servlet.Servlet"/>
+	</scr:service>
+	
+    <scr:property name="path" value="/sitemap-test"/>
+    <scr:property name="servletClass" value="org.apache.cocoon.sitemap.SitemapServlet"/>
+    <scr:property name="sitemapPath" value="/COB-INF/sitemap.xmap"/>            
+
+    <scr:reference name="org.springframework.web.context.WebApplicationContext.ROOT"
+      interface="org.apache.cocoon.core.osgi.CocoonSpringBeanRegistry"
+      target="(component.name=org.apache.cocoon.core.osgi.SpringEcmFactory)"/>         
+  </scr:component>
+
   <!--scr:component name="org.apache.cocoon.core.osgi.SpringBridge">
     <scr:implementation class="org.apache.cocoon.core.osgi.OSGiSpringBridge"/>
     <scr:service>

Propchange: cocoon/trunk/core/cocoon-core/META-INF/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/CocoonSpringBeanRegistry.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/CocoonSpringBeanRegistry.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/CocoonSpringBeanRegistry.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/CocoonSpringBeanRegistry.java Wed Aug 23 01:25:01 2006
@@ -1,29 +1,29 @@
-/*
- * 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.springframework.beans.factory.BeanFactory;
-
-/**
- * Another interface needed to be introduced because Equinox hat some problems with
- * the name @link {@link BeanFactory} because of some introspection
- * done on all classes that end on "Factory".
- * 
- * @version $Id$
- */
-public interface CocoonSpringBeanRegistry extends BeanFactory {
-
-}
+/*
+ * 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.springframework.beans.factory.BeanFactory;
+
+/**
+ * Another interface needed to be introduced because Equinox hat some problems with
+ * the name @link {@link BeanFactory} because of some introspection
+ * done on all classes that end on "Factory".
+ * 
+ * @version $Id$
+ */
+public interface CocoonSpringBeanRegistry extends BeanFactory {
+
+}

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/CocoonSpringBeanRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/CocoonSpringConfigurableListableBeanRegistry.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/CocoonSpringConfigurableListableBeanRegistry.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/CocoonSpringConfigurableListableBeanRegistry.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/CocoonSpringConfigurableListableBeanRegistry.java Wed Aug 23 01:25:01 2006
@@ -1,30 +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.core.osgi;
-
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-
-/**
- * Another interface needed to be introduced because Equinox hat some problems with
- * the name @link {@link ConfigurableListableBeanFactory} because of some introspection
- * done on all classes that end on "Factory".
- * 
- * @version $Id$
- */
-public interface CocoonSpringConfigurableListableBeanRegistry
-extends CocoonSpringBeanRegistry, ConfigurableListableBeanFactory {
-
-}
+/*
+ * 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.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+
+/**
+ * Another interface needed to be introduced because Equinox hat some problems with
+ * the name @link {@link ConfigurableListableBeanFactory} because of some introspection
+ * done on all classes that end on "Factory".
+ * 
+ * @version $Id$
+ */
+public interface CocoonSpringConfigurableListableBeanRegistry
+extends CocoonSpringBeanRegistry, ConfigurableListableBeanFactory {
+
+}

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/CocoonSpringConfigurableListableBeanRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/ECMConfigurationFileNotSetException.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/ECMConfigurationFileNotSetException.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/ECMConfigurationFileNotSetException.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/ECMConfigurationFileNotSetException.java Wed Aug 23 01:25:01 2006
@@ -1,27 +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);
-	}
-
-}
+/*
+ * 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:eol-style = native

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiLogger.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiLogger.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiLogger.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiLogger.java Wed Aug 23 01:25:01 2006
@@ -1,185 +1,185 @@
-/*
- * 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);
-            ((OSGiLogger) result).setLogService(this.logService);            
-            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;
-	}
-
-}
+/*
+ * 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);
+            ((OSGiLogger) result).setLogService(this.logService);            
+            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:eol-style = native

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiServletContext.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiServletContext.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiServletContext.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiServletContext.java Wed Aug 23 01:25:01 2006
@@ -1,70 +1,70 @@
-/*
- * 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.net.MalformedURLException;
-import java.net.URL;
-
-import org.apache.avalon.framework.logger.Logger;
-import org.apache.cocoon.environment.impl.AbstractContext;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * @version $Id$
- */
-public class OSGiServletContext extends AbstractContext {
-	
-	private Logger logger;
-	private ComponentContext componentContext;
-	
-	public OSGiServletContext(Logger logger, ComponentContext componentContext) {
-		super();
-		this.logger = logger;
-		this.componentContext = componentContext;
-	}	
-
-	/**
-	 * @see org.apache.cocoon.environment.impl.AbstractContext#getResource(java.lang.String)
-	 */
-	public URL getResource(String path) throws MalformedURLException {
-		if(path.length() == 0 || path.charAt(0) != '/') {
-			throw new MalformedURLException("The path (" + path + ") must start with '/'.");
-		}
-		return this.componentContext.getBundleContext().getBundle().getEntry(path);
-	}
-
-	/**
-	 * Logging to debug
-	 */
-	public void log(String msg) {
-		this.logger.info(msg);
-	}
-
-	/**
-	 * Logging to debug
-	 */	
-	public void log(Exception e, String msg) {
-		this.logger.info(msg);
-	}
-
-	/**
-	 * Logging to debug
-	 */	
-	public void log(String msg, Throwable t) {
-		this.logger.info(msg, t);
-	}
-
-}
+/*
+ * 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.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.avalon.framework.logger.Logger;
+import org.apache.cocoon.environment.impl.AbstractContext;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * @version $Id$
+ */
+public class OSGiServletContext extends AbstractContext {
+	
+	private Logger logger;
+	private ComponentContext componentContext;
+	
+	public OSGiServletContext(Logger logger, ComponentContext componentContext) {
+		super();
+		this.logger = logger;
+		this.componentContext = componentContext;
+	}	
+
+	/**
+	 * @see org.apache.cocoon.environment.impl.AbstractContext#getResource(java.lang.String)
+	 */
+	public URL getResource(String path) throws MalformedURLException {
+		if(path.length() == 0 || path.charAt(0) != '/') {
+			throw new MalformedURLException("The path (" + path + ") must start with '/'.");
+		}
+		return this.componentContext.getBundleContext().getBundle().getEntry(path);
+	}
+
+	/**
+	 * Logging to debug
+	 */
+	public void log(String msg) {
+		this.logger.info(msg);
+	}
+
+	/**
+	 * Logging to debug
+	 */	
+	public void log(Exception e, String msg) {
+		this.logger.info(msg);
+	}
+
+	/**
+	 * Logging to debug
+	 */	
+	public void log(String msg, Throwable t) {
+		this.logger.info(msg, t);
+	}
+
+}

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiServletContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSettings.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSettings.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSettings.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSettings.java Wed Aug 23 01:25:01 2006
@@ -1,49 +1,49 @@
-/*
- * 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.configuration.impl.MutableSettings;
-import org.apache.cocoon.core.CoreUtil;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * @version $Id$
- */
-public class OSGiSettings extends MutableSettings {
-	
-    private Logger logger;
-
-    public OSGiSettings(String mode) {
-        super(mode);
-    }
-
-	protected void activate(ComponentContext componentContext) {
-    	CoreUtil.initSettingsFiles(this, this.logger);
-        // componentContext.getBundleContext().getDataFile("cocoon-files");
-//    	this.setConfiguration("/META-INF/xconf/cocoon.xconf"); // TODO (DF/RP) probably not used by the OSGi framework!
-    	this.makeReadOnly();
-    }
-
-	protected Logger getLogger() {
-		return logger;
-	}
-
-	protected void setLogger(Logger logger) {
-		this.logger = logger;
-	}
-
-}
+/*
+ * 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.configuration.impl.MutableSettings;
+import org.apache.cocoon.core.CoreUtil;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * @version $Id$
+ */
+public class OSGiSettings extends MutableSettings {
+	
+    private Logger logger;
+
+    public OSGiSettings(String mode) {
+        super(mode);
+    }
+
+	protected void activate(ComponentContext componentContext) {
+    	CoreUtil.initSettingsFiles(this, this.logger);
+        // componentContext.getBundleContext().getDataFile("cocoon-files");
+//    	this.setConfiguration("/META-INF/xconf/cocoon.xconf"); // TODO (DF/RP) probably not used by the OSGi framework!
+    	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:eol-style = native

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringBridge.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringBridge.java?rev=433975&r1=433974&r2=433975&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringBridge.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringBridge.java Wed Aug 23 01:25:01 2006
@@ -1,133 +1,133 @@
-/*
- * 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.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.component.ComponentContext;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.FatalBeanException;
-import org.springframework.beans.factory.BeanNotOfRequiredTypeException;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-
-/**
- * The {@link OSGiSpringBridge} is used to provide OSGi services as Spring beans.
- * It can also be used as parent bean factory for {@link OSGiSpringECMFactory} services.
- * 
- * @version $Id$
- */
-public class OSGiSpringBridge implements CocoonSpringBeanRegistry {
-    private BundleContext bundleContext;
-    
-    public static final String HINT_PROPERTY = "component.hint";
-    
-    protected void activate(ComponentContext componentContext) {
-        System.out.println("OSGiSpringBridge: activate");
-        this.bundleContext = componentContext.getBundleContext();
-    }
-    
-    protected void deactivate(ComponentContext componentContext) {
-        
-    }
-
-	public boolean containsBean(String beanName) {
-        System.out.println("containsBean name=" + beanName);
-	    try {
-            return getServiceReference(this.bundleContext, beanName) != null;
-        } catch (InvalidSyntaxException e) {
-            return false;
-        }
-	}
-
-	public String[] getAliases(String beanName) throws NoSuchBeanDefinitionException {
-        if (!containsBean(beanName))
-            throw new NoSuchBeanDefinitionException(beanName);
-        // FIXME aliases should probably be registred as services in some way
-		return new String[]{};
-	}
-
-	public Object getBean(String beanName) throws BeansException {
-	    return getBean(beanName, null);
-    }
-
-	public Object getBean(String beanName, Class clazz) throws BeansException {
-        System.out.println("getBean name=" + beanName + " class=" +
-                (clazz != null ? clazz.getName() : ""));
-        ServiceReference reference = null;
-        try {
-            reference = getServiceReference(this.bundleContext, beanName);
-        } catch (InvalidSyntaxException e) {
-            throw new FatalBeanException("Cannot look up OSGi service " + beanName, e);
-        }
-        if (reference == null) {
-            throw new NoSuchBeanDefinitionException(beanName);
-        }
-        // TODO services are never returned to the context,
-        // don't know how to fix that with Spring
-        Object bean = this.bundleContext.getService(reference);
-        
-        if (clazz != null && !clazz.isInstance(bean))
-            throw new BeanNotOfRequiredTypeException(beanName, clazz, bean.getClass());
-        
-        return bean;
-	}
-
-	public Class getType(String beanName) throws NoSuchBeanDefinitionException {
-	    return getBean(beanName).getClass();
-    }
-
-	public boolean isSingleton(String beanName) throws NoSuchBeanDefinitionException {
-        if (!containsBean(beanName))
-            throw new NoSuchBeanDefinitionException(beanName);
-        // all OSGi services are supposed to be singletons
-		return true;
-	}
-
-    public static ServiceReference getServiceReference(BundleContext ctx, String role)
-    throws InvalidSyntaxException {
-        ServiceReference result;
-        String itf = getServiceInterface(role); 
-        String hint = getServiceHint(role);
-
-        if (hint == null) {
-            // Single interface role
-            result = ctx.getServiceReference(itf);
-        } else {
-            // '*' is used as wildcard character in LDAP filters, it is also used
-            // as hint for the URLSourceFactory and need to be escaped
-            if ("*".equals(hint))
-                hint = "\\*";
-            // Hinted role: create query
-            String query = "(" + HINT_PROPERTY + "=" + hint + ")";
-            ServiceReference[] results = ctx.getServiceReferences(itf, query);
-            result = (results != null && results.length > 0) ? results[0] : null;
-        }
-
-        return result;
-    }
-
-    public static String getServiceInterface(String role) {
-        int pos = role.indexOf('/');
-        
-        return pos == -1 ? role : role.substring(0, pos);
-    }
-    
-    public static String getServiceHint(String role) {
-        int pos = role.indexOf('/');
-        return pos == -1 ? null : role.substring(pos+1);
-    }
-}
+/*
+ * 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.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.component.ComponentContext;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.FatalBeanException;
+import org.springframework.beans.factory.BeanNotOfRequiredTypeException;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+
+/**
+ * The {@link OSGiSpringBridge} is used to provide OSGi services as Spring beans.
+ * It can also be used as parent bean factory for {@link OSGiSpringECMFactory} services.
+ * 
+ * @version $Id$
+ */
+public class OSGiSpringBridge implements CocoonSpringBeanRegistry {
+    private BundleContext bundleContext;
+    
+    public static final String HINT_PROPERTY = "component.hint";
+    
+    protected void activate(ComponentContext componentContext) {
+        System.out.println("OSGiSpringBridge: activate");
+        this.bundleContext = componentContext.getBundleContext();
+    }
+    
+    protected void deactivate(ComponentContext componentContext) {
+        
+    }
+
+	public boolean containsBean(String beanName) {
+        System.out.println("containsBean name=" + beanName);
+	    try {
+            return getServiceReference(this.bundleContext, beanName) != null;
+        } catch (InvalidSyntaxException e) {
+            return false;
+        }
+	}
+
+	public String[] getAliases(String beanName) throws NoSuchBeanDefinitionException {
+        if (!containsBean(beanName))
+            throw new NoSuchBeanDefinitionException(beanName);
+        // FIXME aliases should probably be registred as services in some way
+		return new String[]{};
+	}
+
+	public Object getBean(String beanName) throws BeansException {
+	    return getBean(beanName, null);
+    }
+
+	public Object getBean(String beanName, Class clazz) throws BeansException {
+        System.out.println("getBean name=" + beanName + " class=" +
+                (clazz != null ? clazz.getName() : ""));
+        ServiceReference reference = null;
+        try {
+            reference = getServiceReference(this.bundleContext, beanName);
+        } catch (InvalidSyntaxException e) {
+            throw new FatalBeanException("Cannot look up OSGi service " + beanName, e);
+        }
+        if (reference == null) {
+            throw new NoSuchBeanDefinitionException(beanName);
+        }
+        // TODO services are never returned to the context,
+        // don't know how to fix that with Spring
+        Object bean = this.bundleContext.getService(reference);
+        
+        if (clazz != null && !clazz.isInstance(bean))
+            throw new BeanNotOfRequiredTypeException(beanName, clazz, bean.getClass());
+        
+        return bean;
+	}
+
+	public Class getType(String beanName) throws NoSuchBeanDefinitionException {
+	    return getBean(beanName).getClass();
+    }
+
+	public boolean isSingleton(String beanName) throws NoSuchBeanDefinitionException {
+        if (!containsBean(beanName))
+            throw new NoSuchBeanDefinitionException(beanName);
+        // all OSGi services are supposed to be singletons
+		return true;
+	}
+
+    public static ServiceReference getServiceReference(BundleContext ctx, String role)
+    throws InvalidSyntaxException {
+        ServiceReference result;
+        String itf = getServiceInterface(role); 
+        String hint = getServiceHint(role);
+
+        if (hint == null) {
+            // Single interface role
+            result = ctx.getServiceReference(itf);
+        } else {
+            // '*' is used as wildcard character in LDAP filters, it is also used
+            // as hint for the URLSourceFactory and need to be escaped
+            if ("*".equals(hint))
+                hint = "\\*";
+            // Hinted role: create query
+            String query = "(" + HINT_PROPERTY + "=" + hint + ")";
+            ServiceReference[] results = ctx.getServiceReferences(itf, query);
+            result = (results != null && results.length > 0) ? results[0] : null;
+        }
+
+        return result;
+    }
+
+    public static String getServiceInterface(String role) {
+        int pos = role.indexOf('/');
+        
+        return pos == -1 ? role : role.substring(0, pos);
+    }
+    
+    public static String getServiceHint(String role) {
+        int pos = role.indexOf('/');
+        return pos == -1 ? null : role.substring(pos+1);
+    }
+}

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/osgi/OSGiSpringBridge.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message