directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1074601 - /directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
Date Fri, 25 Feb 2011 15:59:52 GMT
Author: akarasulu
Date: Fri Feb 25 15:59:52 2011
New Revision: 1074601

URL: http://svn.apache.org/viewvc?rev=1074601&view=rev
Log:
for now just fixing dependency resolution issues in felix with plugin but preparing to dynamically
build the system packages added by the host

Modified:
    directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java

Modified: directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java?rev=1074601&r1=1074600&r2=1074601&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
Fri Feb 25 15:59:52 2011
@@ -21,6 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import java.io.File;
+import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -28,6 +29,9 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
 
 import javax.naming.NamingException;
 
@@ -112,7 +116,9 @@ public class StandaloneLdapCodecService 
         "org.apache.directory.shared.ldap.model.message; version=1.0.0",
         "org.apache.directory.shared.ldap.model.message.controls; version=1.0.0",
         "org.apache.directory.shared.ldap.codec.controls; version=1.0.0",
-        "org.apache.directory.shared.ldap.codec.api; version=1.0.0"
+        "org.apache.directory.shared.ldap.codec.api; version=1.0.0",
+        "org.apache.directory.shared.ldap.extras.controls",
+        "org.apache.directory.shared.ldap.extras.extended"
     };
  
     /** System property checked if the pluginProperty is null */
@@ -393,12 +399,37 @@ public class StandaloneLdapCodecService 
         }
         while( ii < SYSTEM_PACKAGES.length );
         
-        LOG.info( "System packages shared by host: " + SYSTEM_PACKAGES );
-        
         return sb.toString();
     }
     
     
+    private String getExportPackage( File bundle )
+    {   
+        JarFile jar;
+        try
+        {
+            jar = new JarFile( bundle );
+            Manifest manifest = jar.getManifest();
+            
+            Attributes attrs = manifest.getMainAttributes();
+            for ( Object key : attrs.keySet() )
+            {
+                if ( key.toString().equals( "Export-Package" ) )
+                {
+                    return attrs.get( key ).toString();
+                }
+            }
+            
+            return null;
+        }
+        catch ( IOException e )
+        {
+            LOG.error( "Failed to open jar file or manifest.", e );
+            throw new RuntimeException( "Failed to open jar file or manifest.", e );
+        }
+    }
+    
+    
     /**
      * Sets up a {@link Felix} instance.
      */
@@ -975,4 +1006,13 @@ public class StandaloneLdapCodecService 
         
         return resp;
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isExtendedOperationRegistered( String oid )
+    {
+        return extReqFactories.containsKey( oid ) || unsolicitedFactories.containsKey( oid
);
+    }
 }



Mime
View raw message