// Set the NodeInformationProvider that will provide information about
// which AdHoc-Commands are registered, whenever a disco request is
// received
ServiceDiscoveryManager.getInstanceFor(connection)
.setNodeInformationProvider(discoNode,
new NodeInformationProvider() {
public List<DiscoverItems.Item> getNodeItems() {
List<DiscoverItems.Item> answer = new ArrayList<DiscoverItems.Item>();
Collection<AdHocCommandInfo> commandsList = getRegisteredCommands();