switch (type) {
case CommPortOwnershipListener.PORT_OWNED:
System.out.println(portName + " has become unavailable");
break;
case CommPortOwnershipListener.PORT_UNOWNED:
System.out.println(portName + " has become available");
break;
case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED:
System.out.println("An application has requested onwership of "
+ portName);
break;
default:
System.out.println("Unknown port ownership event, type " + type);
}