Author: mturk
Date: Tue Oct 25 06:57:17 2011
New Revision: 1188540
URL: http://svn.apache.org/viewvc?rev=1188540&view=rev
Log:
Add initial stub for Linux Containers
Added:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/linux/LXC.java
(with props)
Added:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/linux/LXC.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/linux/LXC.java?rev=1188540&view=auto
==============================================================================
---
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/linux/LXC.java
(added)
+++
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/linux/LXC.java
Tue Oct 25 06:57:17 2011
@@ -0,0 +1,68 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.runtime.platform.linux;
+
+import org.apache.commons.runtime.InvalidArgumentException;
+import org.apache.commons.runtime.OperationNotImplementedException;
+import org.apache.commons.runtime.Status;
+import org.apache.commons.runtime.SystemException;
+
+import java.io.File;
+
+/**
+ * Linux Containers library
+ */
+public final class LXC
+{
+ private static boolean inited = false;
+ private static Object lock;
+
+ private LXC()
+ {
+ // No instance
+ }
+
+ static {
+ lock = new Object();
+
+ }
+
+
+ private static native int init0();
+
+ public static void initialize()
+ throws SystemException
+ {
+ synchronized(lock) {
+ if (!inited) {
+ int rc = init0();
+ if (rc != 0)
+ throw new SystemException(Status.describe(rc));
+ inited = true;
+ }
+ }
+ }
+
+ public static boolean initialized()
+ {
+ synchronized(lock) {
+ return inited;
+ }
+ }
+
+}
+
Propchange:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/linux/LXC.java
------------------------------------------------------------------------------
svn:eol-style = native