Package org.apache.ojb.broker

Examples of org.apache.ojb.broker.Identity


     * checks if there is a readlock for transaction tx on object obj.
     * Returns true if so, else false.
     */
    public synchronized boolean checkRead(TransactionImpl tx, Object obj)
    {
        if (log.isDebugEnabled()) log.debug("LM.checkRead(tx-" + tx.getGUID() + ", " + new Identity(obj, tx.getBroker()).toString() + ")");
        LockStrategy lockStrategy = LockStrategyFactory.getStrategyFor(obj);
        return lockStrategy.checkRead(tx, obj);
    }
View Full Code Here


     * checks if there is a writelock for transaction tx on object obj.
     * Returns true if so, else false.
     */
    public synchronized boolean checkWrite(TransactionImpl tx, Object obj)
    {
        if (log.isDebugEnabled()) log.debug("LM.checkWrite(tx-" + tx.getGUID() + ", " + new Identity(obj, tx.getBroker()).toString() + ")");
        LockStrategy lockStrategy = LockStrategyFactory.getStrategyFor(obj);
        return lockStrategy.checkWrite(tx, obj);
    }
View Full Code Here

     */
    public void afterMaterialization(IndirectionHandler handler, Object materializedObject)
    {
        try
        {
            Identity oid = handler.getIdentity();
            if (log.isDebugEnabled())
            log.debug("deferred registration: " + oid);
            if(!isOpen())
            {
                log.error("Proxy object materialization outside of a running tx, obj=" + oid);
View Full Code Here

                catch(Exception e)
                {e.printStackTrace();}
            }
            else
            {
                Identity oid = getBroker().serviceIdentity().buildIdentity(o);
                ClassDescriptor cld = getBroker().getClassDescriptor(ProxyHelper.getRealClass(o));
                RuntimeObject rt = new RuntimeObject(o, oid, cld, false, ProxyHelper.isProxy(o));
                lockAndRegister(rt, Transaction.READ, isImplicitLocking(), getRegistrationList());
            }
        }
View Full Code Here

     * If now writer exists, null is returned.
     */
    public LockEntry getWriter(Object obj)
    {
        PersistenceBroker broker = getBroker();
        Identity oid = new Identity(obj, broker);
        return getWriter(oid);
    }
View Full Code Here

     * If no LockEntries could be found an empty Vector is returned.
     */
    public Collection getReaders(Object obj)
    {
      checkTimedOutLocks();
        Identity oid = new Identity(obj,getBroker());
        return getReaders(oid);
    }
View Full Code Here

     */
    public boolean addReader(TransactionImpl tx, Object obj)
    {
        checkTimedOutLocks();

        Identity oid = new Identity(obj,getBroker());
        LockEntry reader = new LockEntry(oid.toString(),
                tx.getGUID(),
                System.currentTimeMillis(),
                LockStrategyFactory.getIsolationLevel(obj),
                LockEntry.LOCK_READ);

View Full Code Here

     */
    public void removeReader(TransactionImpl tx, Object obj)
    {
        checkTimedOutLocks();

        Identity oid = new Identity(obj, getBroker());
        String oidString = oid.toString();
        String txGuid = tx.getGUID();
        removeReaderInternal(oidString, txGuid);
    }
View Full Code Here

     */
    public boolean setWriter(TransactionImpl tx, Object obj)
    {
        checkTimedOutLocks();

        Identity oid = new Identity(obj, tx.getBroker());
        LockEntry writer = new LockEntry(oid.toString(),
                tx.getGUID(),
                System.currentTimeMillis(),
                LockStrategyFactory.getIsolationLevel(obj),
                LockEntry.LOCK_WRITE);
        String oidString = oid.toString();
        setWriterInternal(writer, oidString);
        return true;
    }
View Full Code Here

     */
    public boolean hasReadLock(TransactionImpl tx, Object obj)
    {
        checkTimedOutLocks();

        Identity oid = new Identity(obj,getBroker());
        String oidString = oid.toString();
    String txGuid = tx.getGUID();
        return hasReadLockInternal(oidString, txGuid);
    }
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.Identity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.