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

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


    public void remove(Object key)
    {
        Sync sync = this.lock.writeLock();
        try
        {
            sync.acquire();
            try
            {
                this.doRemove(key);
                m_sizeInstrument.setValue( doGetSize() );
            }
View Full Code Here


    public boolean containsKey(Object key)
    {
        Sync sync = this.lock.readLock();
        try
        {
            sync.acquire();
            try
            {
                return this.doContainsKey(key);
            }
            finally
View Full Code Here

    public Enumeration keys()
    {
        Sync sync = this.lock.readLock();
        try
        {
            sync.acquire();
            try
            {
                return this.doGetKeys();
            }
            finally
View Full Code Here

    public int size()
    {
        Sync sync = this.lock.readLock();
        try
        {
            sync.acquire();
            try
            {
                return this.doGetSize();
            }
            finally
View Full Code Here

    throws IOException, ClassNotFoundException
    {
        Sync sync = this.lock.writeLock();
        try
        {
            sync.acquire();
            try
            {
                final File file = this.fileFromKey(key);
                if (file != null) {
                    return this.deserializeObject(file);
View Full Code Here

                this.locks.put(file.getAbsolutePath(), lock);
            }
        }
        Sync sync = lock.writeLock();
        try {
            sync.acquire();
            try {
                OutputStream os = new FileOutputStream(file);
                os.write(content);
                os.flush();
                os.close();
View Full Code Here

                this.locks.put(file.getAbsolutePath(), lock);
            }
        }
        Sync sync = lock.readLock();
        try {
            sync.acquire();
            try {
                String content = IOUtils.deserializeString(file);
                return content.getBytes();
            } catch (IOException io) {
                this.getLogger().warn("Exception during reading of content from " + file, io);
View Full Code Here

                this.locks.put(file.getAbsolutePath(), lock);
            }
        }
        Sync sync = lock.writeLock();
        try {
            sync.acquire();
            try {
                OutputStream os = new FileOutputStream(file);
                os.write(content);
                os.flush();
                os.close();
View Full Code Here

                this.locks.put(file.getAbsolutePath(), lock);
            }
        }
        Sync sync = lock.readLock();
        try {
            sync.acquire();
            try {
                String content = IOUtils.deserializeString(file);
                return content.getBytes();
            } catch (IOException io) {
                this.getLogger().warn("Exception during reading of content from " + file, io);
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.