|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectztex.ZtexContext
public class ZtexContext
This class manages an USB context. Because libusb_get_device_list does not return an up to date device list at least on some implementations a new context must be created every time the bus is (re)discovered, i.e. every time re-numeration occurs. This class creates a new USB context, initializes it and deinitializes it as soon it is not used anymore. Used is tracked using a reference counter. Reference counter of a new instance is 1.
Constructor Summary | |
---|---|
ZtexContext()
Constructs an new USB context and initializes it. |
Method Summary | |
---|---|
org.usb4java.Context |
context()
Returns the USB context. |
protected void |
finalize()
|
ZtexContext |
ref()
Increases the reference count. |
void |
unref()
Decreases the reference count and deinitializes the context if reference counter reaches 0. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ZtexContext() throws UsbException
UsbException
Method Detail |
---|
public final org.usb4java.Context context()
public ZtexContext ref() throws UsbException
UsbException
public void unref()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |