com.springsource.bundlor.internal.support
Class IncrementalReadablePartialManifest

java.lang.Object
  extended by com.springsource.bundlor.internal.support.StandardReadablePartialManifest
      extended by com.springsource.bundlor.internal.support.IncrementalReadablePartialManifest
All Implemented Interfaces:
EntryScannerListener, PartialManifest, ReadablePartialManifest

 class IncrementalReadablePartialManifest
extends StandardReadablePartialManifest
implements EntryScannerListener

Extension to StandardReadablePartialManifest to allow for re-recording of type dependencies in an incremental manner

. Concurrent Semantics
Not threadsafe.

Author:
Christian Dupuis

Nested Class Summary
(package private)  class IncrementalReadablePartialManifest.TypeDependencies
          Structure that keeps associations between a type and its dependencies
 
Field Summary
private  java.util.Stack<java.lang.String> currentlyAnalysedEntries
           
private  java.util.Map<java.lang.String,IncrementalReadablePartialManifest.TypeDependencies> recordedTypeDependencies
          Association of analyzed types and their dependencies
 
Fields inherited from class com.springsource.bundlor.internal.support.StandardReadablePartialManifest
EMPTY_SET, exportedPackages, unsatisfiedTypesByPackage
 
Constructor Summary
IncrementalReadablePartialManifest()
           
 
Method Summary
private  IncrementalReadablePartialManifest.TypeDependencies createTypeDependencies(java.lang.String fullyQualifiedClassName)
           
 java.lang.String currentEntry()
           
 void onBeginEntry(java.lang.String name)
          Start scanning of entry identified by given name.
 void onEndEntry()
          End scanning of latest started entry.
 void recordReferencedPackage(java.lang.String fullyQualifiedPackageName)
          Records that the supplied package is referenced by the artefact being analysed.
 void recordReferencedType(java.lang.String fullyQualifiedTypeName)
          Records that the supplied type is referenced by the code being analysed.
 void recordType(java.lang.String fullyQualifiedTypeName)
          Records the existence of a type
 void recordUsesPackage(java.lang.String usingPackage, java.lang.String usedPackage)
          Records a uses directive member for a given package export.
private  void unrecordType()
          Remove a recorded type from the partial manifest; also removes all induced dependencies that this type created.
 
Methods inherited from class com.springsource.bundlor.internal.support.StandardReadablePartialManifest
condense, getExportedPackages, getImportedPackages, getPackageName, getUnsatisfiedTypes, getUses, isRecordablePackage, recordExportPackage, removeImportedType, removeReferencedPackage, removeUses, unrecordExportPackage, unrecordType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

recordedTypeDependencies

private final java.util.Map<java.lang.String,IncrementalReadablePartialManifest.TypeDependencies> recordedTypeDependencies
Association of analyzed types and their dependencies


currentlyAnalysedEntries

private final java.util.Stack<java.lang.String> currentlyAnalysedEntries
Constructor Detail

IncrementalReadablePartialManifest

IncrementalReadablePartialManifest()
Method Detail

recordReferencedType

public void recordReferencedType(java.lang.String fullyQualifiedTypeName)
Records that the supplied type is referenced by the code being analysed.

Specified by:
recordReferencedType in interface PartialManifest
Overrides:
recordReferencedType in class StandardReadablePartialManifest
Parameters:
fullyQualifiedTypeName - the fully-qualified name of the referenced type

recordReferencedPackage

public void recordReferencedPackage(java.lang.String fullyQualifiedPackageName)
Records that the supplied package is referenced by the artefact being analysed.

Specified by:
recordReferencedPackage in interface PartialManifest
Overrides:
recordReferencedPackage in class StandardReadablePartialManifest
Parameters:
fullyQualifiedPackageName - The fully-qualified name of the package

recordType

public void recordType(java.lang.String fullyQualifiedTypeName)
Records the existence of a type

Specified by:
recordType in interface PartialManifest
Overrides:
recordType in class StandardReadablePartialManifest
Parameters:
fullyQualifiedTypeName - The fully qualified name of the type

recordUsesPackage

public void recordUsesPackage(java.lang.String usingPackage,
                              java.lang.String usedPackage)
Records a uses directive member for a given package export.

Specified by:
recordUsesPackage in interface PartialManifest
Overrides:
recordUsesPackage in class StandardReadablePartialManifest
Parameters:
usingPackage - the package that is using the package.
usedPackage - the package being used.

unrecordType

private void unrecordType()
Remove a recorded type from the partial manifest; also removes all induced dependencies that this type created.

Parameters:
fullyQualifiedTypeName - the type to remove

createTypeDependencies

private IncrementalReadablePartialManifest.TypeDependencies createTypeDependencies(java.lang.String fullyQualifiedClassName)

onBeginEntry

public void onBeginEntry(java.lang.String name)
Description copied from interface: EntryScannerListener
Start scanning of entry identified by given name.

Specified by:
onBeginEntry in interface EntryScannerListener

onEndEntry

public void onEndEntry()
Description copied from interface: EntryScannerListener
End scanning of latest started entry.

Specified by:
onEndEntry in interface EntryScannerListener

currentEntry

public java.lang.String currentEntry()