aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject svn commit: r1075097 [1/2] - in /aries/tags/jndi-0.1-incubating: ./ jndi-bundle/ jndi-bundle/src/ jndi-bundle/src/main/ jndi-bundle/src/main/java/ jndi-bundle/src/main/java/org/ jndi-bundle/src/main/java/org/apache/ jndi-bundle/src/main/java/org/apache...
Date Sun, 27 Feb 2011 18:01:02 GMT
Author: zoe
Date: Sun Feb 27 18:01:00 2011
New Revision: 1075097

URL: http://svn.apache.org/viewvc?rev=1075097&view=rev
Log:
Restore jndi 0.1

Added:
    aries/tags/jndi-0.1-incubating/
    aries/tags/jndi-0.1-incubating/LICENSE
    aries/tags/jndi-0.1-incubating/NOTICE
    aries/tags/jndi-0.1-incubating/jndi-bundle/
    aries/tags/jndi-0.1-incubating/jndi-bundle/pom.xml
    aries/tags/jndi-0.1-incubating/jndi-bundle/src/
    aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/
    aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/java/
    aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/java/org/
    aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/java/org/apache/
    aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/java/org/apache/aries/
    aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/java/org/apache/aries/jndi/
    aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/java/org/apache/aries/jndi/priv/
    aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/java/org/apache/aries/jndi/priv/Activator.java
    aries/tags/jndi-0.1-incubating/jndi-core/
    aries/tags/jndi-0.1-incubating/jndi-core/pom.xml
    aries/tags/jndi-0.1-incubating/jndi-core/src/
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/ContextHelper.java
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/DelegateContext.java
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/DelegateContextFactory.java
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/OSGiInitialContextFactoryBuilder.java
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/OSGiObjectFactoryBuilder.java
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/startup/
    aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/startup/Activator.java
    aries/tags/jndi-0.1-incubating/jndi-core/src/test/
    aries/tags/jndi-0.1-incubating/jndi-core/src/test/java/
    aries/tags/jndi-0.1-incubating/jndi-core/src/test/java/org/
    aries/tags/jndi-0.1-incubating/jndi-core/src/test/java/org/apache/
    aries/tags/jndi-0.1-incubating/jndi-core/src/test/java/org/apache/aries/
    aries/tags/jndi-0.1-incubating/jndi-core/src/test/java/org/apache/aries/jndi/
    aries/tags/jndi-0.1-incubating/jndi-core/src/test/java/org/apache/aries/jndi/ObjectFactoryTest.java
    aries/tags/jndi-0.1-incubating/jndi-url/
    aries/tags/jndi-0.1-incubating/jndi-url/pom.xml
    aries/tags/jndi-0.1-incubating/jndi-url/src/
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/jndi/
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/jndi/services/
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/jndi/url/
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/jndi/url/AbstractServiceRegistryContext.java
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/jndi/url/Activator.java
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/jndi/url/OsgiName.java
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/jndi/url/OsgiNameParser.java
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/jndi/url/OsgiURLContextFactory.java
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/jndi/url/ServiceRegistryContext.java
    aries/tags/jndi-0.1-incubating/jndi-url/src/main/java/org/apache/aries/jndi/url/ServiceRegistryListContext.java
    aries/tags/jndi-0.1-incubating/jndi-url/src/test/
    aries/tags/jndi-0.1-incubating/jndi-url/src/test/java/
    aries/tags/jndi-0.1-incubating/jndi-url/src/test/java/org/
    aries/tags/jndi-0.1-incubating/jndi-url/src/test/java/org/apache/
    aries/tags/jndi-0.1-incubating/jndi-url/src/test/java/org/apache/aries/
    aries/tags/jndi-0.1-incubating/jndi-url/src/test/java/org/apache/aries/jndi/
    aries/tags/jndi-0.1-incubating/jndi-url/src/test/java/org/apache/aries/jndi/url/
    aries/tags/jndi-0.1-incubating/jndi-url/src/test/java/org/apache/aries/jndi/url/OsgiNameParserTest.java
    aries/tags/jndi-0.1-incubating/jndi-url/src/test/java/org/apache/aries/jndi/url/ServiceRegistryContextTest.java
    aries/tags/jndi-0.1-incubating/pom.xml

Added: aries/tags/jndi-0.1-incubating/LICENSE
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/LICENSE?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/LICENSE (added)
+++ aries/tags/jndi-0.1-incubating/LICENSE Sun Feb 27 18:01:00 2011
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+

Added: aries/tags/jndi-0.1-incubating/NOTICE
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/NOTICE?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/NOTICE (added)
+++ aries/tags/jndi-0.1-incubating/NOTICE Sun Feb 27 18:01:00 2011
@@ -0,0 +1,8 @@
+
+Apache Aries
+Copyright 2009-2010 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+

