org.openorb.pss.connector.file
Class FileCatalog

java.lang.Object
  extended by org.omg.CORBA.LocalObject
      extended by org.openorb.pss.connector.file.FileCatalog
All Implemented Interfaces:
java.io.Serializable, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity, CatalogBase, CatalogBaseOperations, ExtendedCatalog, FileCatalogBase
Direct Known Subclasses:
FileSession

public abstract class FileCatalog
extends org.omg.CORBA.LocalObject
implements CatalogBase, FileCatalogBase, ExtendedCatalog

This class is a catalog for persistent storage home.

Author:
Jerome Daniel
See Also:
Serialized Form

Constructor Summary
FileCatalog()
          Constructor without any parameter
FileCatalog(org.omg.PortableInterceptor.ORBInitInfo info)
          Constructor
 
Method Summary
 short access_mode()
          The read-only attribute access_mode returns the access mode of this catalog.
abstract  void close()
          The operation close terminates the catalog.
 Connector connector()
          Return the connector reference
 byte[][] find_all(StorageHomeBase home)
           
 java.lang.Object find_by_pid(byte[] the_pid)
          The find_by_pid operation attempts to locate a storage object with the given PID in the storage homes provided by the target catalog.
abstract  StorageHomeBase find_home_base(PID pid)
          Returns an storage object home from its PID ( high part is only used )
 StorageObjectRef find_ref_by_pid(byte[] the_pid)
           
 StorageHomeBase find_storage_home(java.lang.String storage_home_id)
          The find_storage_home operation can be used to obtain a storage home instance.
abstract  void flush()
          The flush operation instructs the PSS implementation to write to disk any cached modifications of storage object incarnations managed by this catalog.
abstract  void free_all()
          The operation free_all instructs the catalog implementation to set the reference count of all its PSDL storage object instances to 0.
 Iterator iterator(StorageHomeBase home)
           
 Parameter[] parameters()
          Return parameters
abstract  void refresh()
          A PSS implementation can cache data read from the datastore(s).
 void setCatalogInfo(FileConnector connector, short access, Parameter[] parameters)
          Set catalog information
 
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openorb.pss.connector.file.FileCatalogBase
create_embedded_object, create_empty_object, create_new_entry, create_object, delete, entry, entry, getSequentialAccess, incarnate, setBaseInfo, stored
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 
Methods inherited from interface org.openorb.pss.connector.ExtendedCatalog
clean, destroy
 

Constructor Detail

FileCatalog

public FileCatalog()
Constructor without any parameter


FileCatalog

public FileCatalog(org.omg.PortableInterceptor.ORBInitInfo info)
Constructor

Method Detail

connector

public Connector connector()
Return the connector reference

Specified by:
connector in interface FileCatalogBase

setCatalogInfo

public void setCatalogInfo(FileConnector connector,
                           short access,
                           Parameter[] parameters)
Set catalog information


access_mode

public short access_mode()
Description copied from interface: CatalogBaseOperations
The read-only attribute access_mode returns the access mode of this catalog. When the access mode is READ_ONLY, the storage object incarnations obtained through storage home instances provided by this catalog are read-only.

Specified by:
access_mode in interface CatalogBaseOperations

parameters

public Parameter[] parameters()
Return parameters

Specified by:
parameters in interface FileCatalogBase

find_storage_home

public StorageHomeBase find_storage_home(java.lang.String storage_home_id)
                                  throws NotFound
Description copied from interface: CatalogBaseOperations
The find_storage_home operation can be used to obtain a storage home instance. find_storage_home raises NotFound if it cannot find a storage home that matches the given storage_home_id. The format of the storage_home_id parameter is mostly implementation-defined. In the case of type-specific catalogs (declared in PSDL), the provide declarations define valid storage_home_id parameters. The find_storage_home operation also understands storage_home_id that have the form of a PSDL type id. find_storage_home looks up a PSDL-defined storage home with this type id in the catalog?s default datastore. If the storage_home_id parameter has the form ":datastore_name", where datastore_name is a string, find_storage_home returns a storage home instance for the storage home associated with java.lang.Object (Java) in this datastore.

Specified by:
find_storage_home in interface CatalogBaseOperations
Throws:
NotFound

find_by_pid

public java.lang.Object find_by_pid(byte[] the_pid)
                             throws NotFound
Description copied from interface: CatalogBaseOperations
The find_by_pid operation attempts to locate a storage object with the given PID in the storage homes provided by the target catalog.

Specified by:
find_by_pid in interface CatalogBaseOperations
Returns:
StorageObjectBase an incarnation of this storage object
Throws:
NotFound - if it cannot find a storage object with this pid.

find_ref_by_pid

public StorageObjectRef find_ref_by_pid(byte[] the_pid)
                                 throws NotFound
Specified by:
find_ref_by_pid in interface ExtendedCatalog
Throws:
NotFound

find_all

public byte[][] find_all(StorageHomeBase home)
Specified by:
find_all in interface ExtendedCatalog

iterator

public Iterator iterator(StorageHomeBase home)
Specified by:
iterator in interface ExtendedCatalog

flush

public abstract void flush()
Description copied from interface: CatalogBaseOperations
The flush operation instructs the PSS implementation to write to disk any cached modifications of storage object incarnations managed by this catalog. Often, when an application creates a new storage object or updates a storage object, the modification is not written directly to disk -- the PSS implementation can cache some dirty data.

Specified by:
flush in interface CatalogBaseOperations

refresh

public abstract void refresh()
Description copied from interface: CatalogBaseOperations
A PSS implementation can cache data read from the datastore(s). The refresh operation instructs the PSS implementation to refresh any cached storage object incarnations accessed by this catalog. This operation can invalidate any direct reference to a storage object incarnation?s data member.

Specified by:
refresh in interface CatalogBaseOperations

free_all

public abstract void free_all()
Description copied from interface: CatalogBaseOperations
The operation free_all instructs the catalog implementation to set the reference count of all its PSDL storage object instances to 0. In programming languages without garbage collection, such as C++, PSDL storage object instances are reference-counted by the application. Further, when a PSDL storage object A holds a reference to another PSDL storage object B, A?s instance owns a reference count of B?s instance. When PSDL storage objects form a cyclic graph, the corresponding instances own reference count of each other; even if the programmer correctly releases all her reference counts, the cyclic graph will never be completely released. The free_all operation deals with this problem.

Specified by:
free_all in interface CatalogBaseOperations

close

public abstract void close()
Description copied from interface: CatalogBaseOperations
The operation close terminates the catalog. When closed, the catalog is also flushed. If the catalog is associated with one or more transactions when close is called, these transactions are marked roll-back only.

Specified by:
close in interface CatalogBaseOperations

find_home_base

public abstract StorageHomeBase find_home_base(PID pid)
Returns an storage object home from its PID ( high part is only used )