sun.rmi.runtime.NewThreadAction Java Examples

The following examples show how to use sun.rmi.runtime.NewThreadAction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Activation.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Allow plugging together two pipes at a time, to associate
 * output from an execed process.  This is the only publicly
 * accessible method of this object; this helps ensure that
 * synchronization will not be an issue in the annotation
 * process.
 *
 * @param in input stream from which pipe input comes
 * @param out output stream to which log messages will be sent
 * @param in1 input stream from which pipe input comes
 * @param out1 output stream to which log messages will be sent
 */
static void plugTogetherPair(InputStream in,
                             OutputStream out,
                             InputStream in1,
                             OutputStream out1) {
    Thread inThread = null;
    Thread outThread = null;

    int nExecs = getNumExec();

    /* start RMI threads to read output from child process */
    inThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in, out, "out", nExecs),
                            "out", true));
    outThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in1, out1, "err", nExecs),
                            "err", true));
    inThread.start();
    outThread.start();
}
 
Example #2
Source File: Activation.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Allow plugging together two pipes at a time, to associate
 * output from an execed process.  This is the only publicly
 * accessible method of this object; this helps ensure that
 * synchronization will not be an issue in the annotation
 * process.
 *
 * @param in input stream from which pipe input comes
 * @param out output stream to which log messages will be sent
 * @param in1 input stream from which pipe input comes
 * @param out1 output stream to which log messages will be sent
 */
static void plugTogetherPair(InputStream in,
                             OutputStream out,
                             InputStream in1,
                             OutputStream out1) {
    Thread inThread = null;
    Thread outThread = null;

    int nExecs = getNumExec();

    /* start RMI threads to read output from child process */
    inThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in, out, "out", nExecs),
                            "out", true));
    outThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in1, out1, "err", nExecs),
                            "err", true));
    inThread.start();
    outThread.start();
}
 
Example #3
Source File: ObjectTable.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #4
Source File: ObjectTable.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #5
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Allow plugging together two pipes at a time, to associate
 * output from an execed process.  This is the only publicly
 * accessible method of this object; this helps ensure that
 * synchronization will not be an issue in the annotation
 * process.
 *
 * @param in input stream from which pipe input comes
 * @param out output stream to which log messages will be sent
 * @param in1 input stream from which pipe input comes
 * @param out1 output stream to which log messages will be sent
 */
static void plugTogetherPair(InputStream in,
                             OutputStream out,
                             InputStream in1,
                             OutputStream out1) {
    Thread inThread = null;
    Thread outThread = null;

    int nExecs = getNumExec();

    /* start RMI threads to read output from child process */
    inThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in, out, "out", nExecs),
                            "out", true));
    outThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in1, out1, "err", nExecs),
                            "err", true));
    inThread.start();
    outThread.start();
}
 
Example #6
Source File: Activation.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Allow plugging together two pipes at a time, to associate
 * output from an execed process.  This is the only publicly
 * accessible method of this object; this helps ensure that
 * synchronization will not be an issue in the annotation
 * process.
 *
 * @param in input stream from which pipe input comes
 * @param out output stream to which log messages will be sent
 * @param in1 input stream from which pipe input comes
 * @param out1 output stream to which log messages will be sent
 */
static void plugTogetherPair(InputStream in,
                             OutputStream out,
                             InputStream in1,
                             OutputStream out1) {
    Thread inThread = null;
    Thread outThread = null;

    int nExecs = getNumExec();

    /* start RMI threads to read output from child process */
    inThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in, out, "out", nExecs),
                            "out", true));
    outThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in1, out1, "err", nExecs),
                            "err", true));
    inThread.start();
    outThread.start();
}
 
Example #7
Source File: ObjectTable.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #8
Source File: ObjectTable.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #9
Source File: ObjectTable.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #10
Source File: ObjectTable.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #11
Source File: ObjectTable.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #12
Source File: Activation.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Allow plugging together two pipes at a time, to associate
 * output from an execed process.  This is the only publicly
 * accessible method of this object; this helps ensure that
 * synchronization will not be an issue in the annotation
 * process.
 *
 * @param in input stream from which pipe input comes
 * @param out output stream to which log messages will be sent
 * @param in1 input stream from which pipe input comes
 * @param out1 output stream to which log messages will be sent
 */
