org.apache.derby.impl.store.raw.data
Class StreamFileContainerHandle

java.lang.Object
  extended by org.apache.derby.impl.store.raw.data.StreamFileContainerHandle
All Implemented Interfaces:
java.util.Observer, StreamContainerHandle

final class StreamFileContainerHandle
extends java.lang.Object
implements StreamContainerHandle, java.util.Observer

A handle to an open stream container, implememts StreamContainerHandle.

This class is an Observer to observe RawTransactions
MT - Mutable - Immutable identity - Thread Aware


Field Summary
protected  boolean active
          Is this StreamContainerHandle active.
protected  StreamFileContainer container
          The actual container we are accessing.
private  boolean hold
          Whether this container should be held open across commit.
protected  ContainerKey identity
          Container identifier
MT - Immutable
private  UUID rawStoreId
          Raw Store identifier
MT - Immutable
protected  RawTransaction xact
          our transaction.
 
Fields inherited from interface org.apache.derby.iapi.store.raw.StreamContainerHandle
TEMPORARY_SEGMENT
 
Constructor Summary
StreamFileContainerHandle(UUID rawStoreId, RawTransaction xact, ContainerKey identity, boolean hold)
           
StreamFileContainerHandle(UUID rawStoreId, RawTransaction xact, StreamFileContainer container, boolean hold)
           
 
Method Summary
 void close()
          Close me.
 boolean fetchNext(DataValueDescriptor[] row)
          fetch a row from the container.
 void getContainerProperties(java.util.Properties prop)
          Request the system properties associated with a container.
 ContainerKey getId()
          get the container key for the stream container
 RawTransaction getTransaction()
          Return the RawTransaction this object was opened in.
 void removeContainer()
          remove the stream container
 java.lang.String toString()
           
 void update(java.util.Observable obj, java.lang.Object arg)
          Called when the transaction is about to complete.
 boolean useContainer()
          Attach me to a container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rawStoreId

private final UUID rawStoreId
Raw Store identifier
MT - Immutable


identity

protected final ContainerKey identity
Container identifier
MT - Immutable


active

protected boolean active
Is this StreamContainerHandle active.
MT - Mutable : scoped


container

protected StreamFileContainer container
The actual container we are accessing. Only valid when active is true.
MT - Mutable : scoped


xact

protected RawTransaction xact
our transaction. Only valid when active is true.
MT - Mutable : scoped


hold

private boolean hold
Whether this container should be held open across commit. Only valid when active is true.
MT - Mutable : scoped

Constructor Detail

StreamFileContainerHandle

public StreamFileContainerHandle(UUID rawStoreId,
                                 RawTransaction xact,
                                 ContainerKey identity,
                                 boolean hold)

StreamFileContainerHandle

public StreamFileContainerHandle(UUID rawStoreId,
                                 RawTransaction xact,
                                 StreamFileContainer container,
                                 boolean hold)
Method Detail

getContainerProperties

public void getContainerProperties(java.util.Properties prop)
                            throws StandardException
Request the system properties associated with a container.

Specified by:
getContainerProperties in interface StreamContainerHandle
Parameters:
prop - Property list to fill in.
Throws:
StandardException - Standard exception policy.
See Also:
StreamContainerHandle.getContainerProperties(java.util.Properties)

fetchNext

public boolean fetchNext(DataValueDescriptor[] row)
                  throws StandardException
fetch a row from the container.

Specified by:
fetchNext in interface StreamContainerHandle
Parameters:
row - Row to be filled in with information from the record.
Throws:
StandardException - Standard exception policy.

close

public void close()
Description copied from interface: StreamContainerHandle
Close me. After using this method the caller must throw away the reference to the Container object, e.g.
                        ref.close();
                        ref = null;
                

The container will be closed automatically at the commit or abort of the transaction if this method is not called explictly.

Specified by:
close in interface StreamContainerHandle
Throws:
StandardException - Standard exception policy.
See Also:
StreamContainerHandle.close()

removeContainer

public void removeContainer()
                     throws StandardException
remove the stream container

Specified by:
removeContainer in interface StreamContainerHandle
Throws:
StandardException - Standard Derby error policy
See Also:
StreamContainerHandle.removeContainer()

getId

public ContainerKey getId()
get the container key for the stream container

Specified by:
getId in interface StreamContainerHandle

update

public void update(java.util.Observable obj,
                   java.lang.Object arg)
Called when the transaction is about to complete.

Specified by:
update in interface java.util.Observer
See Also:
Observer.update(java.util.Observable, java.lang.Object)

useContainer

public boolean useContainer()
                     throws StandardException
Attach me to a container. If this method returns false then I cannot be used anymore, and any reference to me must be discarded.

Throws:
StandardException - Standard Derby error policy

getTransaction

public final RawTransaction getTransaction()
Return the RawTransaction this object was opened in.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.