You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2011/04/13 14:42:36 UTC

svn commit: r1091761 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/ native/os/win32/

Author: mturk
Date: Wed Apr 13 12:42:36 2011
New Revision: 1091761

URL: http://svn.apache.org/viewvc?rev=1091761&view=rev
Log:
Add skeleton for Semaphores

Added:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphore.java   (with props)
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImpl.java   (with props)
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImplFactory.java   (with props)
    commons/sandbox/runtime/trunk/src/main/native/os/win32/semaphore.c   (with props)

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphore.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphore.java?rev=1091761&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphore.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphore.java Wed Apr 13 12:42:36 2011
@@ -0,0 +1,35 @@
+/* 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;
+
+import java.io.IOException;
+
+/**
+ * WindowsSemaphore class.
+ * <p>
+ * </p>
+ *
+ * @since Runtime 1.0
+ */
+final class WindowsSemaphore extends Semaphore
+{
+
+    private WindowsSemaphore()
+    {
+        // No Instance
+    }
+
+}

Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImpl.java?rev=1091761&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImpl.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImpl.java Wed Apr 13 12:42:36 2011
@@ -0,0 +1,36 @@
+/* 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;
+
+import java.io.IOException;
+
+/**
+ * WindowsSemaphoreImpl class.
+ * <p>
+ * </p>
+ *
+ * @since Runtime 1.0
+ */
+final class WindowsSemaphoreImpl extends SemaphoreImpl
+{
+
+    public WindowsSemaphoreImpl()
+    {
+        // No Instance
+    }
+
+}
+

Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImplFactory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImplFactory.java?rev=1091761&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImplFactory.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImplFactory.java Wed Apr 13 12:42:36 2011
@@ -0,0 +1,39 @@
+/* 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;
+
+import java.io.IOException;
+
+/**
+ * WindowsSemaphoreImplFactory class.
+ * <p>
+ * </p>
+ *
+ * @since Runtime 1.0
+ */
+final class WindowsSemaphoreImplFactory extends SemaphoreImplFactory
+{
+
+    private WindowsSemaphoreImplFactory()
+    {
+        // No Instance
+    }
+
+    public SemaphoreImpl createSemaphoreImpl()
+    {
+        return new WindowsSemaphoreImpl();
+    }
+}

Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WindowsSemaphoreImplFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/runtime/trunk/src/main/native/os/win32/semaphore.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/semaphore.c?rev=1091761&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/semaphore.c (added)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/semaphore.c Wed Apr 13 12:42:36 2011
@@ -0,0 +1,54 @@
+/* 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.
+ */
+
+#include "acr/string.h"
+#include "acr/clazz.h"
+#include "acr/port.h"
+#include "arch_defs.h"
+
+J_DECLARE_CLAZZ = {
+    INVALID_FIELD_OFFSET,
+    0,
+    0,
+    0,
+    ACR_CLASS_PATH "WindowsSemaphoreImplFactory"
+};
+
+J_DECLARE_M_ID(0000) = {
+    0,
+    "<init>",
+    "()V"
+};
+
+static int _init_factory(JNI_STDENV)
+{
+    int rv;
+
+    if ((rv = AcrLoadClass(env, &_clazzn, 0)) != 0)
+        return rv;
+    J_LOAD_METHOD(0000);
+    _clazzn.u = 1;
+    return 0;
+}
+
+ACR_JNI_EXPORT(jobject, Semaphore, getImplFactory)(JNI_STDARGS)
+{
+    if (_init_factory(env) != 0) {
+        ACR_THROW_MSG(ACR_EX_EINSTANCE, "WindowsSemaphoreImplFactory not initialized");
+        return 0;
+    }
+    return (*env)->NewObject(env, _clazzn.i, J4MID(0000));
+}

Propchange: commons/sandbox/runtime/trunk/src/main/native/os/win32/semaphore.c
------------------------------------------------------------------------------
    svn:eol-style = native