commit f2b5734b589d04f9a522f783e3a8e4723b75c4be Author: Volker Birk Date: Thu Apr 2 16:37:35 2015 +0200 initial commit diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..7e45462 --- /dev/null +++ b/.hgignore @@ -0,0 +1,4 @@ +syntax: glob + +*.class +*.jar diff --git a/Test.java b/Test.java new file mode 100644 index 0000000..0fcdc57 --- /dev/null +++ b/Test.java @@ -0,0 +1,13 @@ +import org.pEp.jniadapter.*; + +public class Test { + public static void main(String[] args) { + try (Engine pEp = new Engine()) { + // using pEp engine + } + catch (pEpException e) { + + } + } +} + diff --git a/org/pEp/jniadapter/Engine.java b/org/pEp/jniadapter/Engine.java new file mode 100644 index 0000000..fbc5002 --- /dev/null +++ b/org/pEp/jniadapter/Engine.java @@ -0,0 +1,21 @@ +package org.pEp.jniadapter; + +public class Engine implements AutoCloseable { + static { + System.loadLibrary("pEpJNI"); + } + + protected native void init() throws pEpException; + protected native void release(); + + private long handle; + + public Engine() throws pEpException { + init(); + } + + public void close() { + release(); + } +} + diff --git a/org/pEp/jniadapter/pEpException.java b/org/pEp/jniadapter/pEpException.java new file mode 100644 index 0000000..f7b7109 --- /dev/null +++ b/org/pEp/jniadapter/pEpException.java @@ -0,0 +1,6 @@ +package org.pEp.jniadapter; + +public class pEpException extends Exception { + +} +