KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > framework > internal > protocol > NullURLStreamHandlerService


1 /*******************************************************************************
2  * Copyright (c) 2003, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.osgi.framework.internal.protocol;
13
14 import java.io.IOException JavaDoc;
15 import java.net.*;
16 import org.osgi.service.url.URLStreamHandlerService;
17 import org.osgi.service.url.URLStreamHandlerSetter;
18
19 /**
20  * The NullURLStreamService is created when a registered URLStreamHandler service
21  * with an associated URLStreamHandlerProxy becomes unregistered. The associated
22  * URLStreamHandlerProxy must still handle all future requests for the now unregistered
23  * scheme (the JVM caches URLStreamHandlers making up impossible to "unregister" them).
24  * When requests come in for an unregistered URLStreamHandlerService, the
25  * NullURLStreamHandlerService is used in it's place.
26  */

27
28 public class NullURLStreamHandlerService implements URLStreamHandlerService {
29
30     public URLConnection openConnection(URL u) throws IOException JavaDoc {
31         throw new MalformedURLException();
32     }
33
34     public boolean equals(URL url1, URL url2) {
35         throw new IllegalStateException JavaDoc();
36     }
37
38     public int getDefaultPort() {
39         throw new IllegalStateException JavaDoc();
40     }
41
42     public InetAddress getHostAddress(URL url) {
43         throw new IllegalStateException JavaDoc();
44     }
45
46     public int hashCode(URL url) {
47         throw new IllegalStateException JavaDoc();
48     }
49
50     public boolean hostsEqual(URL url1, URL url2) {
51         throw new IllegalStateException JavaDoc();
52     }
53
54     public boolean sameFile(URL url1, URL url2) {
55         throw new IllegalStateException JavaDoc();
56     }
57
58     public void setURL(URL u, String JavaDoc protocol, String JavaDoc host, int port, String JavaDoc authority, String JavaDoc userInfo, String JavaDoc file, String JavaDoc query, String JavaDoc ref) {
59         throw new IllegalStateException JavaDoc();
60     }
61
62     public void setURL(URL u, String JavaDoc protocol, String JavaDoc host, int port, String JavaDoc file, String JavaDoc ref) {
63         throw new IllegalStateException JavaDoc();
64     }
65
66     public String JavaDoc toExternalForm(URL url) {
67         throw new IllegalStateException JavaDoc();
68     }
69
70     public void parseURL(URLStreamHandlerSetter realHandler, URL u, String JavaDoc spec, int start, int limit) {
71         throw new IllegalStateException JavaDoc();
72     }
73
74 }
75
Popular Tags