Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.Sync.acquire()


        Sync writeLock = s_lock.writeLock();
        if (s_classLoaderSystemDefinitions.containsKey(loader)) {
            return;
        }
        try {
            writeLock.acquire();
            // recheck
            if (s_classLoaderSystemDefinitions.containsKey(loader)) {
                return;
            }
View Full Code Here


     * @param definitions SystemDefinitions list
     */
    public static void deployDefinitions(final ClassLoader loader, final Set definitions) {
        Sync lock = s_lock.writeLock();
        try {
            lock.acquire();

            // make sure the classloader is known
            registerClassLoader(loader);

            //unchanged: s_classLoaderDefinitionLocations
View Full Code Here

     * @return SystemDefinition or null if no such defined definition
     */
    public static SystemDefinition getDefinitionFor(final ClassLoader loader, final String uuid) {
        Sync lock = s_lock.readLock();
        try {
            lock.acquire();
            for (Iterator defs = getDefinitionsFor(loader).iterator(); defs.hasNext();) {
                SystemDefinition def = (SystemDefinition) defs.next();
                if (def.getUuid().equals(uuid)) {
                    return def;
                }
View Full Code Here

     * @return SystemDefinitions list
     */
    public static Set getDefinitionsFor(final ClassLoader loader) {
        Sync lock = s_lock.readLock();
        try {
            lock.acquire();
            return getHierarchicalDefinitionsFor(loader);
        } catch (InterruptedException e) {
            throw new WrappedRuntimeException(e);
        } finally {
            lock.release();
View Full Code Here

     * @return SystemDefinitions list
     */
    public static Set getDefinitionsAt(final ClassLoader loader) {
        Sync lock = s_lock.readLock();
        try {
            lock.acquire();
            // make sure the classloader is registered
            registerClassLoader(loader);
            return (Set) s_classLoaderSystemDefinitions.get(loader);
        } catch (InterruptedException e) {
            throw new WrappedRuntimeException(e);
View Full Code Here

        // note: read Lock is already acquired at this stage
        Sync writeLock = s_lock.writeLock();
        if (!s_classLoaderHierarchicalSystemDefinitions.containsKey(loader)) {
            // upgrade lock
            try {
                writeLock.acquire();
                // recheck [see JavaDoc for read / write lock
                if (!s_classLoaderHierarchicalSystemDefinitions.containsKey(loader)) {
                    // make sure the classloader is known
                    registerClassLoader(loader);
View Full Code Here

    {
        Object value = null;
        Sync sync = this.lock.readLock();
        try
        {
            sync.acquire();
            try
            {
                value = this.doGet(key);
            }
            finally
View Full Code Here

    throws IOException
    {
        Sync sync = this.lock.writeLock();
        try
        {
            sync.acquire();

            try
            {
                this.doStore(key, value);
                m_sizeInstrument.setValue( doGetSize() );
View Full Code Here

    public void free()
    {
        Sync sync = this.lock.writeLock();
        try
        {
            sync.acquire();

            try
            {
                this.doFree();
                m_sizeInstrument.setValue( doGetSize() );
View Full Code Here

        }

        Sync sync = this.lock.writeLock();
        try
        {
            sync.acquire();
            try
            {
                this.doClear();
                m_sizeInstrument.setValue( 0 );
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.