This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 227802 - Control (enable/disable/conditionally enable) creation of all-resources.dat
Summary: Control (enable/disable/conditionally enable) creation of all-resources.dat
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 7.3.1
Hardware: PC Linux
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2013-03-22 09:11 UTC by Jaroslav Tulach
Modified: 2013-06-05 09:35 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed branding API with one new method in JarClassLoader (15.87 KB, patch)
2013-03-22 09:17 UTC, Jaroslav Tulach
Details | Diff
New patch using property as Stoyan suggested, just using FQN name (12.20 KB, patch)
2013-05-22 13:37 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2013-03-22 09:11:43 UTC
Some applications built on top of NetBeans Platform expressed
option that certain files in caches, namely all-resources.dat
can be too big and that this is not good for multi-user installation.
To give such applications control over creation of this file, there
will be a branding token (conditionally) disable the creation of the cache file.
Comment 1 Jaroslav Tulach 2013-03-22 09:17:35 UTC
Created attachment 132934 [details]
Proposed branding API with one new method in JarClassLoader
Comment 2 Jaroslav Tulach 2013-03-22 09:21:20 UTC
Y01 Fix versioning. Uses 1.XXX version, no dependency between core.startup and o.n.bootstrap

Y02 Add/update apichanges.xml into o.n.bootstrap
Comment 3 stoto79 2013-05-08 21:38:37 UTC
  Here's a possible implementation of updateAllResources that uses a system property to control this behavior:

  private static boolean updateAllResources() {
      String updateAllResources = System.getProperty("netbeans.update.all.resources"); // NOI18N
      if (!"never".equals(updateAllResources)) { // NOI18N
        if ("missing".equals(updateAllResources)) { // NOI18N
          if (!org.netbeans.JarClassLoader.isArchivePopulated()) {
            org.netbeans.JarClassLoader.saveArchive();
            return true;
          }  
        } else if ("always".equals(updateAllResources)) { // NOI18N  
          org.netbeans.JarClassLoader.saveArchive();
          return true;
        } else {
          assert updateAllResources == null : "invalid value for system" +
            "property netbeans.update.all.resources: " + updateAllResources;
          org.netbeans.JarClassLoader.saveArchive();
          return true;
        }
        return true;
      }
      return false; 
    }
Comment 4 Jaroslav Tulach 2013-05-22 13:37:46 UTC
Created attachment 134747 [details]
New patch using property as Stoyan suggested, just using FQN name

Stoyan, please confirm this patch is OK and I'll integrate the next day.
Comment 5 stoto79 2013-05-30 22:53:58 UTC
OK, so the system property is called org.netbeans.core.update.all.resources . I will pass this along to SQLDev to make use of when this is checked in. And just a gentle reminder: this need not be checked into our abrams branch (12.1.2), just for MAIN, 12.1.3.
Comment 6 Jaroslav Tulach 2013-05-31 07:40:22 UTC
The information about branches is more for Tomáš. Should we create another jdev_ branch in releases?
Comment 7 Jaroslav Tulach 2013-05-31 08:38:38 UTC
changeset:   427ba20900b5
parent:      f9c322a6c6f2
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Fri May 31 09:51:21 2013 +0200
summary:     #227802: Property to control behavior of the all-resources.dat cache file

changeset:   d8c485699e1d
tag:         tip
parent:      107f720551c6
parent:      427ba20900b5
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Fri May 31 10:36:13 2013 +0200
summary:     Merging #227802 into 7.4 line and providing better versioning and documentation


Can be backported to any 7.3 based branch by "hg merge 427ba20900b5".
Comment 8 Quality Engineering 2013-06-05 09:35:02 UTC
Integrated into 'main-golden', will be available in build *201306050626* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/427ba20900b5
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #227802: Property to control behavior of the all-resources.dat cache file