static void plugTogetherPair(InputStream in,
                             OutputStream out,
                             InputStream in1,
                             OutputStream out1) {
    Thread inThread = null;
    Thread outThread = null;

    int nExecs = getNumExec();

    /* start RMI threads to read output from child process */
    inThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in, out, "out", nExecs),
                            "out", true));
    outThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in1, out1, "err", nExecs),
                            "err", true));
    inThread.start();
    outThread.start();
}
 
Example #13
Source File: ObjectTable.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #14
Source File: Activation.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Allow plugging together two pipes at a time, to associate
 * output from an execed process.  This is the only publicly
 * accessible method of this object; this helps ensure that
 * synchronization will not be an issue in the annotation
 * process.
 *
 * @param in input stream from which pipe input comes
 * @param out output stream to which log messages will be sent
 * @param in1 input stream from which pipe input comes
 * @param out1 output stream to which log messages will be sent
 */
static void plugTogetherPair(InputStream in,
                             OutputStream out,
                             InputStream in1,
                             OutputStream out1) {
    Thread inThread = null;
    Thread outThread = null;

    int nExecs = getNumExec();

    /* start RMI threads to read output from child process */
    inThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in, out, "out", nExecs),
                            "out", true));
    outThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in1, out1, "err", nExecs),
                            "err", true));
    inThread.start();
    outThread.start();
}
 
Example #15
Source File: Activation.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Allow plugging together two pipes at a time, to associate
 * output from an execed process.  This is the only publicly
 * accessible method of this object; this helps ensure that
 * synchronization will not be an issue in the annotation
 * process.
 *
 * @param in input stream from which pipe input comes
 * @param out output stream to which log messages will be sent
 * @param in1 input stream from which pipe input comes
 * @param out1 output stream to which log messages will be sent
 */
static void plugTogetherPair(InputStream in,
                             OutputStream out,
                             InputStream in1,
                             OutputStream out1) {
    Thread inThread = null;
    Thread outThread = null;

    int nExecs = getNumExec();

    /* start RMI threads to read output from child process */
    inThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in, out, "out", nExecs),
                            "out", true));
    outThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in1, out1, "err", nExecs),
                            "err", true));
    inThread.start();
    outThread.start();
}
 
Example #16
Source File: Activation.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Allow plugging together two pipes at a time, to associate
 * output from an execed process.  This is the only publicly
 * accessible method of this object; this helps ensure that
 * synchronization will not be an issue in the annotation
 * process.
 *
 * @param in input stream from which pipe input comes
 * @param out output stream to which log messages will be sent
 * @param in1 input stream from which pipe input comes
 * @param out1 output stream to which log messages will be sent
 */
static void plugTogetherPair(InputStream in,
                             OutputStream out,
                             InputStream in1,
                             OutputStream out1) {
    Thread inThread = null;
    Thread outThread = null;

    int nExecs = getNumExec();

    /* start RMI threads to read output from child process */
    inThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in, out, "out", nExecs),
                            "out", true));
    outThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in1, out1, "err", nExecs),
                            "err", true));
    inThread.start();
    outThread.start();
}
 
Example #17
Source File: ObjectTable.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #18
Source File: Activation.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Allow plugging together two pipes at a time, to associate
 * output from an execed process.  This is the only publicly
 * accessible method of this object; this helps ensure that
 * synchronization will not be an issue in the annotation
 * process.
 *
 * @param in input stream from which pipe input comes
 * @param out output stream to which log messages will be sent
 * @param in1 input stream from which pipe input comes
 * @param out1 output stream to which log messages will be sent
 */
static void plugTogetherPair(InputStream in,
                             OutputStream out,
                             InputStream in1,
                             OutputStream out1) {
    Thread inThread = null;
    Thread outThread = null;

    int nExecs = getNumExec();

    /* start RMI threads to read output from child process */
    inThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in, out, "out", nExecs),
                            "out", true));
    outThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in1, out1, "err", nExecs),
                            "err", true));
    inThread.start();
    outThread.start();
}
 
Example #19
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Allow plugging together two pipes at a time, to associate
 * output from an execed process.  This is the only publicly
 * accessible method of this object; this helps ensure that
 * synchronization will not be an issue in the annotation
 * process.
 *
 * @param in input stream from which pipe input comes
 * @param out output stream to which log messages will be sent
 * @param in1 input stream from which pipe input comes
 * @param out1 output stream to which log messages will be sent
 */
