harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Dmitriev (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4141) [classlib][jndi] InitialContext.getURLOrDefaultInitCtx() optimization
Date Wed, 13 Jun 2007 08:29:25 GMT
[classlib][jndi] InitialContext.getURLOrDefaultInitCtx() optimization
---------------------------------------------------------------------

                 Key: HARMONY-4141
                 URL: https://issues.apache.org/jira/browse/HARMONY-4141
             Project: Harmony
          Issue Type: Improvement
          Components: Classlib
            Reporter: Sergey Dmitriev


In process of enabling SPECjAppServer2004 on harmony on Oracle
Application Server the following issue in JNDI has been discovered.

While starting Oracle EJB Containers (OC4J) with SPECjAppServer2004
onboard OC4J creates several thousands of beans. And for every such
bean OC4J has to set the lookup context - corresponding class which is
taken from InitialContext.getURLOrDefaultInitCtx(name).

Actually the issue is in the way of finding the corresponding class in
getURLOrDefaultInitCtx() method. The method searches for several
patterns of context factory class name. Something like:

  com.oracle.*.javaURLContextFactory
  ...
  com.sun.*.javaURLContextFactory

where "java" in "javaURLContextFactory" is so called schema.

(Please refer javax.naming.InitialContext javadoc for detailed information)

So roughly speaking we have the following schema:

  1 create bean
  2 get the URL schema
  3 get the corresponging context factory (Class.forName() for several patterns)
  4 get the context from the factory
  5 set the context for the bean

So we have the 3rd step every time even if we have already found the
factory for this schema for previous bean for example.

The attached patch reduces triple the startup time of OC4J. Please note
that this is NOT a fix but kind of hackish solution - just to show
what's going on. ...and to reduce the startup time for enabling.

Probably hash map can be one of the appropriate solutions here.


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


Mime
View raw message