org.netbeans.core.netigso 1.16

org.netbeans.core.netigso.spi
Class NetigsoArchive

java.lang.Object
  extended by org.netbeans.core.netigso.spi.NetigsoArchive

public final class NetigsoArchive
extends Object

Netigso's accessor to resource cache. Can be obtained from framework configuration properties under the key "netigso.archive". For each bundle then use forBundle(long, org.netbeans.core.netigso.spi.BundleContent) method to obtain own copy of the archive. Your bundle needs to have an associated BundleContent implementation. Then you can read cached content of your bundles via fromArchive(java.lang.String).

Since:
1.3

Method Summary
 NetigsoArchive forBundle(long bundleId, BundleContent content)
          Creates a clone of the archive for given bundle.
 byte[] fromArchive(String resource)
          Checks whether the given resource is in the archive cache.
 boolean isActive()
          Checks whether the archive should be used or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

forBundle

public NetigsoArchive forBundle(long bundleId,
                                BundleContent content)
Creates a clone of the archive for given bundle.

Parameters:
bundleId - identification of the bundle
content - implementation that can read from the bundle
Returns:
archive instance

fromArchive

public byte[] fromArchive(String resource)
                   throws IOException
Checks whether the given resource is in the archive cache. If so, returns it. If not, the asks the BundleContent associated with this archive to deliver it. Later, during system execution this resource is stored into the global archive for use during subsequent restart.

Parameters:
resource - name of the resource
Returns:
the content of the resource (if it exists) or null
Throws:
IOException - signals I/O error

isActive

public boolean isActive()
Checks whether the archive should be used or not. During first start the Netigso system iterates through all bundle entries to record so-called covered packages. During this iteration one should not try to use the archive - this method returns false.

Returns:
true, if it is safe to use the fromArchive(java.lang.String) method
Since:
1.14

org.netbeans.core.netigso 1.16

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.