@Override public TabularData getBookings() throws MBeanException { try { CompositeType bookingType = new CompositeType("booking", "Booking", new String[]{"id", "flight", "customer"}, new String[]{"ID", "Flight", "Customer"}, new OpenType[]{SimpleType.LONG, SimpleType.STRING, SimpleType.STRING}); TabularType tabularType = new TabularType("bookings", "Bookings", bookingType, new String[]{"id"}); TabularData tabularData = new TabularDataSupport(tabularType); for (Booking booking : bookingService.list()) { CompositeData compositeData = new CompositeDataSupport(bookingType, new String[]{ "id", "flight", "customer" }, new Object[]{ booking.getId(), booking.getFlight(), booking.getCustomer() }); tabularData.put(compositeData); } return tabularData; } catch (Exception e) { throw new MBeanException(e); } }
@Override public TabularData getBookings() throws MBeanException { try { CompositeType bookingType = new CompositeType("booking", "Booking", new String[]{"id", "flight", "customer"}, new String[]{"ID", "Flight", "Customer"}, new OpenType[]{SimpleType.LONG, SimpleType.STRING, SimpleType.STRING}); TabularType tabularType = new TabularType("bookings", "Bookings", bookingType, new String[]{"id"}); TabularData tabularData = new TabularDataSupport(tabularType); for (Booking booking : bookingService.list()) { CompositeData compositeData = new CompositeDataSupport(bookingType, new String[]{ "id", "flight", "customer" }, new Object[]{ booking.getId(), booking.getFlight(), booking.getCustomer() }); tabularData.put(compositeData); } return tabularData; } catch (Exception e) { throw new MBeanException(e); } }
@Override public TabularData getBookings() throws MBeanException { try { CompositeType bookingType = new CompositeType("booking", "Booking", new String[]{"id", "flight", "customer"}, new String[]{"ID", "Flight", "Customer"}, new OpenType[]{SimpleType.LONG, SimpleType.STRING, SimpleType.STRING}); TabularType tabularType = new TabularType("bookings", "Bookings", bookingType, new String[]{"id"}); TabularData tabularData = new TabularDataSupport(tabularType); for (Booking booking : bookingService.list()) { CompositeData compositeData = new CompositeDataSupport(bookingType, new String[]{ "id", "flight", "customer" }, new Object[]{ booking.getId(), booking.getFlight(), booking.getCustomer() }); tabularData.put(compositeData); } return tabularData; } catch (Exception e) { throw new MBeanException(e); } }