Package com.oss.asn1

Interface StorageManager

All Known Implementing Classes:
OSSStorageManager

public interface StorageManager
The StorageManager interface is implemented by the object that is developed to control the allocation of the external memory. The runtime is instructed to use the custom storage manager instead of the default storage manager by calling the setStorageManager() method of the Coder. The implementation must assume that the object may be accessed from concurrent threads and must be thread safe.
Since:
ASN.1/Java 1.4 beta A
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Identifies the storage, optimized for storing an array of bytes.
    static final int
    Identifies the storage, optimized for storing an array of characters.
    static final int
    Identifies the storage, optimized for storing an array of Objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    allocate(int kind)
    Allocate an external storage of the given kind.
    void
    Terminate the storage manager and release all the system resources, associated with this storage manager.
  • Field Details

    • STORAGE_BYTES

      static final int STORAGE_BYTES
      Identifies the storage, optimized for storing an array of bytes.
      See Also:
    • STORAGE_CHARS

      static final int STORAGE_CHARS
      Identifies the storage, optimized for storing an array of characters.
      See Also:
    • STORAGE_OBJECTS

      static final int STORAGE_OBJECTS
      Identifies the storage, optimized for storing an array of Objects.
      See Also:
  • Method Details

    • allocate

      Storage allocate(int kind) throws StorageException
      Allocate an external storage of the given kind.
      Parameters:
      kind - specifies the kind of storage to allocate (either STORAGE_BYTES, STORAGE_CHARS or STORAGE_OBJECTS.
      Returns:
      the object that implements ByteStorage, CharStorage or ObjectStorage interface.
      Throws:
      StorageException - if the storage manager failed to allocate the external storage of the specified kind.
    • close

      void close() throws StorageException
      Terminate the storage manager and release all the system resources, associated with this storage manager. The object that implements the StorageManager interface should call this method from its finalize() method.
      Throws:
      StorageException - if any error occurs when terminating the storage manager.