Added: aries/tags/jndi-0.1-incubating/jndi-bundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/jndi-bundle/pom.xml?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/jndi-bundle/pom.xml (added)
+++ aries/tags/jndi-0.1-incubating/jndi-bundle/pom.xml Sun Feb 27 18:01:00 2011
@@ -0,0 +1,178 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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.
+-->
+<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>
+    <parent>
+        <groupId>org.apache.aries.jndi</groupId>
+        <artifactId>jndi</artifactId>
+        <version>0.1-incubating</version>
+    </parent>
+
+    <artifactId>org.apache.aries.jndi</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache Aries JNDI Bundle</name>
+    <description>
+        This bundle contains the core JNDI along with the OSGi url handler.
+        It's composed of the jndi-core and jndi-url modules.
+    </description>
+
+    <properties>
+        <aries.osgi.export.pkg>
+            org.osgi.service.jndi;org.osgi.service.jndi.services
+        </aries.osgi.export.pkg>
+        <aries.osgi.private.pkg>
+            org.apache.aries.jndi*
+        </aries.osgi.private.pkg>
+        <aries.osgi.activator>
+            org.apache.aries.jndi.priv.Activator
+        </aries.osgi.activator>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.aries.jndi</groupId>
+            <artifactId>org.apache.aries.jndi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.jndi</groupId>
+            <artifactId>org.apache.aries.jndi.url</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <!-- Use the shade plugin with the dependency plugin to unjar the three jars (api, core and cm)
+                 so that the associated sources and javadocs jars are complete.
+                 To build the main jar, the maven-bundle-plugin is used, that's why everything is exluded -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <artifactSet>
+                                <includes>
+                                    <include>org.apache.aries.jndi:org.apache.aries.jndi.core</include>
+                                    <include>org.apache.aries.jndi:org.apache.aries.jndi.url</include>
+                                </includes>
+                            </artifactSet>
+                            <filters>
+                                <filter>
+                                    <artifact>org.apache.aries.jndi:org.apache.aries.jndi.core</artifact>
+                                    <excludes>
+                                        <exclude>org/**</exclude>
+                                    </excludes>
+                                </filter>
+                                <filter>
+                                    <artifact>org.apache.aries.jndi:org.apache.aries.jndi.url</artifact>
+                                    <excludes>
+                                        <exclude>org/**</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                            <createSourcesJar>${createSourcesJar}</createSourcesJar>
+                            <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
+                            <createDependencyReducedPom>true</createDependencyReducedPom>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>deploy</id>
+            <properties>
+                <createSourcesJar>true</createSourcesJar>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-dependency-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>unpack-sources</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>unpack</goal>
+                                </goals>
+                                <configuration>
+                                    <artifactItems>
+                                        <artifactItem>
+                                            <groupId>org.apache.aries.jndi</groupId>
+                                            <artifactId>org.apache.aries.jndi.core</artifactId>
+                                            <classifier>sources</classifier>
+                                        </artifactItem>
+                                        <artifactItem>
+                                            <groupId>org.apache.aries.jndi</groupId>
+                                            <artifactId>org.apache.aries.jndi.url</artifactId>
+                                            <classifier>sources</classifier>
+                                        </artifactItem>
+                                    </artifactItems>
+                                    <outputDirectory>${project.build.directory}/sources</outputDirectory>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>attach-sources</id>
+                                <phase>process-classes</phase>
+                                <goals>
+                                    <goal>jar</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-javadoc-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>package</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>jar</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <minmemory>128m</minmemory>
+                            <maxmemory>512m</maxmemory>
+                            <sourcepath>${project.build.directory}/sources</sourcepath>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>

Added: aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/java/org/apache/aries/jndi/priv/Activator.java
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/java/org/apache/aries/jndi/priv/Activator.java?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/java/org/apache/aries/jndi/priv/Activator.java (added)
+++ aries/tags/jndi-0.1-incubating/jndi-bundle/src/main/java/org/apache/aries/jndi/priv/Activator.java Sun Feb 27 18:01:00 2011
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.aries.jndi.priv;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+    private BundleActivator[] activators;
+
+    public Activator() {
+        this.activators = new BundleActivator[]{
+                new org.apache.aries.jndi.startup.Activator(),
+                new org.apache.aries.jndi.url.Activator()
+        };
+    }
+
+    public void start(BundleContext bundleContext) throws Exception {
+        for (BundleActivator activator : activators) {
+            activator.start(bundleContext);
+        }
+    }
+
+    public void stop(BundleContext bundleContext) throws Exception {
+        for (BundleActivator activator : activators) {
+            activator.stop(bundleContext);
+        }
+    }
+
+}

Added: aries/tags/jndi-0.1-incubating/jndi-core/pom.xml
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/jndi-core/pom.xml?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/jndi-core/pom.xml (added)
+++ aries/tags/jndi-0.1-incubating/jndi-core/pom.xml Sun Feb 27 18:01:00 2011
@@ -0,0 +1,59 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+<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>
+  <parent>
+    <groupId>org.apache.aries.jndi</groupId>
+    <artifactId>jndi</artifactId>
+    <version>0.1-incubating</version>
+  </parent>
+
+  <artifactId>org.apache.aries.jndi.core</artifactId>
+  <packaging>bundle</packaging>
+  <name>Apache Aries JNDI Core</name>
+  <description>
+      This bundle contains the core of JNDI support for OSGi.
+  </description>
+
+  <properties>
+    <aries.osgi.export.pkg>
+      org.apache.aries.jndi
+    </aries.osgi.export.pkg>
+    <aries.osgi.private.pkg>
+      org.apache.aries.jndi.startup
+    </aries.osgi.private.pkg>
+    <aries.osgi.activator>
+      org.apache.aries.jndi.startup.Activator
+    </aries.osgi.activator>
+  </properties>
+  
+  <dependencies>
+      <dependency>
+          <groupId>org.osgi</groupId>
+          <artifactId>org.osgi.core</artifactId>
+          <scope>provided</scope>
+      </dependency>
+      <dependency>
+          <groupId>org.apache.aries.testsupport</groupId>
+          <artifactId>org.apache.aries.testsupport.unit</artifactId>
+          <scope>test</scope>
+      </dependency>
+  </dependencies>
+
+</project>

Added: aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/ContextHelper.java
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/ContextHelper.java?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/ContextHelper.java (added)
+++ aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/ContextHelper.java Sun Feb 27 18:01:00 2011
@@ -0,0 +1,252 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.aries.jndi;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.NoInitialContextException;
+import javax.naming.spi.InitialContextFactory;
+import javax.naming.spi.InitialContextFactoryBuilder;
+import javax.naming.spi.ObjectFactory;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * Provides helper methods for the DelegateContext. This provides the methods so
+ * there can be many DelegateContexts, but few service trackers.
+ */
+public final class ContextHelper
+{
+	/** The bundle context we use for accessing the SR */
+  private static BundleContext context;
+  
+  /** Ensure no one constructs us */
+  private ContextHelper() { throw new RuntimeException(); }
+  
+  public static void setBundleContext(BundleContext ctx)
+  {
+  	context = ctx;
+  }
+  
+  /**
+   * This class creates a Context from an InitialContextFactory that may be
+   * named in the provided env. If no name is set the first InitialContextFactory
+   * returned from the service registry is used.
+   * 
+   * @param env
+   * @return the context.
+   * @throws NamingException
+   */
+  public static Context createContext(Hashtable<?,?> env)
+    throws NamingException
+  {
+  	
+    InitialContextFactory icf = null;
+    ServiceReference ref = null;
+
+    String icfFactory = (String) env.get(Context.INITIAL_CONTEXT_FACTORY);
+    
+    boolean icfFactorySet = true;
+
+    if (icfFactory == null) {
+      icfFactory = InitialContextFactory.class.getName();
+      icfFactorySet = false;
+    }
+    
+    try {
+      ServiceReference[] refs = context.getAllServiceReferences(icfFactory, null);
+      if (refs != null) {
+        ref = refs[0];
+        icf = (InitialContextFactory) context.getService(ref);
+      }
+    } catch (InvalidSyntaxException e) {
+      // TODO nls enable this.
+      NamingException e4 = new NamingException("Argh this should never happen :)");
+      e4.initCause(e);
+      
+      throw e4;
+    }
+
+    if (icf == null) {
+      try {
+        ServiceReference[] refs = context.getAllServiceReferences(InitialContextFactoryBuilder.class.getName(), null);
+
+        if (refs != null) {
+          for (ServiceReference icfbRef : refs) {
+            InitialContextFactoryBuilder builder = (InitialContextFactoryBuilder) context.getService(icfbRef);
+
+            icf = builder.createInitialContextFactory(env);
+            
+            context.ungetService(icfbRef);
+            if (icf != null) {
+              break;
+            }
+          }
+        }
+      } catch (InvalidSyntaxException e) {
+        // TODO nls enable this.
+        NamingException e4 = new NamingException("Argh this should never happen :)");
+        e4.initCause(e);    
+        throw e4;
+      }
+    }
+
+    if (icf == null && icfFactorySet) {
+      try {
+        Class<?> clazz = Class.forName(icfFactory, true, null);
+        icf = (InitialContextFactory) clazz.newInstance();
+      } catch (ClassNotFoundException e11) {
+        // TODO nls enable this.
+        NamingException e = new NamingException("Argh this should never happen :)");
+        e.initCause(e11);    
+        throw e;
+      } catch (InstantiationException e2) {
+        // TODO nls enable this.
+        NamingException e4 = new NamingException("Argh this should never happen :)");
+        e4.initCause(e2);    
+        throw e4;
+      } catch (IllegalAccessException e1) {
+        // TODO nls enable this.
+        NamingException e4 = new NamingException("Argh this should never happen :)");
+        e4.initCause(e1);    
+        throw e4;
+      }
+    }
+
+    if (icf == null) {
+
+      // TODO nls enable this.
+      NamingException e3 = new NoInitialContextException("We could not find an InitialContextFactory to use");
+      
+      throw e3;
+    }
+
+    Context ctx = icf.getInitialContext(env);
+
+    if (ref != null) context.ungetService(ref);
+
+    if (ctx == null) {
+      // TODO nls enable this
+      NamingException e = new NamingException("The ICF returned a null context");
+      throw e;
+    }
+
+    return ctx;
+  }
+  
+  
+  private static Context createIcfContext(Hashtable<?,?> env) throws NamingException
+  {
+    String icfFactory = (String) env.get(Context.INITIAL_CONTEXT_FACTORY);
+    InitialContextFactory icf = null;
+
+    if (icfFactory != null) {
+      try {
+        Class<?> clazz = Class.forName(icfFactory, true, Thread.currentThread()
+            .getContextClassLoader());
+        icf = (InitialContextFactory) clazz.newInstance();
+
+      } catch (ClassNotFoundException e11) {
+        NamingException e4 = new NamingException("Argh this should never happen :)");
+        e4.initCause(e11);
+        throw e4;
+      } catch (InstantiationException e2) {
+        NamingException e4 = new NamingException("Argh this should never happen :)");
+        e4.initCause(e2);
+        throw e4;
+      } catch (IllegalAccessException e1) {
+        NamingException e4 = new NamingException("Argh this should never happen :)");
+        e4.initCause(e1);
+        throw e4;
+      }
+    }
+    Context ctx = null;
+
+    if (icf != null) {
+      ctx = icf.getInitialContext(env);
+    }    
+    
+    return ctx;
+  }
+  
+  /**
+   * This method is used to create a URL Context. It does this by looking for 
+   * the URL context's ObjectFactory in the service registry.
+   * 
+   * @param urlScheme
+   * @param env
+   * @return a Context
+   * @throws NamingException
+   */
+  public static Context createURLContext(String urlScheme, Hashtable<?, ?> env)
+      throws NamingException
+  {
+    ObjectFactory factory = null;
+    ServiceReference ref = null;
+
+    Context ctx = null;
+
+    try {
+      ServiceReference[] services = context.getServiceReferences(ObjectFactory.class.getName(),
+          "(|(osgi.jndi.urlScheme=" + urlScheme + ")(urlScheme=" + urlScheme + "))");
+
+      if (services != null) {
+        ref = services[0];
+        factory = (ObjectFactory) context.getService(ref);
+      }
+    } catch (InvalidSyntaxException e1) {
+      // TODO nls enable this.
+      NamingException e = new NamingException("Argh this should never happen :)");
+      e.initCause(e1);
+      throw e;
+    }
+
+    if (factory != null) {
+      try {
+        ctx = (Context) factory.getObjectInstance(null, null, null, env);
+      } catch (Exception e) {
+        NamingException e2 = new NamingException();
+        e2.initCause(e);
+        throw e2;
+      } finally {
+        if (ref != null) context.ungetService(ref);
+      }
+    }
+
+    // TODO: This works for WAS - we believe - but is incorrect behaviour. We should not use an icf to generate the URLContext.
+    // Rather, the missing URLContext factories should be exported on behalf of WAS.
+    if (ctx == null) {
+      ctx = createIcfContext(env);
+    }
+    
+    if (ctx == null && factory == null) {
+      NamingException e = new NamingException("We could not find an ObjectFactory to use");
+      throw e;
+    } else if (ctx == null && factory != null) {
+      NamingException e = new NamingException("The ICF returned a null context");
+      throw e;
+    }
+
+    return ctx;
+  }
+}
\ No newline at end of file

