[jboss-osgi-commits] JBoss-OSGI SVN: r89380 - in projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi: internal and 1 other directory.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Mon May 25 11:50:19 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-05-25 11:50:18 -0400 (Mon, 25 May 2009)
New Revision: 89380

Added:
   projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java
Removed:
   projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/NamingService.java
   projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java
Log:
Register InitialContext directly

Deleted: projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/NamingService.java
===================================================================
--- projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/NamingService.java	2009-05-25 14:16:05 UTC (rev 89379)
+++ projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/NamingService.java	2009-05-25 15:50:18 UTC (rev 89380)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.jndi;
-
-//$Id$
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- * A service that gives access to JNDI
- * 
- * @author thomas.diesler at jboss.com
- * @since 05-May-2009
- */
-public interface NamingService
-{
-   /**
-    * Get the InitialContext
-     * @throws NamingException if a naming exception is encountered
-    */
-   InitialContext getInitialContext() throws NamingException;
-}
\ No newline at end of file

Deleted: projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java	2009-05-25 14:16:05 UTC (rev 89379)
+++ projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java	2009-05-25 15:50:18 UTC (rev 89380)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.jndi.internal;
-
-//$Id$
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.osgi.jndi.NamingService;
-import org.osgi.framework.BundleContext;
-
-/**
- * A service that gives access to JNDI
- * 
- * @author thomas.diesler at jboss.com
- * @since 05-May-2009
- */
-public class NamingServiceImpl implements NamingService
-{
-   private BundleContext context;
-   
-   public void setSystemContext(BundleContext context)
-   {
-      this.context = context;
-   }
-
-   /**
-    * Get the InitialContext
-    * 
-    * @throws NamingException if a naming exception is encountered
-    */
-   public InitialContext getInitialContext() throws NamingException
-   {
-      return new InitialContext();
-   }
-   
-   public void start()
-   {
-      context.registerService(NamingService.class.getName(), this, null);
-   }
-}
\ No newline at end of file

Copied: projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java (from rev 89379, projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java)
===================================================================
--- projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java	                        (rev 0)
+++ projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java	2009-05-25 15:50:18 UTC (rev 89380)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.jndi.internal;
+
+//$Id$
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * A service that gives access to JNDI
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public class NamingServiceImpl 
+{
+   private BundleContext context;
+   
+   public void setSystemContext(BundleContext context)
+   {
+      this.context = context;
+   }
+
+   public void start()
+   {
+      try
+      {
+         InitialContext initialContext = new InitialContext();
+         context.registerService(InitialContext.class.getName(), initialContext, null);
+      }
+      catch (NamingException ex)
+      {
+         throw new IllegalStateException("Cannot register InitialContext", ex);
+      }
+   }
+}
\ No newline at end of file




More information about the jboss-osgi-commits mailing list