Search in sources :

Example 6 with DBAServerLockManager

use of org.jkiss.dbeaver.model.admin.locks.DBAServerLockManager in project dbeaver by dbeaver.

the class PostgreLockEditor method createLockViewer.

@SuppressWarnings("unchecked")
@Override
protected LockManagerViewer createLockViewer(DBCExecutionContext executionContext, Composite parent) {
    DBAServerLockManager<DBAServerLock, DBAServerLockItem> lockManager = (DBAServerLockManager) new PostgreLockManager((PostgreDataSource) 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 PostgreLock pLock = (PostgreLock) lock;
                super.refreshDetail(new HashMap<String, Object>() {

                    {
                        put(PostgreLockManager.pidHold, pLock.getHold_pid());
                        put(PostgreLockManager.pidWait, pLock.getWait_pid());
                    }
                });
            }
        }
    };
}
Also used : DBAServerLockItem(org.jkiss.dbeaver.model.admin.locks.DBAServerLockItem) PostgreDataSource(org.jkiss.dbeaver.ext.postgresql.model.PostgreDataSource) PostgreLockManager(org.jkiss.dbeaver.ext.postgresql.model.lock.PostgreLockManager) DBAServerLock(org.jkiss.dbeaver.model.admin.locks.DBAServerLock) PostgreLock(org.jkiss.dbeaver.ext.postgresql.model.lock.PostgreLock) DBAServerLockManager(org.jkiss.dbeaver.model.admin.locks.DBAServerLockManager) LockManagerViewer(org.jkiss.dbeaver.ext.ui.locks.manage.LockManagerViewer) IContributionManager(org.eclipse.jface.action.IContributionManager) Separator(org.eclipse.jface.action.Separator)

Example 7 with DBAServerLockManager

use of org.jkiss.dbeaver.model.admin.locks.DBAServerLockManager in project dbeaver by dbeaver.

the class ExasolLockEditor method createLockViewer.

@SuppressWarnings("unchecked")
@Override
protected LockManagerViewer createLockViewer(DBCExecutionContext executionContext, Composite parent) {
    @SuppressWarnings("rawtypes") DBAServerLockManager<DBAServerLock, DBAServerLockItem> lockManager = (DBAServerLockManager) new ExasolLockManager((ExasolDataSource) executionContext.getDataSource());
    return new LockManagerViewer(this, parent, lockManager) {

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

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

                    {
                        put(sidHold, BigInteger.valueOf(pLock.getHold_sid()));
                        put(sidWait, BigInteger.valueOf(pLock.getWait_sid().longValue()));
                    }
                });
            }
        }
    };
}
Also used : DBAServerLockItem(org.jkiss.dbeaver.model.admin.locks.DBAServerLockItem) ExasolLockManager(org.jkiss.dbeaver.ext.exasol.model.lock.ExasolLockManager) ExasolLock(org.jkiss.dbeaver.ext.exasol.model.lock.ExasolLock) DBAServerLock(org.jkiss.dbeaver.model.admin.locks.DBAServerLock) DBAServerLockManager(org.jkiss.dbeaver.model.admin.locks.DBAServerLockManager) ExasolDataSource(org.jkiss.dbeaver.ext.exasol.model.ExasolDataSource) LockManagerViewer(org.jkiss.dbeaver.ext.ui.locks.manage.LockManagerViewer) IContributionManager(org.eclipse.jface.action.IContributionManager) Separator(org.eclipse.jface.action.Separator)

Example 8 with DBAServerLockManager

use of org.jkiss.dbeaver.model.admin.locks.DBAServerLockManager 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 9 with DBAServerLockManager

use of org.jkiss.dbeaver.model.admin.locks.DBAServerLockManager 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)9 Separator (org.eclipse.jface.action.Separator)9 LockManagerViewer (org.jkiss.dbeaver.ext.ui.locks.manage.LockManagerViewer)9 DBAServerLock (org.jkiss.dbeaver.model.admin.locks.DBAServerLock)9 DBAServerLockItem (org.jkiss.dbeaver.model.admin.locks.DBAServerLockItem)9 DBAServerLockManager (org.jkiss.dbeaver.model.admin.locks.DBAServerLockManager)9 ExasolDataSource (org.jkiss.dbeaver.ext.exasol.model.ExasolDataSource)3 ExasolLock (org.jkiss.dbeaver.ext.exasol.model.lock.ExasolLock)3 ExasolLockManager (org.jkiss.dbeaver.ext.exasol.model.lock.ExasolLockManager)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 PostgreDataSource (org.jkiss.dbeaver.ext.postgresql.model.PostgreDataSource)3 PostgreLock (org.jkiss.dbeaver.ext.postgresql.model.lock.PostgreLock)3 PostgreLockManager (org.jkiss.dbeaver.ext.postgresql.model.lock.PostgreLockManager)3