当前位置: 首页>>代码示例>>Java>>正文


Java ReliableLog类代码示例

本文整理汇总了Java中sun.rmi.log.ReliableLog的典型用法代码示例。如果您正苦于以下问题:Java ReliableLog类的具体用法?Java ReliableLog怎么用?Java ReliableLog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ReliableLog类属于sun.rmi.log包,在下文中一共展示了ReliableLog类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import sun.rmi.log.ReliableLog; //导入依赖的package包/类
public static void main(String[] args) throws Exception {

        System.err.println("\nRegression test for bug 4652922\n");

        System.setProperty("sun.rmi.log.class", MyLogFile.class.getName());
        //System.setProperty("sun.rmi.log.debug", "true");

        log = new ReliableLog(".", new TestLogHandler(counter), false);

        writeUpdatesCrashAndRecover(10, 1, false, 10);
        writeUpdatesCrashAndRecover(10, 1, true, 20);
        writeUpdatesCrashAndRecover(10, 2, true, 30);
        writeUpdatesCrashAndRecover(9, 2, false, 40);
        writeUpdatesCrashAndRecover(9, 3, true, 50);
        log.close();
    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:17,代码来源:LogTest.java

示例2: startActivation

import sun.rmi.log.ReliableLog; //导入依赖的package包/类
/**
 * Recover activation state from the reliable log and initialize
 * activation services.
 */
private static void startActivation(int port,
                                    RMIServerSocketFactory ssf,
                                    String logName,
                                    String[] childArgs)
    throws Exception
{
    ReliableLog log = new ReliableLog(logName, new ActLogHandler());
    Activation state = (Activation) log.recover();
    state.init(port, ssf, log, childArgs);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:Activation.java

示例3: main

import sun.rmi.log.ReliableLog; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    SnapshotSize handler = new SnapshotSize();
    ReliableLog log = new ReliableLog(".", handler);
    if (log.snapshotSize() != handler.lastSnapshotSize) {
        throw new Error();
    }

    String[] snapshots = { "some", "sample", "objects", "to", "snapshot" };
    for (int i = 0; i < snapshots.length; i++) {
        log.snapshot(snapshots[i]);
        if (log.snapshotSize() != handler.lastSnapshotSize) {
            throw new Error();
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:16,代码来源:SnapshotSize.java

示例4: init

import sun.rmi.log.ReliableLog; //导入依赖的package包/类
/**
 * Initialize the Activation instantiation; start activation
 * services.
 */
private void init(int port,
                  RMIServerSocketFactory ssf,
                  ReliableLog log,
                  String[] childArgs)
    throws Exception
{
    // initialize
    this.log = log;
    numUpdates = 0;
    shutdownHook =  new ShutdownHook();
    groupSemaphore = getInt("sun.rmi.activation.groupThrottle", 3);
    groupCounter = 0;
    Runtime.getRuntime().addShutdownHook(shutdownHook);

    // Use array size of 0, since the value from calling size()
    // may be out of date by the time toArray() is called.
    ActivationGroupID[] gids =
        groupTable.keySet().toArray(new ActivationGroupID[0]);

    synchronized (startupLock = new Object()) {
        // all the remote methods briefly synchronize on startupLock
        // (via checkShutdown) to make sure they don't happen in the
        // middle of this block.  This block must not cause any such
        // incoming remote calls to happen, or deadlock would result!
        activator = new ActivatorImpl(port, ssf);
        activatorStub = (Activator) RemoteObject.toStub(activator);
        system = new ActivationSystemImpl(port, ssf);
        systemStub = (ActivationSystem) RemoteObject.toStub(system);
        monitor = new ActivationMonitorImpl(port, ssf);
        initCommand(childArgs);
        registry = new SystemRegistryImpl(port, null, ssf, systemStub);

        if (ssf != null) {
            synchronized (initLock) {
                initDone = true;
                initLock.notifyAll();
            }
        }
    }
    startupLock = null;

    // restart services
    for (int i = gids.length; --i >= 0; ) {
        try {
            getGroupEntry(gids[i]).restartServices();
        } catch (UnknownGroupException e) {
            System.err.println(
                getTextResource("rmid.restart.group.warning"));
            e.printStackTrace();
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:57,代码来源:Activation.java


注:本文中的sun.rmi.log.ReliableLog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。