65 private static final class CppProxy
extends Beacon
67 private final long nativeRef;
68 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
70 private CppProxy(
long nativeRef)
72 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
73 this.nativeRef = nativeRef;
76 private native
void nativeDestroy(
long nativeRef);
77 public void _djinni_private_destroy()
79 boolean destroyed = this.destroyed.getAndSet(
true);
80 if (!destroyed) nativeDestroy(this.nativeRef);
82 protected void finalize() throws
java.lang.Throwable
84 _djinni_private_destroy();
91 public Point getPoint()
93 assert !this.destroyed.get() :
"trying to use a destroyed object";
94 return native_getPoint(this.nativeRef);
96 private native
Point native_getPoint(
long _nativeRef);
99 public int getLocationId()
101 assert !this.destroyed.get() :
"trying to use a destroyed object";
102 return native_getLocationId(this.nativeRef);
104 private native
int native_getLocationId(
long _nativeRef);
107 public int getSublocationId()
109 assert !this.destroyed.get() :
"trying to use a destroyed object";
110 return native_getSublocationId(this.nativeRef);
112 private native
int native_getSublocationId(
long _nativeRef);
115 public String getName()
117 assert !this.destroyed.get() :
"trying to use a destroyed object";
118 return native_getName(this.nativeRef);
120 private native String native_getName(
long _nativeRef);
123 public int getMajor()
125 assert !this.destroyed.get() :
"trying to use a destroyed object";
126 return native_getMajor(this.nativeRef);
128 private native
int native_getMajor(
long _nativeRef);
131 public int getMinor()
133 assert !this.destroyed.get() :
"trying to use a destroyed object";
134 return native_getMinor(this.nativeRef);
136 private native
int native_getMinor(
long _nativeRef);
139 public String getUuid()
141 assert !this.destroyed.get() :
"trying to use a destroyed object";
142 return native_getUuid(this.nativeRef);
144 private native String native_getUuid(
long _nativeRef);
147 public Integer getPower()
149 assert !this.destroyed.get() :
"trying to use a destroyed object";
150 return native_getPower(this.nativeRef);
152 private native Integer native_getPower(
long _nativeRef);
155 public TransmitterStatus getStatus()
157 assert !this.destroyed.get() :
"trying to use a destroyed object";
158 return native_getStatus(this.nativeRef);
160 private native TransmitterStatus native_getStatus(
long _nativeRef);