Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
   * as indicated by the @author tags. 
   * See the copyright.txt in the distribution for a
   * full listing of individual contributors. 
   * This copyrighted material is made available to anyone wishing to use,
   * modify, copy, or redistribute it subject to the terms and conditions
   * of the GNU Lesser General Public License, v. 2.1.
  * This program is distributed in the hope that it will be useful, but WITHOUT A 
  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
  * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
  * You should have received a copy of the GNU Lesser General Public License,
  * v.2.1 along with this distribution; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
  * MA  02110-1301, USA.
  * 
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
 /*
  * Copyright (C) 1998, 1999, 2000, 2001,
  *
  * Arjuna Solutions Limited,
  * Newcastle upon Tyne,
  * Tyne and Wear,
  * UK.  
  *
  * $Id: ObjectStore.java 2342 2006-03-30 13:06:17Z  $
  */
 
 package com.arjuna.ats.arjuna.objectstore;
 
 import java.io.File;
 
The object store interface is the application's route to using a specific object store implementation. The interface dynamically binds to an implementation of the right type. This is the base class from which all object store types are derived. Note that because object store instances are stateless, to improve efficiency we try to only create one instance of each type per process. Therefore, the create and destroy methods are used instead of new and delete. If an object store is accessed via create it *must* be deleted using destroy. Of course it is still possible to make use of new directly.

Author(s):
Mark Little (mark@arjuna.com)
Version:
$Id: ObjectStore.java 2342 2006-03-30 13:06:17Z $
Since:
JTS 1.0.
 
 
 public abstract class ObjectStore implements ObjectStoreAPI
 {
     @Override
     public void start() {}
 
     @Override
     public void stop() {}
 
     public boolean allObjUids (String sInputObjectState buffthrows ObjectStoreException
     {
         return allObjUids(sbuff.);
     }

    
Some object store implementations may be running with automatic sync disabled. Calling this method will ensure that any states are flushed to disk.
 
 
     public void sync () throws java.io.SyncFailedExceptionObjectStoreException
     {
     }

    

Parameters:
localOSRoot the root of the store.
Returns:
the full path of the store. localOSRoot is always a relative name. NOTE this path always ends in a /
 
 
     public String locateStore (String localOSRootthrows ObjectStoreException
     {
         String toReturn = null;
 
         if ((localOSRoot == null) || (localOSRoot.length() == 0))
         {
             if (( != null) && (.length() > 0))
                 localOSRoot = ;
             else
                 localOSRoot = "defaultStore"+.;
         }
        if ((localOSRoot != null) && (localOSRoot.length() > 0))
            toReturn =  + .+localOSRoot;
        if (!toReturn.endsWith(.))
            toReturn = toReturn + .;
        return toReturn;
    }

    
Does this store need to do the full write_uncommitted/commit protocol?

Returns:
true if full commit is needed, false otherwise.
    public boolean fullCommitNeeded ()
    {
        return true;
    }

    
Is the current state of the object the same as that provided as the last parameter?

Parameters:
u The object to work on.
tn The type of the object.
st The expected type of the object.
Returns:
true if the current state is as expected, false otherwise.
    public boolean isType (Uid uString tnint stthrows ObjectStoreException
    {
        return ((currentState(utn) == st) ? true : false);
    }

    
Initialise the object store.
    public final void initialise (Uid uString tn)
    {
    }
    public final int shareState ()
    {
        return ;
    }
    public final String storeDir ()
    {
        return ;
    }
    public final String storeRoot ()
    {
        return ;
    }
    protected ObjectStore(ObjectStoreEnvironmentBean objectStoreEnvironmentBeanthrows ObjectStoreException
    {
         = objectStoreEnvironmentBean.getShare();
        if (objectStoreEnvironmentBean.getObjectStoreDir() == null || objectStoreEnvironmentBean.getObjectStoreDir().length() == 0) {
            throw new ObjectStoreException("object store location property not set."); // TODO i18n
        }
        if (objectStoreEnvironmentBean.getLocalOSRoot() == null) {
             = "";
        } else {
             = objectStoreEnvironmentBean.getLocalOSRoot();
        }
        String storeDir = objectStoreEnvironmentBean.getObjectStoreDir();
        if (!storeDir.endsWith(.)) {
            storeDir = storeDir + .;
        }
        /*
        * We use the classname of the object store implementation to
        * specify the directory for the object store.
        */
         = storeDir + this.getClass().getSimpleName();
    }

    
Suppress directories of the specified type from allTypes etc?
    protected abstract boolean supressEntry (String name);

    
Given a type id which is possibly hidden (e.g., has a ! at the end), make it a valid Uid so we can return it.
    protected String revealedId (String name)
    {
        return name;
    }
    protected final int shareStatus// is the implementation sharing states between VMs?
    protected final String _objectStoreRoot;
    private final String _objectStoreDir;
New to GrepCode? Check out our FAQ X