You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2007/10/02 19:37:50 UTC
[jira] Created: (FELIX-388) Startup delay due to ExtensionManager
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 @@
m_extensions.add(extension);
}
}
+
+ 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.
[jira] Commented: (FELIX-388) Startup delay due to ExtensionManager
Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532021 ]
Karl Pauls commented on FELIX-388:
----------------------------------
Sounds good. I'm going to apply the patch. Thanks.
> 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
> Assignee: Karl Pauls
>
> 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 @@
> m_extensions.add(extension);
> }
> }
> +
> + 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.
[jira] Assigned: (FELIX-388) Startup delay due to ExtensionManager
Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Karl Pauls reassigned FELIX-388:
--------------------------------
Assignee: Karl Pauls
> 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
> Assignee: Karl Pauls
>
> 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 @@
> m_extensions.add(extension);
> }
> }
> +
> + 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.
[jira] Resolved: (FELIX-388) Startup delay due to ExtensionManager
Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Karl Pauls resolved FELIX-388.
------------------------------
Resolution: Fixed
I applied the patch.
> 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
> Assignee: Karl Pauls
>
> 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 @@
> m_extensions.add(extension);
> }
> }
> +
> + 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.