jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/mimepull/WeakDataFile.java
author mkos
Mon, 31 Mar 2014 10:43:20 +0200
changeset 23782 953bfc3fbe31
parent 22679 d785acd84a14
permissions -rw-r--r--
8036030: Update JAX-WS RI integration to latest version Summary: JAX-WS RI upgrade from 2.2.9-b130926.1035 to 2.2.10-b140228.1436; Reviewed-by: chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     1
/*
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
     2
 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     4
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    10
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    15
 * accompanied this code).
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    16
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    20
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    23
 * questions.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    24
 */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    25
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    26
package com.sun.xml.internal.org.jvnet.mimepull;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    27
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    28
import java.util.concurrent.TimeUnit;
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    29
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    30
import java.io.File;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    31
import java.io.IOException;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    32
import java.io.RandomAccessFile;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    33
import java.lang.ref.ReferenceQueue;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    34
import java.lang.ref.WeakReference;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    35
import java.util.ArrayList;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    36
import java.util.List;
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    37
import java.util.concurrent.ScheduledExecutorService;
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
    38
import java.util.logging.Level;
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    39
import java.util.logging.Logger;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    40
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    41
/**
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    42
 * Removing files based on this
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    43
 * <a href="http://java.sun.com/developer/technicalArticles/javase/finalization/">article</a>
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    44
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    45
 * @author Jitendra Kotamraju
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    46
 */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    47
final class WeakDataFile extends WeakReference<DataFile> {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    48
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    49
    private static final Logger LOGGER = Logger.getLogger(WeakDataFile.class.getName());
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    50
    private static int TIMEOUT = 10; //milliseconds
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    51
    //private static final int MAX_ITERATIONS = 2;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    52
    private static ReferenceQueue<DataFile> refQueue = new ReferenceQueue<DataFile>();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    53
    private static List<WeakDataFile> refList = new ArrayList<WeakDataFile>();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    54
    private final File file;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    55
    private final RandomAccessFile raf;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    56
    private static boolean hasCleanUpExecutor = false;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    57
    static {
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    58
        int delay = 10;
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    59
        try {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    60
                delay = Integer.getInteger("com.sun.xml.internal.org.jvnet.mimepull.delay", 10);
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    61
        } catch (SecurityException se) {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    62
            if (LOGGER.isLoggable(Level.CONFIG)) {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    63
                LOGGER.log(Level.CONFIG, "Cannot read ''{0}'' property, using defaults.",
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    64
                        new Object[] {"com.sun.xml.internal.org.jvnet.mimepull.delay"});
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    65
            }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    66
        }
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    67
        CleanUpExecutorFactory executorFactory = CleanUpExecutorFactory.newInstance();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    68
        if (executorFactory!=null) {
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
    69
            if (LOGGER.isLoggable(Level.FINE)) {
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
    70
                LOGGER.log(Level.FINE, "Initializing clean up executor for MIMEPULL: {0}", executorFactory.getClass().getName());
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
    71
            }
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    72
            ScheduledExecutorService scheduler = executorFactory.getScheduledExecutorService();
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    73
            scheduler.scheduleWithFixedDelay(new CleanupRunnable(), delay, delay, TimeUnit.SECONDS);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    74
            hasCleanUpExecutor = true;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    75
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    76
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    77
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    78
    WeakDataFile(DataFile df, File file) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    79
        super(df, refQueue);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    80
        refList.add(this);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    81
        this.file = file;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    82
        try {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    83
            raf = new RandomAccessFile(file, "rw");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    84
        } catch(IOException ioe) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    85
            throw new MIMEParsingException(ioe);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    86
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    87
        if (!hasCleanUpExecutor) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    88
            drainRefQueueBounded();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    89
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    90
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    91
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    92
    synchronized void read(long pointer, byte[] buf, int offset, int length ) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    93
        try {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    94
            raf.seek(pointer);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    95
            raf.readFully(buf, offset, length);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    96
        } catch(IOException ioe) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    97
            throw new MIMEParsingException(ioe);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    98
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    99
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   100
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   101
    synchronized long writeTo(long pointer, byte[] data, int offset, int length) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   102
        try {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   103
            raf.seek(pointer);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   104
            raf.write(data, offset, length);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   105
            return raf.getFilePointer();    // Update pointer for next write
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   106
        } catch(IOException ioe) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   107
            throw new MIMEParsingException(ioe);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   108
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   109
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   110
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   111
    void close() {
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   112
        if (LOGGER.isLoggable(Level.FINE)) {
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   113
            LOGGER.log(Level.FINE, "Deleting file = {0}", file.getName());
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   114
        }
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   115
        refList.remove(this);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   116
        try {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   117
            raf.close();
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   118
            boolean deleted = file.delete();
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   119
            if (!deleted) {
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   120
                if (LOGGER.isLoggable(Level.INFO)) {
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   121
                    LOGGER.log(Level.INFO, "File {0} was not deleted", file.getAbsolutePath());
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   122
                }
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   123
            }
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   124
        } catch(IOException ioe) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   125
            throw new MIMEParsingException(ioe);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   126
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   127
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   128
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   129
    void renameTo(File f) {
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   130
        if (LOGGER.isLoggable(Level.FINE)) {
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   131
            LOGGER.log(Level.FINE, "Moving file={0} to={1}", new Object[]{file, f});
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   132
        }
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   133
        refList.remove(this);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   134
        try {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   135
            raf.close();
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   136
            boolean renamed = file.renameTo(f);
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   137
            if (!renamed) {
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   138
                if (LOGGER.isLoggable(Level.INFO)) {
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   139
                    LOGGER.log(Level.INFO, "File {0} was not moved to {1}", new Object[] {file.getAbsolutePath(), f.getAbsolutePath()});
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   140
                }
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   141
            }
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   142
        } catch(IOException ioe) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   143
            throw new MIMEParsingException(ioe);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   144
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   145
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   146
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   147
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   148
    static void drainRefQueueBounded() {
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   149
        WeakDataFile weak;
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   150
        while (( weak = (WeakDataFile) refQueue.poll()) != null ) {
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   151
            if (LOGGER.isLoggable(Level.FINE)) {
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   152
                LOGGER.log(Level.FINE, "Cleaning file = {0} from reference queue.", weak.file);
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
   153
            }
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   154
            weak.close();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   155
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   156
    }
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   157
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   158
private static class CleanupRunnable implements Runnable {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   159
    @Override
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   160
    public void run() {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   161
        try {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   162
            if (LOGGER.isLoggable(Level.FINE)) {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   163
                LOGGER.log(Level.FINE, "Running cleanup task");
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   164
            }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   165
                WeakDataFile weak = (WeakDataFile) refQueue.remove(TIMEOUT);
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   166
            while (weak != null) {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   167
                if (LOGGER.isLoggable(Level.FINE)) {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   168
                    LOGGER.log(Level.FINE, "Cleaning file = {0} from reference queue.", weak.file);
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   169
                }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   170
                weak.close();
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   171
                weak = (WeakDataFile) refQueue.remove(TIMEOUT);
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   172
            }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   173
        } catch (InterruptedException e) {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   174
        }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   175
    }
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   176
}
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   177
}