db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/odmg/locking LockManagerOdmgImpl.java LockManager.java LockManagerFactory.java AbstractLockStrategy.java InMemoryLockMapImpl.java LockEntry.java LockingConfiguration.java LockManagerDefaultImpl.java LockMap.java LockMapFactory.java LockServerServlet.java LockStrategy.java LockStrategyFactory.java ObjectLocks.java PersistentLockMapImpl.java ReadCommittedStrategy.java ReadUncommittedStrategy.java RemoteLockMapImpl.java RepeatableReadStrategy.java SerializableStrategy.java
Date Sat, 18 Sep 2004 13:04:03 GMT
arminw      2004/09/18 06:04:03

  Modified:    src/java/org/apache/ojb/odmg/locking Tag: OJB_1_0_RELEASE
                        LockManager.java LockManagerFactory.java
  Added:       src/java/org/apache/ojb/odmg/locking Tag: OJB_1_0_RELEASE
                        LockManagerOdmgImpl.java
  Removed:     src/java/org/apache/ojb/odmg/locking Tag: OJB_1_0_RELEASE
                        AbstractLockStrategy.java InMemoryLockMapImpl.java
                        LockEntry.java LockingConfiguration.java
                        LockManagerDefaultImpl.java LockMap.java
                        LockMapFactory.java LockServerServlet.java
                        LockStrategy.java LockStrategyFactory.java
                        ObjectLocks.java PersistentLockMapImpl.java
                        ReadCommittedStrategy.java
                        ReadUncommittedStrategy.java RemoteLockMapImpl.java
                        RepeatableReadStrategy.java
                        SerializableStrategy.java
  Log:
  use new kernel locking-package for locking, remove unused classes
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.5.2.1   +112 -1    db-ojb/src/java/org/apache/ojb/odmg/locking/LockManager.java
  
  Index: LockManager.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/locking/LockManager.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- LockManager.java	5 Apr 2004 12:16:23 -0000	1.5
  +++ LockManager.java	18 Sep 2004 13:04:02 -0000	1.5.2.1
  @@ -1 +1,112 @@
  -package org.apache.ojb.odmg.locking;

/* Copyright 2002-2004 The Apache Software Foundation
*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this
file except in compliance with the License.
 * You may obtain a copy of the License at
 *
*     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or
agreed to in writing, software
 * distributed under the License is distributed on an "AS IS"
BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See
the License for the specific language governing permissions and
 * limitations under the License.
*/

import org.apache.ojb.odmg.TransactionImpl;

/**
 * This interface declares the functionality
of the OJB internal Locking mechanism.
 * A default implementaion LockManagerDefaultImpl is
provided. This implementaion
 * keeps distributed locks in the database. The locking mechanisms
thus involves a
 * lot of database lookups and writes. For some environments this solution
may not
 * be adequate. OJB allows to provide user defined implementations of this interface.
* To activate a user defined LockManagerDefaultImpl it must be configured in the OJB.properties
file.
 *
 *
 * @author thma
 */
public interface LockManager
{
    /**
     * aquires a readlock
for transaction tx on object obj.
     * Returns true if successful, else false.
     */
   public abstract boolean readLock(TransactionImpl tx, Object obj);

    /**
     * aquires
a writelock for transaction tx on object obj.
     * Returns true if successful, else false.
    */
    public abstract boolean writeLock(TransactionImpl tx, Object obj);

    /**
  
  * upgrades readlock for transaction tx on object obj to a writelock.
     * If no readlock
existed a writelock is acquired anyway.
     * Returns true if successful, else false.
  
  */
    public abstract boolean upgradeLock(TransactionImpl tx, Object obj);

    /**
  
  * releases a lock for transaction tx on object obj.
     * Returns true if successful, else
false.
     */
    public abstract boolean releaseLock(TransactionImpl tx, Object obj);

   /**
     * checks if there is a readlock for transaction tx on object obj.
     * Returns
true if so, else false.
     */
    public abstract boolean checkRead(TransactionImpl tx,
Object obj);

