Re: svn commit: r451419 - in /geronimo/sandbox/plugins/global-jndi: ./ src/java/org/apache/geronimo/gjndi/ src/java/org/apache/geronimo/gjndi/binding/ src/test/org/apache/geronimo/gjndi/binding/

2006-09-29 Thread Jason Dillon

Cool!  Thx,

--jason


On Sep 29, 2006, at 5:19 PM, Dain Sundstrom wrote:

see revision 451423  (http://svn.apache.org/viewvc? 
view=rev&revision=451423)


-dain

On Sep 29, 2006, at 1:40 PM, Jason Dillon wrote:


Can we plz use the new m2 layout?

--jason






Re: svn commit: r451419 - in /geronimo/sandbox/plugins/global-jndi: ./ src/java/org/apache/geronimo/gjndi/ src/java/org/apache/geronimo/gjndi/binding/ src/test/org/apache/geronimo/gjndi/binding/

2006-09-29 Thread Dain Sundstrom
see revision 451423  (http://svn.apache.org/viewvc? 
view=rev&revision=451423)


-dain

On Sep 29, 2006, at 1:40 PM, Jason Dillon wrote:


Can we plz use the new m2 layout?

--jason




Re: svn commit: r451419 - in /geronimo/sandbox/plugins/global-jndi: ./ src/java/org/apache/geronimo/gjndi/ src/java/org/apache/geronimo/gjndi/binding/ src/test/org/apache/geronimo/gjndi/binding/

2006-09-29 Thread Jason Dillon

Can we plz use the new m2 layout?

--jason


On Sep 29, 2006, at 1:14 PM, [EMAIL PROTECTED] wrote:


Author: dain
Date: Fri Sep 29 13:13:59 2006
New Revision: 451419

URL: http://svn.apache.org/viewvc?view=rev&rev=451419
Log:
Added ResourceBindings and EjbBindings.
Added support for duplicate bindings to the same name - basically  
we create a wating queue and when the current binding unregisters  
the next in the queue gets registered.

Fixed several bugs in cleanup code.

Added:
geronimo/sandbox/plugins/global-jndi/src/java/org/apache/ 
geronimo/gjndi/binding/
geronimo/sandbox/plugins/global-jndi/src/java/org/apache/ 
geronimo/gjndi/binding/EjbBindings.java
geronimo/sandbox/plugins/global-jndi/src/java/org/apache/ 
geronimo/gjndi/binding/ResourceBindings.java
geronimo/sandbox/plugins/global-jndi/src/test/org/apache/ 
geronimo/gjndi/binding/
geronimo/sandbox/plugins/global-jndi/src/test/org/apache/ 
geronimo/gjndi/binding/ResourceBindingsTest.java

Modified:
geronimo/sandbox/plugins/global-jndi/pom.xml
geronimo/sandbox/plugins/global-jndi/src/java/org/apache/ 
geronimo/gjndi/KernelContextGBean.java


Modified: geronimo/sandbox/plugins/global-jndi/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/plugins/global- 
jndi/pom.xml?view=diff&rev=451419&r1=451418&r2=451419
== 


--- geronimo/sandbox/plugins/global-jndi/pom.xml (original)
+++ geronimo/sandbox/plugins/global-jndi/pom.xml Fri Sep 29  
13:13:59 2006

@@ -36,7 +36,7 @@
 
 org.apache.xbean
 xbean-naming
-COL-SNAPSHOT
+2.7-SNAPSHOT
 
 
 org.apache.geronimo.modules
@@ -47,6 +47,17 @@
 backport-util-concurrent
 backport-util-concurrent
 
+
+org.apache.geronimo.modules
+geronimo-connector
+${pom.version}
+true
+
+
+
+
+
+
 
 
 

Modified: geronimo/sandbox/plugins/global-jndi/src/java/org/apache/ 
geronimo/gjndi/KernelContextGBean.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/plugins/global- 
jndi/src/java/org/apache/geronimo/gjndi/KernelContextGBean.java? 
view=diff&rev=451419&r1=451418&r2=451419
== 

--- geronimo/sandbox/plugins/global-jndi/src/java/org/apache/ 
geronimo/gjndi/KernelContextGBean.java (original)
+++ geronimo/sandbox/plugins/global-jndi/src/java/org/apache/ 
geronimo/gjndi/KernelContextGBean.java Fri Sep 29 13:13:59 2006

@@ -34,7 +34,9 @@
 import javax.naming.NamingException;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;

@@ -81,12 +83,10 @@

 private synchronized void destroy() {
 kernel.getLifecycleMonitor().removeLifecycleListener 
(listener);
-for (Iterator iterator = bindingsByAbstractName.values 
().iterator(); iterator.hasNext();) {

-try {
-Name name = (Name) iterator.next();
-removeDeepBinding(name, true);
-} catch (NamingException ignored) {
-}
+Set abstractNames = new HashSet 
(bindingsByAbstractName.keySet());
+for (Iterator iterator = abstractNames.iterator();  
iterator.hasNext();) {
+AbstractName abstractName = (AbstractName)  
iterator.next();

+removeBinding(abstractName);
 }
 bindingsByAbstractName.clear();
 }
@@ -119,53 +119,128 @@

 /**
  * Binds the specified gbean.  This method uses  
createBindingName and preprocessValue before binding the object.

+ *
  * @param abstractName the abstract name of the gbean to bind
  * @throws NamingException if an error occurs during binding
  */
 protected synchronized void addBinding(AbstractName  
abstractName) throws NamingException {

+if (bindingsByAbstractName.containsKey(abstractName)) {
+// previously bound
+return;
+}
+
 // get the gbean
-Object value = null;
+Object instance = null;
 try {
-value = kernel.getGBean(abstractName);
+instance = kernel.getGBean(abstractName);
 } catch (GBeanNotFoundException e) {
 throw new NamingException("GBean not found: " +  
abstractName);

 }

-// generate a name for this binding
-Name name = createBindingName(abstractName, value);
-if (name == null) return;
-
-// give sub classes a chance to preprocess the value
-value = preprocessVaue(abstractName, name, value);
-if (value == null) return;
+// create the bindings for this object
+Map bindings = createBindings(abstractName, instance);
+if