Example usage for java.util Vector removeElement

List of usage examples for java.util Vector removeElement

Introduction

In this page you can find the example usage for java.util Vector removeElement.

Prototype

public synchronized boolean removeElement(Object obj) 

Source Link

Document

Removes the first (lowest-indexed) occurrence of the argument from this vector.

Usage

From source file:org.apache.slide.store.ExtendedStore.java

public void revokePermission(Uri uri, NodePermission permission) throws ServiceAccessException {
    super.revokePermission(uri, permission);
    if (securityStore.cacheResults()) {
        enlist(this);
        try {/* ww  w  .  ja v  a  2 s.com*/
            Vector permissionsVector = fillPermissionsCache(uri);
            // operate on a copy
            Vector tempPermissions = (Vector) permissionsVector.clone();
            tempPermissions.removeElement(permission);
            permissionsCache.put(uri.toString(), tempPermissions);
        } finally {
            delist(this);
        }

    }
}

From source file:org.apache.slide.store.ExtendedStore.java

public void renewLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException {
    super.renewLock(uri, lock);
    if (lockStore.cacheResults()) {
        enlist(this);
        try {/*from ww  w  .  j a v  a  2  s. c o  m*/
            Object value = locksCache.get(uri.toString());
            Vector locksVector = null;
            if (value != null) {
                locksVector = new Vector((Vector) value);
                boolean wasPresent = locksVector.removeElement(lock);
                if (!wasPresent) {
                    throw new LockTokenNotFoundException(lock);
                }
                locksVector.addElement(lock.cloneObject());
                locksCache.put(uri.toString(), locksVector);
            }
        } finally {
            delist(this);
        }
    }
}

From source file:org.apache.slide.store.ExtendedStore.java

public void removeLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException {
    super.removeLock(uri, lock);
    if (lockStore.cacheResults()) {
        enlist(this);
        try {/*from  w  w  w  . j a va2  s .  c o m*/
            Object value = locksCache.get(uri.toString());
            Vector locksVector = null;
            if (value != null) {
                locksVector = new Vector((Vector) value);
                boolean wasPresent = locksVector.removeElement(lock);
                if (!wasPresent) {
                    throw new LockTokenNotFoundException(lock);
                }
                locksCache.put(uri.toString(), locksVector);
            }
        } finally {
            delist(this);
        }
    }
}

From source file:org.apache.slide.store.ExtendedStore.java

public void killLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException {
    super.killLock(uri, lock);
    if (lockStore.cacheResults()) {
        enlist(this);
        try {/*from w w w  .java2s  .  c  o  m*/
            Object value = locksCache.get(uri.toString());
            Vector locksVector = null;
            if (value != null) {
                locksVector = new Vector((Vector) value);
                boolean wasPresent = locksVector.removeElement(lock);
                if (!wasPresent) {
                    throw new LockTokenNotFoundException(lock);
                }
                locksCache.put(uri.toString(), locksVector);
            }
        } finally {
            delist(this);
        }
    }
}

From source file:org.kepler.gui.state.StateChangeMonitor.java

/**
 * This method is called by objects to remove a listener for changes in the
 * application state. Any change in the state will trigger notification.
 * //from  w w  w.  ja  v  a 2  s.c  o m
 * @param stateChange
 *            the name of the state change for which the listener should be
 *            removed
 * @param listener
 *            a reference to the object to be removed
 */
public void removeStateChangeListener(String stateChange, StateChangeListener listener) {
    Vector currentStateListeners = null;
    if (listeners.containsKey(stateChange)) {
        currentStateListeners = (Vector) listeners.get(stateChange);
        log.debug("Removing listener: " + listener.toString());
        currentStateListeners.removeElement(listener);
        if (currentStateListeners.size() == 0) {
            listeners.remove(stateChange);
        }
    }
}