Added: aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/DelegateContext.java
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/DelegateContext.java?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/DelegateContext.java (added)
+++ aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/DelegateContext.java Sun Feb 27 18:01:00 2011
@@ -0,0 +1,396 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.aries.jndi;
+
+import java.util.Hashtable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NameClassPair;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchControls;
+
+public class DelegateContext implements DirContext
+{
+  private Hashtable<Object, Object> env = new Hashtable<Object, Object>();
+  private Context defaultContext;
+  private static ConcurrentMap<String, Context> urlContexts = new ConcurrentHashMap<String, Context>();
+
+  public DelegateContext(Hashtable<?, ?> theEnv)
+  {
+    env.putAll(theEnv);
+  }
+  
+  public DelegateContext(Context ctx) throws NamingException
+	{
+
+  		defaultContext = ctx;
+			env.putAll(ctx.getEnvironment());
+
+	}
+
+	public Object addToEnvironment(String propName, Object propVal) throws NamingException
+  {
+    Context ctx = getDefaultContext();
+    
+    if (ctx != null) ctx.addToEnvironment(propName, propVal);
+    
+    return env.put(propName, propVal);
+  }
+
+  public void bind(Name name, Object obj) throws NamingException
+  {
+    findContext(name).bind(name, obj);
+  }
+
+  public void bind(String name, Object obj) throws NamingException
+  {
+    findContext(name).bind(name, obj);
+  }
+
+  public void close() throws NamingException
+  {
+    if (defaultContext != null) defaultContext.close();
+    env.clear();
+  }
+
+  public Name composeName(Name name, Name prefix) throws NamingException
+  {
+    return findContext(name).composeName(name, prefix);
+  }
+
+  public String composeName(String name, String prefix) throws NamingException
+  {
+    return findContext(name).composeName(name, prefix);
+  }
+
+  public Context createSubcontext(Name name) throws NamingException
+  {
+    return findContext(name).createSubcontext(name);
+  }
+
+  public Context createSubcontext(String name) throws NamingException
+  {
+    return findContext(name).createSubcontext(name);
+  }
+
+  public void destroySubcontext(Name name) throws NamingException
+  {
+    findContext(name).destroySubcontext(name);
+  }
+
+  public void destroySubcontext(String name) throws NamingException
+  {
+    findContext(name).destroySubcontext(name);
+  }
+
+  public Hashtable<?, ?> getEnvironment() throws NamingException
+  {
+    Hashtable<Object, Object> theEnv = new Hashtable<Object, Object>();
+    theEnv.putAll(env);
+    return theEnv;
+  }
+
+  public String getNameInNamespace() throws NamingException
+  {
+    return getDefaultContext().getNameInNamespace();
+  }
+
+  public NameParser getNameParser(Name name) throws NamingException
+  {
+    return findContext(name).getNameParser(name);
+  }
+
+  public NameParser getNameParser(String name) throws NamingException
+  {
+    return findContext(name).getNameParser(name);
+  }
+
+  public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
+  {
+    return findContext(name).list(name);
+  }
+
+  public NamingEnumeration<NameClassPair> list(String name) throws NamingException
+  {
+    return findContext(name).list(name);
+  }
+
+  public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
+  {
+    return findContext(name).listBindings(name);
+  }
+
+  public NamingEnumeration<Binding> listBindings(String name) throws NamingException
+  {
+    return findContext(name).listBindings(name);
+  }
+
+  public Object lookup(Name name) throws NamingException
+  {
+    return findContext(name).lookup(name);
+  }
+
+  public Object lookup(String name) throws NamingException
+  {
+    return findContext(name).lookup(name);
+  }
+
+  public Object lookupLink(Name name) throws NamingException
+  {
+    return findContext(name).lookupLink(name);
+  }
+
+  public Object lookupLink(String name) throws NamingException
+  {
+    return findContext(name).lookupLink(name);
+  }
+
+  public void rebind(Name name, Object obj) throws NamingException
+  {
+    findContext(name).rebind(name, obj);
+  }
+
+  public void rebind(String name, Object obj) throws NamingException
+  {
+    findContext(name).rebind(name, obj);
+  }
+
+  public Object removeFromEnvironment(String propName) throws NamingException
+  {
+    Context ctx = getDefaultContext();
+    
+    if (ctx != null) ctx.removeFromEnvironment(propName);
+    
+    return env.remove(propName);
+  }
+
+  public void rename(Name oldName, Name newName) throws NamingException
+  {
+    findContext(oldName).rename(oldName, newName);
+  }
+
+  public void rename(String oldName, String newName) throws NamingException
+  {
+    findContext(oldName).rename(oldName, newName);
+  }
+
+  public void unbind(Name name) throws NamingException
+  {
+    findContext(name).unbind(name);
+  }
+
+  public void unbind(String name) throws NamingException
+  {
+    findContext(name).unbind(name);
+  }
+
+  protected Context findContext(Name name) throws NamingException
+  {
+    return findContext(name.toString());
+  }
+
+  
+  protected Context findContext(String name) throws NamingException
+  {
+  	Context toReturn = null;
+  	
+  	if (name.contains(":")) {
+      toReturn = getURLContext(name);
+    } else {
+      toReturn =  getDefaultContext();
+    }
+    
+  	if (toReturn != null)
+  	{
+  		String packages = System.getProperty(Context.URL_PKG_PREFIXES, null);
+  		
+  		if (packages != null)
+  		{
+  			toReturn.addToEnvironment(Context.URL_PKG_PREFIXES, packages);	
+  		}
+  	}
+  	
+    return toReturn;
+  }
+
+  private Context getDefaultContext() throws NamingException
+  {
+    if (defaultContext == null) {
+      defaultContext = ContextHelper.createContext(env);
+    }
+    return defaultContext;
+  }
+
+  private Context getURLContext(String name) throws NamingException
+  {
+    Context ctx = null;
+    
+    int index = name.indexOf(':');
+    
+    if (index != -1) {
+      String scheme = name.substring(0, index);
+      
+      ctx = ContextHelper.createURLContext(scheme, env);
+    }
+    
+    if (ctx == null) {
+      ctx = getDefaultContext();
+    }
+    
+    return ctx;
+  }
+  
+  /**
+   * This method allows the caller to set the default context if one is to hand.
+   * Normally the context would be lazily constructed upon first use, but this
+   * if one already exists when this is created it can be pushed in.
+   * 
+   * @param ctx the context to use.
+   */
+  public void setDefaultContext(Context ctx)
+  {
+    defaultContext = ctx;
+  }
+  
+  /**
+   * This method allows URL contexts to be pushed in. We should probably be 
+   * pushing in references to the ObjectFactory for the url Object Factory, but
+   * for now lets just push the context itself in.
+   * 
+   * @param url
+   * @param ctx
+   */
+  public void setURLContext(String url, Context ctx)
+  {
+    urlContexts.put(url, ctx);
+  }
+  
+  public Attributes getAttributes(Name name) throws NamingException {
+      return ((DirContext)findContext(name)).getAttributes(name);
+  }
+  
+  public Attributes getAttributes(String name) throws NamingException {
+      return ((DirContext)findContext(name)).getAttributes(name);
+  }
+  
+  public Attributes getAttributes(Name name, String[] attrIds) throws NamingException {
+      return ((DirContext)findContext(name)).getAttributes(name, attrIds);
+  }
+  
+  public Attributes getAttributes(String name, String[] attrIds) throws NamingException {
+      return ((DirContext)findContext(name)).getAttributes(name, attrIds);
+  }
+  
+  public void modifyAttributes(Name name, int mod_op, Attributes attrs) throws NamingException {
+      ((DirContext)findContext(name)).modifyAttributes(name, mod_op, attrs);
+  }
+  
+  public void modifyAttributes(String name, int mod_op, Attributes attrs) throws NamingException {
+      ((DirContext)findContext(name)).modifyAttributes(name, mod_op, attrs);
+  }
+  
+  public void modifyAttributes(Name name, ModificationItem[] mods) throws NamingException {
+      ((DirContext)findContext(name)).modifyAttributes(name, mods);
+  }
+  
+  public void modifyAttributes(String name, ModificationItem[] mods) throws NamingException {
+      ((DirContext)findContext(name)).modifyAttributes(name, mods);
+  }
+  
+  public void bind(Name name, Object obj, Attributes attrs) throws NamingException {
+      ((DirContext)findContext(name)).bind(name, obj, attrs);
+  }
+  
+  public void bind(String name, Object obj, Attributes attrs) throws NamingException {
+      ((DirContext)findContext(name)).bind(name, obj, attrs);
+  }
+
+  public void rebind(Name name, Object obj, Attributes attrs) throws NamingException {
+      ((DirContext)findContext(name)).rebind(name, obj, attrs);
+  }
+
+  public void rebind(String name, Object obj, Attributes attrs) throws NamingException {
+      ((DirContext)findContext(name)).rebind(name, obj, attrs);
+  }
+
+  public DirContext createSubcontext(Name name, Attributes attrs) throws NamingException {
+      return ((DirContext)findContext(name)).createSubcontext(name, attrs);
+  }
+
+  public DirContext createSubcontext(String name, Attributes attrs) throws NamingException {
+      return ((DirContext)findContext(name)).createSubcontext(name, attrs);
+  }
+
+  public DirContext getSchema(Name name) throws NamingException {
+      return ((DirContext)findContext(name)).getSchema(name);
+  }
+
+  public DirContext getSchema(String name) throws NamingException {
+      return ((DirContext)findContext(name)).getSchema(name);
+  }
+
+  public DirContext getSchemaClassDefinition(Name name) throws NamingException {
+      return ((DirContext)findContext(name)).getSchemaClassDefinition(name);
+  }
+
+  public DirContext getSchemaClassDefinition(String name) throws NamingException {
+      return ((DirContext)findContext(name)).getSchemaClassDefinition(name);
+  }
+
+  public NamingEnumeration search(Name name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException {
+      return ((DirContext)findContext(name)).search(name, matchingAttributes, attributesToReturn);
+  }
+
+  public NamingEnumeration search(String name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException {
+      return ((DirContext)findContext(name)).search(name, matchingAttributes, attributesToReturn);
+  }
+
+  public NamingEnumeration search(Name name, Attributes matchingAttributes) throws NamingException {
+      return ((DirContext)findContext(name)).search(name, matchingAttributes);
+  }
+
+  public NamingEnumeration search(String name, Attributes matchingAttributes) throws NamingException {
+      return ((DirContext)findContext(name)).search(name, matchingAttributes);
+  }
+
+  public NamingEnumeration search(Name name, String filter, SearchControls cons) throws NamingException {
+      return ((DirContext)findContext(name)).search(name, filter, cons);
+  }
+
+  public NamingEnumeration search(String name, String filter, SearchControls cons) throws NamingException {
+      return ((DirContext)findContext(name)).search(name, filter, cons);
+  }
+
+  public NamingEnumeration search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException {
+      return ((DirContext)findContext(name)).search(name, filterExpr, filterArgs, cons);
+  }
+
+  public NamingEnumeration search(String name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException {
+      return ((DirContext)findContext(name)).search(name, filterExpr, filterArgs, cons);
+  }
+}
\ No newline at end of file

Added: aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/DelegateContextFactory.java
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/DelegateContextFactory.java?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/DelegateContextFactory.java (added)
+++ aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/DelegateContextFactory.java Sun Feb 27 18:01:00 2011
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.aries.jndi;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+public interface DelegateContextFactory {
+  public Context getInitialContext(Hashtable<?, ?> envmt) throws NamingException;
+}

Added: aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/OSGiInitialContextFactoryBuilder.java
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/OSGiInitialContextFactoryBuilder.java?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/OSGiInitialContextFactoryBuilder.java (added)
+++ aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/OSGiInitialContextFactoryBuilder.java Sun Feb 27 18:01:00 2011
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.aries.jndi;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.spi.InitialContextFactory;
+import javax.naming.spi.InitialContextFactoryBuilder;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+
+public class OSGiInitialContextFactoryBuilder implements InitialContextFactoryBuilder,
+  InitialContextFactory
+{
+	private BundleContext _context;
+	
+	public OSGiInitialContextFactoryBuilder(BundleContext context)
+	{
+		_context = context;
+	}
+	
+  public InitialContextFactory createInitialContextFactory(Hashtable<?, ?> environment)
+      throws NamingException
+  {
+    return this;
+  }
+  public Context getInitialContext(Hashtable<?, ?> environment) throws NamingException
+  {
+  	Context toReturn = null;
+  	
+  	ServiceReference ref = _context.getServiceReference(DelegateContextFactory.class.getName());
+  	
+  	//TODO: is the custom interface DelegateContextFactory the right way to go about things
+  	//  or is there a more generic way in RFC 142
+  	if (ref != null) {
+  	  try {
+    		DelegateContextFactory dcf = (DelegateContextFactory) _context.getService(ref);
+    		
+    		if (dcf != null) {
+    			toReturn = dcf.getInitialContext(environment);
+    		}
+  	  }
+  	  finally {
+  	    _context.ungetService(ref);
+  	  }
+  	}
+  	
+  	if (toReturn == null) {
+  		toReturn  = new DelegateContext(environment);
+  	}
+  	
+    return toReturn;
+  }
+}

Added: aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/OSGiObjectFactoryBuilder.java
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/OSGiObjectFactoryBuilder.java?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/OSGiObjectFactoryBuilder.java (added)
+++ aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/OSGiObjectFactoryBuilder.java Sun Feb 27 18:01:00 2011
@@ -0,0 +1,246 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.aries.jndi;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+import javax.naming.Referenceable;
+import javax.naming.StringRefAddr;
+import javax.naming.directory.Attributes;
+import javax.naming.spi.DirObjectFactory;
+import javax.naming.spi.ObjectFactory;
+import javax.naming.spi.ObjectFactoryBuilder;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+public class OSGiObjectFactoryBuilder implements ObjectFactoryBuilder, ObjectFactory, DirObjectFactory
+{
+  /** The bundle context we use for accessing the SR */
+  private static BundleContext context;
+  
+  public static void setBundleContext(BundleContext ctx)
+  {
+    context = ctx;
+  }
+
+  public ObjectFactory createObjectFactory(Object obj, Hashtable<?, ?> environment)
+      throws NamingException
+  {
+    return this;
+  }
+
+  public Object getObjectInstance(Object obj, Name name, Context nameCtx,
+      Hashtable<?, ?> environment) throws Exception
+  {
+  	
+    Reference ref = null;
+
+    if (obj instanceof Reference) {
+      ref = (Reference) obj;
+    } else if (obj instanceof Referenceable) {
+      ref = ((Referenceable)obj).getReference();
+    }
+
+    Object result = ref;
+
+    if (ref != null) {
+      String className = ref.getFactoryClassName();
+
+      if (className != null) {
+        result = getObjectInstanceUsingClassName(obj, className, obj, name, nameCtx, environment);
+      } else {
+        result = getObjectInstanceUsingRefAddress(ref.getAll(), obj, name, nameCtx, environment);
+
+        if (result == null || result == obj) {
+          result = getObjectInstanceUsingAllObjectFactories(obj, name, nameCtx, environment);
+        }
+      }
+    }
+
+    if (result == null) result = ref;
+    
+    return result;
+  }
+
+  private Object getObjectInstanceUsingAllObjectFactories(Object obj, Name name, Context nameCtx,
+      Hashtable<?, ?> environment)
+  {
+    Object result = obj;
+    try {
+      ServiceReference[] refs = context.getAllServiceReferences(ObjectFactory.class.getName(), null);
+
+      if (refs != null) {
+        for (ServiceReference ref : refs) {
+          ObjectFactory factory = (ObjectFactory) context.getService(ref);
+  
+          if (factory != null) {
+            try {
+              result = factory.getObjectInstance(obj, name, nameCtx, environment);
+            } catch (Exception e) {
+              // TODO Auto-generated catch block
+              e.printStackTrace();
+            }
+  
+            context.ungetService(ref);
+  
+            // if the result comes back and is not null and not the reference
+            // object then we should return the result, so break out of the
+            // loop we are in.
+            if (result != null && result != obj) break;
+          }
+        }
+      }
+    } catch (InvalidSyntaxException e) {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
+    }
+
+    if (result == null) result = obj;
+  	
+    return result;
+  }
+
+  private Object getObjectInstanceUsingRefAddress(Enumeration<RefAddr> addresses, Object obj, Name name,
+      Context nameCtx, Hashtable<?, ?> environment)
+  {
+    Object result = obj;
+
+    while (addresses.hasMoreElements()) {
+      RefAddr address = addresses.nextElement();
+      if (address instanceof StringRefAddr && "URL".equals(address.getType())) {
+        String urlScheme = (String)address.getContent();
+        ObjectFactory factory = null;
+        ServiceReference ref = null;
+        try {
+          ServiceReference[] services = context.getServiceReferences(ObjectFactory.class.getName(), "(|(osgi.jndi.urlScheme=" + urlScheme + ")(urlScheme=" + urlScheme + "))");
+
+          if (services != null) {
+            ref = services[0];
+            factory = (ObjectFactory) context.getService(ref);
+          }
+        } catch (InvalidSyntaxException e) {
+          e.printStackTrace();
+        }
+
+        if (factory != null) {
+          try {
+            result = factory.getObjectInstance(obj, name, nameCtx, environment);
+          } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+          }
+        }
+
+        if (ref != null) context.ungetService(ref);
+        
+        // if the result is not null and references a different object from
+        // the obj then we have resolved the object, so we stop searching.
+        if (result != null && result != obj) break;
+      }
+    }
+
+    return result;
+  }
+
+  private Object getObjectInstanceUsingClassName(Object reference, String className, Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment)
+  {
+    Object result = obj;
+
+    ObjectFactory factory = null;
+    ServiceReference ref = null;
+
+    if (className != null) {
+      try {
+        ServiceReference[] refs = context.getAllServiceReferences(className, null);
+
+        if (refs != null) {
+          for (ServiceReference ref1 : refs) {
+            factory = (ObjectFactory) context.getService(ref1);
+
+            if (factory != null) {
+              ref = ref1;
+              break;
+            }
+          }
+        }
+      } catch (InvalidSyntaxException e) {
+        // TODO Auto-generated catch block
+        e.printStackTrace();
+      }
+    }
+
+    if (factory == null) {
+      try {
+        ServiceReference[] refs = context.getServiceReferences(ObjectFactoryBuilder.class.getName(), null);
+
+        if (refs != null) {
+          for (ServiceReference ofRef : refs) {
+            ObjectFactoryBuilder builder = (ObjectFactoryBuilder) context.getService(ofRef);
+            try {
+              factory = builder.createObjectFactory(reference, environment);
+            } catch (NamingException e) {
+              // TODO Auto-generated catch block
+              e.printStackTrace();
+            }
+
+            context.ungetService(ofRef);
+            if (factory != null) {
+              break;
+            }
+          }
+        }
+      } catch (InvalidSyntaxException e) {
+        // TODO Auto-generated catch block
+        e.printStackTrace();
+      }
+    }
+
+    if (factory != null) {
+      try {
+        result = factory.getObjectInstance(obj, name, nameCtx, environment);
+      } catch (Exception e) {
+        // TODO Auto-generated catch block
+        e.printStackTrace();
+      } finally {
+        if (ref != null) context.ungetService(ref);
+      }
+    }
+
+    return result;
+  }
+  
+  /**
+   * when we get called by DirectoryManager#getObjectInstance if we can't find the object 
+   * instance, we just need to return the passed in refInfo  
+   */
+  public Object getObjectInstance(Object refInfo, Name name, Context nameCtx, 
+                                  Hashtable<?, ?> environment, Attributes attrs) throws Exception {
+      Object result = getObjectInstance(refInfo, name, nameCtx, environment);
+      return result == null ? refInfo : result;
+  }
+
+}
\ No newline at end of file

Added: aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/startup/Activator.java
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/startup/Activator.java?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/startup/Activator.java (added)
+++ aries/tags/jndi-0.1-incubating/jndi-core/src/main/java/org/apache/aries/jndi/startup/Activator.java Sun Feb 27 18:01:00 2011
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.aries.jndi.startup;
+
+import javax.naming.NamingException;
+import javax.naming.spi.NamingManager;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import org.apache.aries.jndi.ContextHelper;
+import org.apache.aries.jndi.OSGiInitialContextFactoryBuilder;
+import org.apache.aries.jndi.OSGiObjectFactoryBuilder;
+
+/**
+ * The activator for this bundle makes sure the static classes in it are
+ * driven so they can do their magic stuff properly.
+ */
+public class Activator implements BundleActivator
+{
+  public void start(BundleContext context)
+  {
+    ContextHelper.setBundleContext(context);
+    OSGiObjectFactoryBuilder.setBundleContext(context);
+  
+    try {
+      if (!!!NamingManager.hasInitialContextFactoryBuilder()) {
+        NamingManager.setInitialContextFactoryBuilder(new OSGiInitialContextFactoryBuilder(context));
+      }
+    } catch (NamingException e) {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
+    }
+    
+    try {
+      NamingManager.setObjectFactoryBuilder(new OSGiObjectFactoryBuilder());
+    } catch (NamingException e) {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
+    } catch (IllegalStateException e) {
+      e.printStackTrace();
+    }
+  }
+
+  public void stop(BundleContext context) {}
+}
\ No newline at end of file

Added: aries/tags/jndi-0.1-incubating/jndi-core/src/test/java/org/apache/aries/jndi/ObjectFactoryTest.java
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/jndi-core/src/test/java/org/apache/aries/jndi/ObjectFactoryTest.java?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/jndi-core/src/test/java/org/apache/aries/jndi/ObjectFactoryTest.java (added)
+++ aries/tags/jndi-0.1-incubating/jndi-core/src/test/java/org/apache/aries/jndi/ObjectFactoryTest.java Sun Feb 27 18:01:00 2011
@@ -0,0 +1,170 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.aries.jndi;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+
+import java.lang.reflect.Field;
+import java.util.Hashtable;
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.Reference;
+import javax.naming.StringRefAddr;
+import javax.naming.spi.NamingManager;
+import javax.naming.spi.ObjectFactory;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+
+import org.apache.aries.unittest.mocks.MethodCall;
+import org.apache.aries.unittest.mocks.Skeleton;
+import org.apache.aries.jndi.ContextHelper;
+import org.apache.aries.jndi.OSGiObjectFactoryBuilder;
+import org.apache.aries.jndi.startup.Activator;
+import org.apache.aries.mocks.BundleContextMock;
+
+public class ObjectFactoryTest
+{
+  private BundleContext bc;
+
+  /**
+   * This method does the setup .
+   * @throws NoSuchFieldException 
+   * @throws SecurityException 
+   * @throws IllegalAccessException 
+   * @throws IllegalArgumentException 
+   */
+  @Before
+  public void setup() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException
+  {
+    bc =  Skeleton.newMock(new BundleContextMock(), BundleContext.class);
+    new Activator().start(bc);
+    
+    Field f = ContextHelper.class.getDeclaredField("context");
+    f.setAccessible(true);
+    f.set(null, bc);
+    f = OSGiObjectFactoryBuilder.class.getDeclaredField("context");
+    f.setAccessible(true);
+    f.set(null, bc);
+
+  }
+
+  /**
+   * Make sure we clear the caches out before the next test.
+   */
+  @After
+  public void teardown()
+  {
+    new Activator().stop(bc);
+    BundleContextMock.clear();
+  }
+
+  @Test
+  public void testURLReferenceWithNoMatchingHandler() throws Exception
+  {
+    Reference ref = new Reference(null);
+    ref.add(new StringRefAddr("URL", "wibble"));
+    Object obj = NamingManager.getObjectInstance(ref, null, null, null);
+
+    assertSame("The naming manager should have returned the reference object", ref, obj);
+  }
+
+  @Test
+  public void testURLReferenceWithMatchingHandler() throws Exception
+  {
+    String testObject = "Test object";
+    ObjectFactory factory = Skeleton.newMock(ObjectFactory.class);
+    Skeleton.getSkeleton(factory).setReturnValue(new MethodCall(ObjectFactory.class, "getObjectInstance", Object.class, Name.class, Context.class, Hashtable.class), testObject);
+
+    Properties props = new Properties();
+    props.setProperty("osgi.jndi.urlScheme", "wibble");
+
+    bc.registerService(ObjectFactory.class.getName(), factory, props);
+
+    Reference ref = new Reference(null);
+    ref.add(new StringRefAddr("URL", "wibble"));
+    Object obj = NamingManager.getObjectInstance(ref, null, null, null);
+    
+    assertEquals("The naming manager should have returned the test object", testObject, obj);
+  }
+
+  @Test
+  public void testReferenceWithNoClassName() throws Exception
+  {
+    String testObject = "Test object";
+    ObjectFactory factory = Skeleton.newMock(ObjectFactory.class);
+    Skeleton.getSkeleton(factory).setReturnValue(new MethodCall(ObjectFactory.class, "getObjectInstance", Object.class, Name.class, Context.class, Hashtable.class), testObject);
+
+    bc.registerService(ObjectFactory.class.getName(), factory, null);
+
+    Reference ref = new Reference(null);
+    Object obj = NamingManager.getObjectInstance(ref, null, null, null);
+    
+    assertEquals("The naming manager should have returned the test object", testObject, obj);
+  }
+
+  @Test
+  public void testSpecifiedFactoryWithMatchingFactory() throws Exception
+  {
+    String testObject = "Test object";
+    ObjectFactory factory = Skeleton.newMock(ObjectFactory.class);
+    Skeleton.getSkeleton(factory).setReturnValue(new MethodCall(ObjectFactory.class, "getObjectInstance", Object.class, Name.class, Context.class, Hashtable.class), testObject);
+
+    Reference ref = new Reference("dummy.class.name", factory.getClass().getName(), "");
+
+    bc.registerService(new String[] {ObjectFactory.class.getName(), factory.getClass().getName()}, 
+                       factory, null);
+
+    Object obj = NamingManager.getObjectInstance(ref, null, null, null);
+    
+    assertEquals("The naming manager should have returned the test object", testObject, obj);
+  }
+
+  @Test
+  public void testSpecifiedFactoryWithRegisteredButNotMatchingFactory() throws Exception
+  {
+    String testObject = "Test object";
+    ObjectFactory factory = Skeleton.newMock(ObjectFactory.class);
+    Skeleton.getSkeleton(factory).setReturnValue(new MethodCall(ObjectFactory.class, "getObjectInstance", Object.class, Name.class, Context.class, Hashtable.class), testObject);
+
+    Reference ref = new Reference("dummy.class.name", "dummy.factory.class.name", "");
+
+    bc.registerService(new String[] {ObjectFactory.class.getName(), factory.getClass().getName()}, 
+                       factory, null);
+
+    Object obj = NamingManager.getObjectInstance(ref, null, null, null);
+
+    assertSame("The naming manager should have returned the reference object", ref, obj);
+  }
+
+  @Test
+  public void testSpecifiedFactoryWithNoMatchingFactory() throws Exception
+  {
+    Reference ref = new Reference("dummy.class.name");
+
+    Object obj = NamingManager.getObjectInstance(ref, null, null, null);
+
+    assertSame("The naming manager should have returned the reference object", ref, obj);
+  }
+}
\ No newline at end of file

Added: aries/tags/jndi-0.1-incubating/jndi-url/pom.xml
URL: http://svn.apache.org/viewvc/aries/tags/jndi-0.1-incubating/jndi-url/pom.xml?rev=1075097&view=auto
==============================================================================
--- aries/tags/jndi-0.1-incubating/jndi-url/pom.xml (added)
+++ aries/tags/jndi-0.1-incubating/jndi-url/pom.xml Sun Feb 27 18:01:00 2011
@@ -0,0 +1,68 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+<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>
+  <parent>
+    <groupId>org.apache.aries.jndi</groupId>
+    <artifactId>jndi</artifactId>
+    <version>0.1-incubating</version>
+  </parent>
+
+  <artifactId>org.apache.aries.jndi.url</artifactId>
+  <packaging>bundle</packaging>
+  <name>Apache Aries JNDI URL Handler</name>
+  <description>
+      This bundle contains the JNDI URL handler for OSGi
+  </description>
+
+  <properties>
+    <aries.osgi.export.pkg>
+        org.apache.aries.jndi.services
+    </aries.osgi.export.pkg>
+    <aries.osgi.private.pkg>
+        org.apache.aries.jndi.url
+    </aries.osgi.private.pkg>
+    <aries.osgi.activator>
+        org.apache.aries.jndi.url.Activator
+    </aries.osgi.activator>
+  </properties>
+
+  <dependencies>
+      <dependency>
+      	<groupId>org.apache.aries</groupId>
+      	<artifactId>org.apache.aries.util</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.osgi</groupId>
+          <artifactId>org.osgi.core</artifactId>
+          <scope>provided</scope>
+      </dependency>
+      <dependency>
+          <groupId>org.apache.aries.jndi</groupId>
+          <artifactId>org.apache.aries.jndi.core</artifactId>
+          <scope>test</scope>
+      </dependency>
+      <dependency>
+          <groupId>org.apache.aries.testsupport</groupId>
+          <artifactId>org.apache.aries.testsupport.unit</artifactId>
+          <scope>test</scope>
+      </dependency>
+  </dependencies>
+
+</project>



Mime
View raw message