Search in sources :

Example 1 with OracleLock

use of org.jkiss.dbeaver.ext.oracle.model.lock.OracleLock in project dbeaver by dbeaver.

the class OracleLockEditor method createLockViewer.

@Override
protected LockManagerViewer createLockViewer(DBCExecutionContext executionContext, Composite parent) {
    DBAServerLockManager<DBAServerLock, DBAServerLockItem> lockManager = (DBAServerLockManager) new OracleLockManager((OracleDataSource) executionContext.getDataSource());
    return new LockManagerViewer(this, parent, lockManager) {

        @Override
        protected void contributeToToolbar(DBAServerLockManager<DBAServerLock, DBAServerLockItem> sessionManager, IContributionManager contributionManager) {
            contributionManager.add(new Separator());
        }

        @Override
        protected void onLockSelect(final DBAServerLock lock) {
            super.onLockSelect(lock);
            if (lock != null) {
                final OracleLock pLock = (OracleLock) lock;
                super.refreshDetail(new HashMap<String, Object>() {

                    {
                        put(sidHold, pLock.getHold_sid());
                        put(sidWait, pLock.getWait_sid());
                    }
                });
            }
        }
    };
}
Also used : DBAServerLockItem(org.jkiss.dbeaver.model.admin.locks.DBAServerLockItem) OracleDataSource(org.jkiss.dbeaver.ext.oracle.model.OracleDataSource) OracleLock(org.jkiss.dbeaver.ext.oracle.model.lock.OracleLock) DBAServerLock(org.jkiss.dbeaver.model.admin.locks.DBAServerLock) DBAServerLockManager(org.jkiss.dbeaver.model.admin.locks.DBAServerLockManager) OracleLockManager(org.jkiss.dbeaver.ext.oracle.model.lock.OracleLockManager) LockManagerViewer(org.jkiss.dbeaver.ext.ui.locks.manage.LockManagerViewer) IContributionManager(org.eclipse.jface.action.IContributionManager) Separator(org.eclipse.jface.action.Separator)

Example 2 with OracleLock

use of org.jkiss.dbeaver.ext.oracle.model.lock.OracleLock in project dbeaver by serge-rider.

the class OracleLockEditor method createLockViewer.

@Override
protected LockManagerViewer createLockViewer(DBCExecutionContext executionContext, Composite parent) {
    DBAServerLockManager<DBAServerLock, DBAServerLockItem> lockManager = (DBAServerLockManager) new OracleLockManager((OracleDataSource) executionContext.getDataSource());
    return new LockManagerViewer(this, parent, lockManager) {

        @Override
        protected void contributeToToolbar(DBAServerLockManager<DBAServerLock, DBAServerLockItem> sessionManager, IContributionManager contributionManager) {
            contributionManager.add(new Separator());
        }

        @Override
        protected void onLockSelect(final DBAServerLock lock) {
            super.onLockSelect(lock);
            if (lock != null) {
                final OracleLock pLock = (OracleLock) lock;
                super.refreshDetail(new HashMap<String, Object>() {

                    {
                        put(OracleLockManager.sidHold, pLock.getHold_sid());
                        put(OracleLockManager.sidWait, pLock.getWait_sid());
                    }
                });
            }
        }
    };
}
Also used : DBAServerLockItem(org.jkiss.dbeaver.model.admin.locks.DBAServerLockItem) OracleDataSource(org.jkiss.dbeaver.ext.oracle.model.OracleDataSource) OracleLock(org.jkiss.dbeaver.ext.oracle.model.lock.OracleLock) DBAServerLock(org.jkiss.dbeaver.model.admin.locks.DBAServerLock) DBAServerLockManager(org.jkiss.dbeaver.model.admin.locks.DBAServerLockManager) OracleLockManager(org.jkiss.dbeaver.ext.oracle.model.lock.OracleLockManager) LockManagerViewer(org.jkiss.dbeaver.ext.ui.locks.manage.LockManagerViewer) IContributionManager(org.eclipse.jface.action.IContributionManager) Separator(org.eclipse.jface.action.Separator)

Example 3 with OracleLock

use of org.jkiss.dbeaver.ext.oracle.model.lock.OracleLock in project dbeaver by dbeaver.

the class OracleLockEditor method createLockViewer.

@Override
protected LockManagerViewer createLockViewer(DBCExecutionContext executionContext, Composite parent) {
    DBAServerLockManager<DBAServerLock, DBAServerLockItem> lockManager = (DBAServerLockManager) new OracleLockManager((OracleDataSource) executionContext.getDataSource());
    return new LockManagerViewer(this, parent, lockManager) {

        @Override
        protected void contributeToToolbar(DBAServerLockManager<DBAServerLock, DBAServerLockItem> sessionManager, IContributionManager contributionManager) {
            contributionManager.add(new Separator());
        }

        @Override
        protected void onLockSelect(final DBAServerLock lock) {
            super.onLockSelect(lock);
            if (lock != null) {
                final OracleLock pLock = (OracleLock) lock;
                super.refreshDetail(new HashMap<String, Object>() {

                    {
                        put(OracleLockManager.sidHold, pLock.getHold_sid());
                        put(OracleLockManager.sidWait, pLock.getWait_sid());
                    }
                });
            }
        }
    };
}
Also used : DBAServerLockItem(org.jkiss.dbeaver.model.admin.locks.DBAServerLockItem) OracleDataSource(org.jkiss.dbeaver.ext.oracle.model.OracleDataSource) OracleLock(org.jkiss.dbeaver.ext.oracle.model.lock.OracleLock) DBAServerLock(org.jkiss.dbeaver.model.admin.locks.DBAServerLock) DBAServerLockManager(org.jkiss.dbeaver.model.admin.locks.DBAServerLockManager) OracleLockManager(org.jkiss.dbeaver.ext.oracle.model.lock.OracleLockManager) LockManagerViewer(org.jkiss.dbeaver.ext.ui.locks.manage.LockManagerViewer) IContributionManager(org.eclipse.jface.action.IContributionManager) Separator(org.eclipse.jface.action.Separator)

Aggregations

IContributionManager (org.eclipse.jface.action.IContributionManager)3 Separator (org.eclipse.jface.action.Separator)3 OracleDataSource (org.jkiss.dbeaver.ext.oracle.model.OracleDataSource)3 OracleLock (org.jkiss.dbeaver.ext.oracle.model.lock.OracleLock)3 OracleLockManager (org.jkiss.dbeaver.ext.oracle.model.lock.OracleLockManager)3 LockManagerViewer (org.jkiss.dbeaver.ext.ui.locks.manage.LockManagerViewer)3 DBAServerLock (org.jkiss.dbeaver.model.admin.locks.DBAServerLock)3 DBAServerLockItem (org.jkiss.dbeaver.model.admin.locks.DBAServerLockItem)3 DBAServerLockManager (org.jkiss.dbeaver.model.admin.locks.DBAServerLockManager)3