geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r966098 - /geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
Date Wed, 21 Jul 2010 05:56:49 GMT
Author: gawor
Date: Wed Jul 21 05:56:48 2010
New Revision: 966098

URL: http://svn.apache.org/viewvc?rev=966098&view=rev
Log:
when exposing gbean as a service always set abstract name property and set default osgi jndi
service name property if none was specified

Modified:
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=966098&r1=966097&r2=966098&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
Wed Jul 21 05:56:48 2010
@@ -74,6 +74,9 @@ import org.osgi.framework.BundleContext;
 public final class GBeanInstance implements StateManageable {
     private static final Logger log = LoggerFactory.getLogger(GBeanInstance.class);
 
+    private static final String ABSTRACT_NAME_PROPERTY = "org.apache.geronimo.abstractName";
+    private static final String OSGI_JNDI_NAME_PROPERTY = "osgi.jndi.service.name";
+    
     private static final int DESTROYED = 0;
     private static final int CREATING = 1;
     private static final int RUNNING = 2;
@@ -1001,7 +1004,10 @@ public final class GBeanInstance impleme
                         serviceProperties = this.serviceProperties;
                     } else {
                         serviceProperties = new Hashtable();
-                        serviceProperties.put("org.apache.geronimo.abstractName", abstractName);
+                    }
+                    serviceProperties.put(ABSTRACT_NAME_PROPERTY, abstractName.toString());
+                    if (serviceProperties.get(OSGI_JNDI_NAME_PROPERTY) == null) {
+                        serviceProperties.put(OSGI_JNDI_NAME_PROPERTY, kernel.getNaming().toOsgiJndiName(abstractName));
                     }
                     serviceRegistration = bundleContext.registerService(serviceInterfaces,
instance, serviceProperties);
                     log.debug("Registered gbean " + abstractName + " as osgi service under
interfaces " + Arrays.asList(serviceInterfaces) + " with properties " + serviceProperties);



Mime
View raw message