    /**
     * checks if there is a writelock for transaction tx on object obj.
    * Returns true if so, else false.
     */
    public abstract boolean checkWrite(TransactionImpl
tx, Object obj);
}
  +package org.apache.ojb.odmg.locking;
  +
  +/* Copyright 2002-2004 The Apache Software Foundation
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *     http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
  +
  +import org.apache.ojb.odmg.TransactionImpl;
  +import org.apache.ojb.broker.Identity;
  +
  +/**
  + * This interface declares the functionality of the OJB internal Locking mechanism.
  + * A default implementaion LockManagerDefaultImpl is provided. This implementaion
  + * keeps distributed locks in the database. The locking mechanisms thus involves a
  + * lot of database lookups and writes. For some environments this solution may not
  + * be adequate. OJB allows to provide user defined implementations of this interface.
  + * To activate a user defined LockManagerDefaultImpl it must be configured in the OJB.properties
file.
  + *
  + *
  + * @author thma
  + */
  +public interface LockManager
  +{
  +    /**
  +     * aquires a readlock for transaction tx on object obj.
  +     * Returns true if successful, else false.
  +     */
  +    public abstract boolean readLock(TransactionImpl tx, Object obj);
  +
  +    /**
  +     * aquires a readlock for transaction tx on object obj.
  +     * Returns true if successful, else false.
  +     */
  +    public abstract boolean readLock(TransactionImpl tx, Identity oid, Object obj);
  +
  +
  +    /**
  +     * aquires a writelock for transaction tx on object obj.
  +     * Returns true if successful, else false.
  +     */
  +    public abstract boolean writeLock(TransactionImpl tx, Object obj);
  +
  +    /**
  +     * aquires a writelock for transaction tx on object obj.
  +     * Returns true if successful, else false.
  +     */
  +    public abstract boolean writeLock(TransactionImpl tx, Identity oid, Object obj);
  +
  +
  +    /**
  +     * upgrades readlock for transaction tx on object obj to a writelock.
  +     * If no readlock existed a writelock is acquired anyway.
  +     * Returns true if successful, else false.
  +     */
  +    public abstract boolean upgradeLock(TransactionImpl tx, Object obj);
  +
  +    /**
  +     * upgrades readlock for transaction tx on object obj to a writelock.
  +     * If no readlock existed a writelock is acquired anyway.
  +     * Returns true if successful, else false.
  +     */
  +    public abstract boolean upgradeLock(TransactionImpl tx, Identity oid, Object obj);
  +
  +
  +    /**
  +     * releases a lock for transaction tx on object obj.
  +     * Returns true if successful, else false.
  +     */
  +    public abstract boolean releaseLock(TransactionImpl tx, Object obj);
  +
  +    /**
  +     * releases a lock for transaction tx on object obj.
  +     * Returns true if successful, else false.
  +     */
  +    public abstract boolean releaseLock(TransactionImpl tx, Identity oid, Object obj);
  +
  +
  +    /**
  +     * checks if there is a readlock for transaction tx on object obj.
  +     * Returns true if so, else false.
  +     */
  +    public abstract boolean checkRead(TransactionImpl tx, Object obj);
  +
  +    /**
  +     * checks if there is a readlock for transaction tx on object obj.
  +     * Returns true if so, else false.
  +     */
  +    public abstract boolean checkRead(TransactionImpl tx, Identity oid, Object obj);
  +
  +
  +    /**
  +     * checks if there is a writelock for transaction tx on object obj.
  +     * Returns true if so, else false.
  +     */
  +    public abstract boolean checkWrite(TransactionImpl tx, Object obj);
  +
  +    /**
  +     * checks if there is a writelock for transaction tx on object obj.
  +     * Returns true if so, else false.
  +     */
  +    public abstract boolean checkWrite(TransactionImpl tx, Identity oid, Object obj);
  +}
  
  
  
  1.5.2.1   +109 -1    db-ojb/src/java/org/apache/ojb/odmg/locking/LockManagerFactory.java
  
  Index: LockManagerFactory.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/locking/LockManagerFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- LockManagerFactory.java	5 Apr 2004 12:16:23 -0000	1.5
  +++ LockManagerFactory.java	18 Sep 2004 13:04:02 -0000	1.5.2.1
  @@ -1 +1,109 @@
  -package org.apache.ojb.odmg.locking;

