01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: ReadOnlyProcess.java,v 1.7.2.2 2008/01/07 15:14:25 cwl Exp $
07: */
08:
09: package com.sleepycat.je.cleaner;
10:
11: import java.io.File;
12:
13: import com.sleepycat.je.Environment;
14: import com.sleepycat.je.EnvironmentConfig;
15: import com.sleepycat.je.util.TestUtils;
16:
17: /**
18: * @see ReadOnlyLockingTest
19: */
20: public class ReadOnlyProcess {
21:
22: public static void main(String[] args) {
23:
24: /*
25: * Don't write to System.out in this process because the parent
26: * process only reads System.err.
27: */
28: try {
29: EnvironmentConfig envConfig = TestUtils.initEnvConfig();
30: envConfig.setTransactional(true);
31: envConfig.setReadOnly(true);
32:
33: File envHome = new File(System
34: .getProperty(TestUtils.DEST_DIR));
35: Environment env = new Environment(envHome, envConfig);
36:
37: //System.err.println("Opened read-only: " + envHome);
38: //System.err.println(System.getProperty("java.class.path"));
39:
40: /* Notify the test that this process has opened the environment. */
41: ReadOnlyLockingTest.createProcessFile();
42:
43: /* Sleep until the parent process kills me. */
44: Thread.sleep(Long.MAX_VALUE);
45: } catch (Exception e) {
46:
47: e.printStackTrace(System.err);
48: System.exit(1);
49: }
50: }
51: }
|