本文整理汇总了Java中javax.usb.event.UsbDeviceErrorEvent类的典型用法代码示例。如果您正苦于以下问题:Java UsbDeviceErrorEvent类的具体用法?Java UsbDeviceErrorEvent怎么用?Java UsbDeviceErrorEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UsbDeviceErrorEvent类属于javax.usb.event包,在下文中一共展示了UsbDeviceErrorEvent类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: errorEventOccurred
import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
/**
*
* @param udee
*/
@Override
public void errorEventOccurred(UsbDeviceErrorEvent udee)
{
Logger.getLogger(UsbRobotArm.class.getName()).log(Level.SEVERE,
udee.getUsbException().toString(), udee);
}
示例2: errorEventOccurred
import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
@Override
public void errorEventOccurred(final UsbDeviceErrorEvent event)
{
for (final UsbDeviceListener listener: toArray())
{
listener.errorEventOccurred(event);
}
}
示例3: testErrorEvent
import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
/**
* Tests the error event.
*/
@Test
public void testErrorEvent()
{
final UsbDeviceErrorEvent event = new UsbDeviceErrorEvent(
mock(UsbDevice.class), mock(UsbControlIrp.class));
final UsbDeviceListener a = mock(UsbDeviceListener.class);
final UsbDeviceListener b = mock(UsbDeviceListener.class);
this.list.add(a);
this.list.add(b);
this.list.errorEventOccurred(event);
verify(a).errorEventOccurred(event);
verify(b).errorEventOccurred(event);
}
示例4: testDetachedEvent
import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
/**
* Tests the detached event.
*/
@Test
public void testDetachedEvent()
{
final UsbDeviceErrorEvent event = new UsbDeviceErrorEvent(
mock(UsbDevice.class), mock(UsbControlIrp.class));
final UsbDeviceListener a = mock(UsbDeviceListener.class);
final UsbDeviceListener b = mock(UsbDeviceListener.class);
this.list.add(a);
this.list.add(b);
this.list.usbDeviceDetached(event);
verify(a).usbDeviceDetached(event);
verify(b).usbDeviceDetached(event);
}
示例5: testAbstractMethods
import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
/**
* Ensure the existence of the needed methods.
*/
@Test
public void testAbstractMethods()
{
final UsbDeviceListener adapter = new UsbDeviceAdapter()
{
// Empty
};
adapter.usbDeviceDetached((UsbDeviceEvent) null);
adapter.dataEventOccurred((UsbDeviceDataEvent) null);
adapter.errorEventOccurred((UsbDeviceErrorEvent) null);
}
示例6: errorEventOccurred
import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
@Override
public void errorEventOccurred(UsbDeviceErrorEvent usbEvent) {
logger.debug("received error event from device {}", usbEvent);
if (isGeneratedByAKnownDevice(usbEvent.getUsbDevice())) {
Controller controller = extractUsbController(usbEvent.getUsbDevice());
Event event = UsbEvent.failure(usbEvent.getUsbException());
this.eventListener.onEvent(controller, event);
}
}
示例7: errorEventOccurred
import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
@Override
public void errorEventOccurred(final UsbDeviceErrorEvent event)
{
// Empty
}