Java Reference
In-Depth Information
Note that some implementation differences may arise, especially on the details of how the vari-
ous services are implemented.
This class implements our JNLP runtime services provider. It is shown in Listing D.2. It makes
use of a hashtable for supplying the requested service implementations.
L ISTING D.2 The AServiceManagerStub Class
import javax.jnlp.ServiceManagerStub;
import java.util.*;
* Appendix D - Implementation of the corresponding JNLP runtime stub
* @author Mauro Marinilli
* @version 1.0
public class AServiceManagerStub implements ServiceManagerStub {
private HashMap hash;
* Constructor
public AServiceManagerStub() {
hash = new HashMap();
//fill up the hashtable with the supported services
hash.put(“javax.jnlp.BasicService”, new BasicServiceImpl());
hash.put(“javax.jnlp.ClipboardService”, new ClipboardServiceImpl());
hash.put(“javax.jnlp.PrintService”, new PrintServiceImpl());
hash.put(“javax.jnlp.FileSaveService”, new FileSaveServiceImpl());
hash.put(“javax.jnlp.FileOpenService”, new FileOpenServiceImpl());
hash.put(“javax.jnlp.DownloadService”, new DownloadServiceImpl());
hash.put(“javax.jnlp.PersistenceService”, new PersistenceServiceImpl());
* return service all names
public String[] getServiceNames() {
String result[] = new String[hash.keySet().size()];
return result;
Search WWH ::

Custom Search