felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <j...@apache.org>
Subject [jira] Created: (FELIX-388) Startup delay due to ExtensionManager
Date Tue, 02 Oct 2007 17:37:50 GMT
Startup delay due to ExtensionManager

                 Key: FELIX-388
                 URL: https://issues.apache.org/jira/browse/FELIX-388
             Project: Felix
          Issue Type: Improvement
          Components: Framework
            Reporter: Felix Meschberger

The ExtensionManager creates its own URL using itself as the URLStreamHandler. The URL is
inserted into the URL ClassLoader launching the framework. If a resource is to be found using
this URL, the equals method is called which causes the host name of the URL (extension) to
be resolved by InetAddress.getByName(name).

As the host is not in any DNS (most probably) and the name does not matter anyway, resolution
of the host name seems to be overkill and just delay operation. To prevent this lookup, I
propose to overwrite the URLStreamHandler.getHostAddress(URL) in the ExtensionManager to just
immediately return null:

Index: /usr/src/felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
--- /usr/src/felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
(revision 581194)
+++ /usr/src/felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
(working copy)
@@ -20,6 +20,7 @@
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.InetAddress;
 import java.net.URL;
 import java.net.URLConnection;
 import java.net.URLStreamHandler;
@@ -566,4 +567,10 @@
+    protected InetAddress getHostAddress( URL u )
+    {
+        // the extension URLs do not address real hosts
+        return null;
+    }

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message