/* Copyright 2002-2004 The Apache Software Foundation
*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this
file except in compliance with the License.
 * You may obtain a copy of the License at
 *
*     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or
agreed to in writing, software
 * distributed under the License is distributed on an "AS IS"
BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See
the License for the specific language governing permissions and
 * limitations under the License.
*/

import org.apache.ojb.broker.OJBRuntimeException;
import org.apache.ojb.broker.PersistenceBrokerFactory;
import
org.apache.ojb.broker.util.ClassHelper;

/**
 * This factory class creates LockManager instances
according
 * to the setting in the OJB properties file.
 */
public class LockManagerFactory
{
   private static LockManager LOCKMAN = null;
    static
    {
        try
        {
    
       LockingConfiguration config = (LockingConfiguration) PersistenceBrokerFactory.getConfigurator().getConfigurationFor(null);
           LOCKMAN = (LockManager) ClassHelper.newInstance(config.getLockManagerClass());
       }
        catch (Exception e)
        {
            throw new OJBRuntimeException("Unexpected
failure while start LockManager", e);
        }
    }

    /**
     * get a lockManager instance.
The implementation class is
     * configured in the OJB properties file.
     */
    public
static LockManager getLockManager()
    {
        return LOCKMAN;
    }
}
  +package org.apache.ojb.odmg.locking;
  +
  +/* Copyright 2002-2004 The Apache Software Foundation
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *     http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
  +
  +import org.apache.ojb.broker.OJBRuntimeException;
  +import org.apache.ojb.broker.locking.LockManager;
  +import org.apache.ojb.broker.locking.LockMap;
  +import org.apache.ojb.broker.locking.LockStrategyManager;
  +import org.apache.ojb.broker.util.factory.ConfigurableFactory;
  +
  +/**
  + * This factory class creates LockManager instances according
  + * to the setting in the OJB properties file.
  + */
  +public class LockManagerFactory
  +{
  +    private static org.apache.ojb.odmg.locking.LockManager LOCKMAN = null;
  +    static
  +    {
  +        try
  +        {
  +            // create kernel LockMap instance
  +            org.apache.ojb.broker.locking.LockMap lockMap =
  +                    (new LockMapFactory()).createNewLockMap();
  +            // create the kernel LockStrategyManager instance
  +            org.apache.ojb.broker.locking.LockStrategyManager ls = new LockStrategyManager(lockMap);
  +            // create the kernel LockManager
  +            org.apache.ojb.broker.locking.LockManager lockManager =
  +                    (new LockManagerKernelFactory()).createNewLockManager(ls);
  +            // Now create the ODMG level LockManager
  +            LOCKMAN = (new LockManagerOdmgFactory()).createNewLockManager(lockManager);
  +        }
  +        catch (Exception e)
  +        {
  +            throw new OJBRuntimeException("Unexpected failure while start LockManager",
e);
  +        }
  +    }
  +
  +    /**
  +     * Get a {@link org.apache.ojb.odmg.locking.LockManager} instance. The implementation
class is
  +     * configured in the OJB properties file.
  +     */
  +    public static org.apache.ojb.odmg.locking.LockManager getLockManager()
  +    {
  +        return LOCKMAN;
  +    }
  +
  +    /**
  +     * Factory to create {@link org.apache.ojb.odmg.locking.LockManager} instances.
  +     */
  +    private static class LockManagerOdmgFactory extends ConfigurableFactory
  +    {
  +        protected String getConfigurationKey()
  +        {
  +            return "OdmgLockManagerClass";
  +        }
  +
  +        org.apache.ojb.odmg.locking.LockManager createNewLockManager(LockManager manager)
  +        {
  +            return (org.apache.ojb.odmg.locking.LockManager) this.createNewInstance(
  +                    LockManager.class, manager);
  +        }
  +    }
  +
  +    /**
  +     * Factory to create {@link org.apache.ojb.broker.locking.LockMap} instances
  +     */
  +    private static class LockMapFactory extends ConfigurableFactory
  +    {
  +        protected String getConfigurationKey()
  +        {
  +            return "LockMapClass";
  +        }
  +
  +        LockMap createNewLockMap()
  +        {
  +            return (LockMap) this.createNewInstance();
  +        }
  +    }
  +
  +    /**
  +     * Factory to create kernel {@link org.apache.ojb.broker.locking.LockManager} instances.
  +     */
  +    private static class LockManagerKernelFactory extends ConfigurableFactory
  +    {
  +        protected String getConfigurationKey()
  +        {
  +            return "LockManagerClass";
  +        }
  +
  +        LockManager createNewLockManager(LockStrategyManager strategy)
  +        {
  +            return (LockManager) this.createNewInstance(LockStrategyManager.class, strategy);
  +        }
  +    }
  +}
  
  
  
