You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2008/05/21 23:09:57 UTC

svn commit: r658873 - in /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi: ServerContext.java ServerDirContext.java ServerLdapContext.java

Author: akarasulu
Date: Wed May 21 14:09:56 2008
New Revision: 658873

URL: http://svn.apache.org/viewvc?rev=658873&view=rev
Log:
fixing breakage by replacing NamingException and NamingEnumeration

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=658873&r1=658872&r2=658873&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Wed May 21 14:09:56 2008
@@ -181,7 +181,7 @@
      * @param service the directory service core
      * @throws NamingException if there is a problem creating the new context
      */
-    public ServerContext( DirectoryService service, LdapPrincipal principal, Name dn ) throws NamingException
+    public ServerContext( DirectoryService service, LdapPrincipal principal, Name dn ) throws Exception
     {
         this.service = service;
         this.dn = ( LdapDN ) dn.clone();
@@ -539,7 +539,14 @@
     {
         for ( NamingListener listener : listeners )
         {
-            ( ( PartitionNexusProxy ) this.nexusProxy ).removeNamingListener( this, listener );
+            try
+            {
+                ( ( PartitionNexusProxy ) this.nexusProxy ).removeNamingListener( this, listener );
+            }
+            catch ( Exception e )
+            {
+                JndiUtils.wrap( e );
+            }
         }
     }
 
@@ -639,7 +646,19 @@
         {
             JndiUtils.wrap( e );
         }
-        return new ServerLdapContext( service, principal, target );
+        
+        ServerLdapContext ctx = null;
+        
+        try
+        {
+            ctx = new ServerLdapContext( service, principal, target );
+        }
+        catch ( Exception e )
+        {
+            JndiUtils.wrap( e );
+        }
+        
+        return ctx;
     }
 
 
@@ -1029,7 +1048,18 @@
         }
 
         // Initialize and return a context since the entry is not a java object
-        return new ServerLdapContext( service, principal, target );
+        ServerLdapContext ctx = null;
+        
+        try
+        {
+            ctx = new ServerLdapContext( service, principal, target );
+        }
+        catch ( Exception e )
+        {
+            JndiUtils.wrap( e );
+        }
+        
+        return ctx;
     }
 
 
@@ -1215,8 +1245,15 @@
         ExprNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );
         SearchControls controls = new SearchControls();
         controls.setSearchScope( scope );
-        ( ( PartitionNexusProxy ) this.nexusProxy ).addNamingListener( this, buildTarget( name ), filter, controls,
-            namingListener );
+        try
+        {
+            ( ( PartitionNexusProxy ) this.nexusProxy ).addNamingListener( this, buildTarget( name ), filter, controls,
+                namingListener );
+        }
+        catch ( Exception e )
+        {
+            JndiUtils.wrap( e );
+        }
         listeners.add( namingListener );
     }
 
@@ -1229,7 +1266,14 @@
 
     public void removeNamingListener( NamingListener namingListener ) throws NamingException
     {
-        ( ( PartitionNexusProxy ) this.nexusProxy ).removeNamingListener( this, namingListener );
+        try
+        {
+            ( ( PartitionNexusProxy ) this.nexusProxy ).removeNamingListener( this, namingListener );
+        }
+        catch ( Exception e )
+        {
+            JndiUtils.wrap( e );
+        }
         listeners.remove( namingListener );
     }
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?rev=658873&r1=658872&r2=658873&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java Wed May 21 14:09:56 2008
@@ -104,7 +104,7 @@
      * @param principal the principal which is propagated
      * @param dn the distinguished name of this context
      */
-    public ServerDirContext( DirectoryService service, LdapPrincipal principal, Name dn ) throws NamingException
+    public ServerDirContext( DirectoryService service, LdapPrincipal principal, Name dn ) throws Exception
     {
         super( service, principal, dn );
     }
@@ -539,7 +539,19 @@
         }
 
         // Initialize the new context
-        return new ServerLdapContext( getService(), getPrincipal(), target );
+        ServerLdapContext ctx = null;
+        
+        try
+        {
+            ctx = new ServerLdapContext( getService(), getPrincipal(), target );
+        }
+        catch ( Exception e )
+        {
+            JndiUtils.wrap( e );
+        }
+        
+        
+        return ctx;
     }
 
 
@@ -882,8 +894,15 @@
             throw e2;
         }
 
-        ( ( PartitionNexusProxy ) getNexusProxy() ).addNamingListener( this, buildTarget( name ), filter,
-            searchControls, namingListener );
+        try
+        {
+            ( ( PartitionNexusProxy ) getNexusProxy() ).addNamingListener( this, buildTarget( name ), filter,
+                searchControls, namingListener );
+        }
+        catch ( Exception e )
+        {
+            JndiUtils.wrap( e );
+        }
         getListeners().add( namingListener );
     }
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java?rev=658873&r1=658872&r2=658873&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java Wed May 21 14:09:56 2008
@@ -77,7 +77,7 @@
      * @param service the directory service core
      * @throws NamingException if there are problems instantiating 
      */
-    public ServerLdapContext( DirectoryService service, LdapPrincipal principal, LdapDN dn ) throws NamingException
+    public ServerLdapContext( DirectoryService service, LdapPrincipal principal, LdapDN dn ) throws Exception
     {
         super( service, principal, dn );
         refService = ( ( ReferralInterceptor ) service.getInterceptorChain().get( ReferralInterceptor.class.getName() ) );
@@ -100,7 +100,15 @@
      */
     public LdapContext newInstance( Control[] requestControls ) throws NamingException
     {
-        ServerLdapContext ctx = new ServerLdapContext( getService(), getPrincipal(), ( LdapDN ) getDn() );
+        ServerLdapContext ctx = null;
+        try
+        {
+            ctx = new ServerLdapContext( getService(), getPrincipal(), ( LdapDN ) getDn() );
+        }
+        catch ( Exception e )
+        {
+            JndiUtils.wrap( e );
+        }
         ctx.setRequestControls( requestControls );
         return ctx;
     }
@@ -265,6 +273,7 @@
     {
         return refService.isReferral( name );
     }
+    
 
     /**
      * Check if a Name is a referral
@@ -277,8 +286,20 @@
         return refService.isReferral( name );
     }
 
+    
     public ServerContext getRootContext() throws NamingException
     {
-        return new ServerLdapContext( getService(), getPrincipal(), new LdapDN() );
+        ServerContext ctx = null;
+        
+        try
+        {
+            ctx = new ServerLdapContext( getService(), getPrincipal(), new LdapDN() );
+        }
+        catch ( Exception e )
+        {
+            JndiUtils.wrap( e );
+        }
+        
+        return ctx;
     }
 }