Search in sources :

Example 1 with PostgreLock

use of org.jkiss.dbeaver.ext.postgresql.model.lock.PostgreLock 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(pidHold, pLock.getHold_pid());
                        put(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 2 with PostgreLock

use of org.jkiss.dbeaver.ext.postgresql.model.lock.PostgreLock in project dbeaver by serge-rider.

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 3 with PostgreLock

use of org.jkiss.dbeaver.ext.postgresql.model.lock.PostgreLock 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)

Aggregations

IContributionManager (org.eclipse.jface.action.IContributionManager)3 Separator (org.eclipse.jface.action.Separator)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 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