  No                   revision
  
  Index: LockManagerFactory.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/locking/LockManagerFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- LockManagerFactory.java	5 Apr 2004 12:16:23 -0000	1.5
  +++ LockManagerFactory.java	18 Sep 2004 13:04:02 -0000	1.5.2.1
  @@ -1 +1,109 @@
  -package org.apache.ojb.odmg.locking;

/* Copyright 2002-2004 The Apache Software Foundation
*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this
file except in compliance with the License.
 * You may obtain a copy of the License at
 *
*     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or
agreed to in writing, software
 * distributed under the License is distributed on an "AS IS"
BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See
the License for the specific language governing permissions and
 * limitations under the License.
*/

import org.apache.ojb.broker.OJBRuntimeException;
import org.apache.ojb.broker.PersistenceBrokerFactory;
import
org.apache.ojb.broker.util.ClassHelper;

/**
 * This factory class creates LockManager instances
according
 * to the setting in the OJB properties file.
 */
public class LockManagerFactory
{
   private static LockManager LOCKMAN = null;
    static
    {
        try
        {
    
       LockingConfiguration config = (LockingConfiguration) PersistenceBrokerFactory.getConfigurator().getConfigurationFor(null);
           LOCKMAN = (LockManager) ClassHelper.newInstance(config.getLockManagerClass());
       }
        catch (Exception e)
        {
            throw new OJBRuntimeException("Unexpected
failure while start LockManager", e);
        }
    }

    /**
     * get a lockManager instance.
The implementation class is
     * configured in the OJB properties file.
     */
    public
static LockManager getLockManager()
    {
        return LOCKMAN;
    }
}
  +package org.apache.ojb.odmg.locking;
  +
  +/* Copyright 2002-2004 The Apache Software Foundation
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *     http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
  +
  +import org.apache.ojb.broker.OJBRuntimeException;
  +import org.apache.ojb.broker.locking.LockManager;
  +import org.apache.ojb.broker.locking.LockMap;
  +import org.apache.ojb.broker.locking.LockStrategyManager;
  +import org.apache.ojb.broker.util.factory.ConfigurableFactory;
  +
  +/**
  + * This factory class creates LockManager instances according
  + * to the setting in the OJB properties file.
  + */
  +public class LockManagerFactory
  +{
  +    private static org.apache.ojb.odmg.locking.LockManager LOCKMAN = null;
  +    static
  +    {
  +        try
  +        {
  +            // create kernel LockMap instance
  +            org.apache.ojb.broker.locking.LockMap lockMap =
  +                    (new LockMapFactory()).createNewLockMap();
  +            // create the kernel LockStrategyManager instance
  +            org.apache.ojb.broker.locking.LockStrategyManager ls = new LockStrategyManager(lockMap);
  +            // create the kernel LockManager
  +            org.apache.ojb.broker.locking.LockManager lockManager =
  +                    (new LockManagerKernelFactory()).createNewLockManager(ls);
  +            // Now create the ODMG level LockManager
  +            LOCKMAN = (new LockManagerOdmgFactory()).createNewLockManager(lockManager);
  +        }
  +        catch (Exception e)
  +        {
  +            throw new OJBRuntimeException("Unexpected failure while start LockManager",
e);
  +        }
  +    }
  +
  +    /**
  +     * Get a {@link org.apache.ojb.odmg.locking.LockManager} instance. The implementation
class is
  +     * configured in the OJB properties file.
  +     */
  +    public static org.apache.ojb.odmg.locking.LockManager getLockManager()
  +    {
  +        return LOCKMAN;
  +    }
  +
  +    /**
  +     * Factory to create {@link org.apache.ojb.odmg.locking.LockManager} instances.
  +     */
  +    private static class LockManagerOdmgFactory extends ConfigurableFactory
  +    {
  +        protected String getConfigurationKey()
  +        {
  +            return "OdmgLockManagerClass";
  +        }
  +
  +        org.apache.ojb.odmg.locking.LockManager createNewLockManager(LockManager manager)
  +        {
  +            return (org.apache.ojb.odmg.locking.LockManager) this.createNewInstance(
  +                    LockManager.class, manager);
  +        }
  +    }
  +
  +    /**
  +     * Factory to create {@link org.apache.ojb.broker.locking.LockMap} instances
  +     */
  +    private static class LockMapFactory extends ConfigurableFactory
  +    {
  +        protected String getConfigurationKey()
  +        {
  +            return "LockMapClass";
  +        }
  +
  +        LockMap createNewLockMap()
  +        {
  +            return (LockMap) this.createNewInstance();
  +        }
  +    }
  +
  +    /**
  +     * Factory to create kernel {@link org.apache.ojb.broker.locking.LockManager} instances.
  +     */
  +    private static class LockManagerKernelFactory extends ConfigurableFactory
  +    {
  +        protected String getConfigurationKey()
  +        {
  +            return "LockManagerClass";
  +        }
  +
  +        LockManager createNewLockManager(LockStrategyManager strategy)
  +        {
  +            return (LockManager) this.createNewInstance(LockStrategyManager.class, strategy);
  +        }
  +    }
  +}
  
  
  
