Пример #1
0
 private void catalogInfo() {
   Cataloger cataloger = (Cataloger) ProviderLookup.getService(Cataloger.class);
   if (cataloger != null) {
     try {
       out.println(((Provider) cataloger).getProviderName() + " Contents");
       out.println(cataloger.getServiceInfo());
     } catch (RemoteException e) {
       e.printStackTrace();
     }
   }
 }
Пример #2
0
 private void listCatalog() {
   Cataloger cataloger = (Cataloger) ProviderLookup.getService(Cataloger.class);
   if (cataloger != null) {
     String[] providers = new String[0];
     try {
       providers = cataloger.getProviderList();
       out.println("Providers in the " + ((Provider) cataloger).getProviderName() + ": ");
       for (String provider : providers) {
         out.println("  " + provider);
       }
     } catch (RemoteException e) {
       e.printStackTrace();
     }
   }
 }