static void plugTogetherPair(InputStream in,
                             OutputStream out,
                             InputStream in1,
                             OutputStream out1) {
    Thread inThread = null;
    Thread outThread = null;

    int nExecs = getNumExec();

    /* start RMI threads to read output from child process */
    inThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in, out, "out", nExecs),
                            "out", true));
    outThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in1, out1, "err", nExecs),
                            "err", true));
    inThread.start();
    outThread.start();
}
 
Example #20
Source File: ObjectTable.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #21
Source File: ObjectTable.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #22
Source File: ObjectTable.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #23
Source File: Activation.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Allow plugging together two pipes at a time, to associate
 * output from an execed process.  This is the only publicly
 * accessible method of this object; this helps ensure that
 * synchronization will not be an issue in the annotation
 * process.
 *
 * @param in input stream from which pipe input comes
 * @param out output stream to which log messages will be sent
 * @param in1 input stream from which pipe input comes
 * @param out1 output stream to which log messages will be sent
 */
static void plugTogetherPair(InputStream in,
                             OutputStream out,
                             InputStream in1,
                             OutputStream out1) {
    Thread inThread = null;
    Thread outThread = null;

    int nExecs = getNumExec();

    /* start RMI threads to read output from child process */
    inThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in, out, "out", nExecs),
                            "out", true));
    outThread = AccessController.doPrivileged(
        new NewThreadAction(new PipeWriter(in1, out1, "err", nExecs),
                            "err", true));
    inThread.start();
    outThread.start();
}
 
Example #24
Source File: TCPEndpoint.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Method that that will start a thread to wait to retrieve a
 * fully qualified domain name from a name service.  The spawned
 * thread may never return but we have marked it as a daemon so the vm
 * will terminate appropriately.
 */
private void getFQDN() {

    /* FQDN finder will run in RMI threadgroup. */
    Thread t = AccessController.doPrivileged(
        new NewThreadAction(FQDN.this, "FQDN Finder", true));
    t.start();
}
 
Example #25
Source File: TCPEndpoint.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Method that that will start a thread to wait to retrieve a
 * fully qualified domain name from a name service.  The spawned
 * thread may never return but we have marked it as a daemon so the vm
 * will terminate appropriately.
 */
private void getFQDN() {

    /* FQDN finder will run in RMI threadgroup. */
    Thread t = AccessController.doPrivileged(
        new NewThreadAction(FQDN.this, "FQDN Finder", true));
    t.start();
}
 
Example #26
Source File: TCPChannel.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Start a new thread to accept connections.
 */
public void startNewAcceptor() {
    Thread t = AccessController.doPrivileged(
        new NewThreadAction(ConnectionAcceptor.this,
                            "Multiplex Accept-" + ++ threadNum,
                            true));
    t.start();
}
 
Example #27
Source File: TCPEndpoint.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Method that that will start a thread to wait to retrieve a
 * fully qualified domain name from a name service.  The spawned
 * thread may never return but we have marked it as a daemon so the vm
 * will terminate appropriately.
 */
private void getFQDN() {

    /* FQDN finder will run in RMI threadgroup. */
    Thread t = AccessController.doPrivileged(
        new NewThreadAction(FQDN.this, "FQDN Finder", true));
    t.start();
}
 
Example #28
Source File: TCPChannel.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Start a new thread to accept connections.
 */
public void startNewAcceptor() {
    Thread t = AccessController.doPrivileged(
        new NewThreadAction(ConnectionAcceptor.this,
                            "Multiplex Accept-" + ++ threadNum,
                            true));
    t.start();
}
 
Example #29
Source File: DGCClient.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #30
Source File: TCPEndpoint.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Method that that will start a thread to wait to retrieve a
 * fully qualified domain name from a name service.  The spawned
 * thread may never return but we have marked it as a daemon so the vm
 * will terminate appropriately.
 */
private void getFQDN() {

    /* FQDN finder will run in RMI threadgroup. */
    Thread t = AccessController.doPrivileged(
        new NewThreadAction(FQDN.this, "FQDN Finder", true));
    t.start();
}