  No                   revision
  
  Index: LockManagerFactory.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/locking/LockManagerFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- LockManagerFactory.java	5 Apr 2004 12:16:23 -0000	1.5
  +++ LockManagerFactory.java	18 Sep 2004 13:04:02 -0000	1.5.2.1
  @@ -1 +1,109 @@
  -package org.apache.ojb.odmg.locking;

/* Copyright 2002-2004 The Apache Software Foundation
*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this
file except in compliance with the License.
 * You may obtain a copy of the License at
 *
*     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or
agreed to in writing, software
 * distributed under the License is distributed on an "AS IS"
BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See
the License for the specific language governing permissions and
 * limitations under the License.
*/

import org.apache.ojb.broker.OJBRuntimeException;
import org.apache.ojb.broker.PersistenceBrokerFactory;
import
org.apache.ojb.broker.util.ClassHelper;

/**
 * This factory class creates LockManager instances
according
 * to the setting in the OJB properties file.
 */
public class LockManagerFactory
{
   private static LockManager LOCKMAN = null;
    static
    {
        try
        {
    
       LockingConfiguration config = (LockingConfiguration) PersistenceBrokerFactory.getConfigurator().getConfigurationFor(null);
           LOCKMAN = (LockManager) ClassHelper.newInstance(config.getLockManagerClass());
       }
        catch (Exception e)
        {
            throw new OJBRuntimeException("Unexpected
failure while start LockManager", e);
        }
    }

    /**
     * get a lockManager instance.
The implementation class is
     * configured in the OJB properties file.
     */
    public
static LockManager getLockManager()
    {
        return LOCKMAN;
    }
}
  +package org.apache.ojb.odmg.locking;
  +
  +/* Copyright 2002-2004 The Apache Software Foundation
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *     http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
  +
  +import org.apache.ojb.broker.OJBRuntimeException;
  +import org.apache.ojb.broker.locking.LockManager;
  +import org.apache.ojb.broker.locking.LockMap;
  +import org.apache.ojb.broker.locking.LockStrategyManager;
  +import org.apache.ojb.broker.util.factory.ConfigurableFactory;
  +
  +/**
  + * This factory class creates LockManager instances according
  + * to the setting in the OJB properties file.
  + */
  +public class LockManagerFactory
  +{
  +    private static org.apache.ojb.odmg.locking.LockManager LOCKMAN = null;
  +    static
  +    {
  +        try
  +        {
  +            // create kernel LockMap instance
  +            org.apache.ojb.broker.locking.LockMap lockMap =
  +                    (new LockMapFactory()).createNewLockMap();
  +            // create the kernel LockStrategyManager instance
  +            org.apache.ojb.broker.locking.LockStrategyManager ls = new LockStrategyManager(lockMap);
  +            // create the kernel LockManager
  +            org.apache.ojb.broker.locking.LockManager lockManager =
  +                    (new LockManagerKernelFactory()).createNewLockManager(ls);
  +            // Now create the ODMG level LockManager
  +            LOCKMAN = (new LockManagerOdmgFactory()).createNewLockManager(lockManager);
  +        }
  +        catch (Exception e)
  +        {
  +            throw new OJBRuntimeException("Unexpected failure while start LockManager",
e);
  +        }
  +    }
  +
  +    /**
  +     * Get a {@link org.apache.ojb.odmg.locking.LockManager} instance. The implementation
class is
  +     * configured in the OJB properties file.
  +     */
  +    public static org.apache.ojb.odmg.locking.LockManager getLockManager()
  +    {
  +        return LOCKMAN;
  +    }
  +
  +    /**
  +     * Factory to create {@link org.apache.ojb.odmg.locking.LockManager} instances.
  +     */
  +    private static class LockManagerOdmgFactory extends ConfigurableFactory
  +    {
  +        protected String getConfigurationKey()
  +        {
  +            return "OdmgLockManagerClass";
  +        }
  +
  +        org.apache.ojb.odmg.locking.LockManager createNewLockManager(LockManager manager)
  +        {
  +            return (org.apache.ojb.odmg.locking.LockManager) this.createNewInstance(
  +                    LockManager.class, manager);
  +        }
  +    }
  +
  +    /**
  +     * Factory to create {@link org.apache.ojb.broker.locking.LockMap} instances
  +     */
  +    private static class LockMapFactory extends ConfigurableFactory
  +    {
  +        protected String getConfigurationKey()
  +        {
  +            return "LockMapClass";
  +        }
  +
  +        LockMap createNewLockMap()
  +        {
  +            return (LockMap) this.createNewInstance();
  +        }
  +    }
  +
  +    /**
  +     * Factory to create kernel {@link org.apache.ojb.broker.locking.LockManager} instances.
  +     */
  +    private static class LockManagerKernelFactory extends ConfigurableFactory
  +    {
  +        protected String getConfigurationKey()
  +        {
  +            return "LockManagerClass";
  +        }
  +
  +        LockManager createNewLockManager(LockStrategyManager strategy)
  +        {
  +            return (LockManager) this.createNewInstance(LockStrategyManager.class, strategy);
  +        }
  +    }
  +}
  
  
  
  1.1.2.1   +110 -0    db-ojb/src/java/org/apache/ojb/odmg/locking/Attic/LockManagerOdmgImpl.java
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message