Showing the changes to java/pkg/com/sun/java/browser (12 of 18352 files). Show all
Unified · Split
| @@ -0,0 +1,89 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package com.sun.java.browser.dom; | ||
| 27 | |||
| 28 | public class DOMAccessException extends Exception | ||
| 29 | { | ||
| 30 | /** | ||
| 31 | * Constructs a new DOMAccessException with no detail message. | ||
| 32 | */ | ||
| 33 | public DOMAccessException() | ||
| 34 | { | ||
| 35 | this(null, null); | ||
| 36 | } | ||
| 37 | |||
| 38 | |||
| 39 | /** | ||
| 40 | * Constructs a new DOMAccessException with the given detail message. | ||
| 41 | * | ||
| 42 | * @param msg Detail message. | ||
| 43 | */ | ||
| 44 | public DOMAccessException(String msg) | ||
| 45 | { | ||
| 46 | this(null, msg); | ||
| 47 | } | ||
| 48 | |||
| 49 | /** | ||
| 50 | * Constructs a new DOMAccessException with the given exception as a root clause. | ||
| 51 | * | ||
| 52 | * @param e Exception. | ||
| 53 | */ | ||
| 54 | public DOMAccessException(Exception e) | ||
| 55 | { | ||
| 56 | this(e, null); | ||
| 57 | } | ||
| 58 | |||
| 59 | /** | ||
| 60 | * Constructs a new DOMAccessException with the given exception as a root clause and the given detail message. | ||
| 61 | * | ||
| 62 | * @param e Exception. | ||
| 63 | * @param msg Detail message. | ||
| 64 | */ | ||
| 65 | public DOMAccessException(Exception e, String msg) | ||
| 66 | { | ||
| 67 | this.ex = e; | ||
| 68 | this.msg = msg; | ||
| 69 | } | ||
| 70 | |||
| 71 | /** | ||
| 72 | * Returns the detail message of the error or null if there is no detail message. | ||
| 73 | */ | ||
| 74 | public String getMessage() | ||
| 75 | { | ||
| 76 | return msg; | ||
| 77 | } | ||
| 78 | |||
| 79 | /** | ||
| 80 | * Returns the root cause of the error or null if there is none. | ||
| 81 | */ | ||
| 82 | public Throwable getCause() | ||
| 83 | { | ||
| 84 | return ex; | ||
| 85 | } | ||
| 86 | |||
| 87 | private Throwable ex; | ||
| 88 | private String msg; | ||
| 89 | } | ||
| @@ -0,0 +1,40 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package com.sun.java.browser.dom; | ||
| 27 | |||
| 28 | |||
| 29 | public interface DOMAccessor | ||
| 30 | { | ||
| 31 | /** | ||
| 32 | * Returns the Document object of the DOM. | ||
| 33 | */ | ||
| 34 | public org.w3c.dom.Document getDocument(Object obj) throws org.w3c.dom.DOMException; | ||
| 35 | |||
| 36 | /** | ||
| 37 | * Returns a DOMImplementation object. | ||
| 38 | */ | ||
| 39 | public org.w3c.dom.DOMImplementation getDOMImplementation(); | ||
| 40 | } | ||
| @@ -0,0 +1,42 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package com.sun.java.browser.dom; | ||
| 27 | |||
| 28 | |||
| 29 | public interface DOMAction | ||
| 30 | { | ||
| 31 | /** | ||
| 32 | * When an object implementing interface DOMAction is passed | ||
| 33 | * to DOMService.invokeAndWait() or DOMService.invokeLater(), | ||
| 34 | * run method is called in the DOM access dispatch thread. | ||
| 35 | * | ||
| 36 | * accessor is used for the DOMAction to access the entry point of | ||
| 37 | * the browser's DOM, if necessary. | ||
| 38 | * | ||
| 39 | * @param accessor DOMAccessor | ||
| 40 | */ | ||
| 41 | public Object run(DOMAccessor accessor); | ||
| 42 | } | ||
| @@ -0,0 +1,103 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package com.sun.java.browser.dom; | ||
| 27 | |||
| 28 | public abstract class DOMService | ||
| 29 | { | ||
| 30 | /** | ||
| 31 | * Returns new instance of a DOMService. The implementation | ||
| 32 | * of the DOMService returns depends on the setting of the | ||
| 33 | * com.sun.java.browser.dom.DOMServiceProvider property or, | ||
| 34 | * if the property is not set, a platform specific default. | ||
| 35 | * | ||
| 36 | * Throws DOMUnsupportedException if the DOMService is not | ||
| 37 | * available to the obj. | ||
| 38 | * | ||
| 39 | * @param obj Object to leverage the DOMService | ||
| 40 | */ | ||
| 41 | public static DOMService getService(Object obj) | ||
| 42 | throws DOMUnsupportedException | ||
| 43 | { | ||
| 44 | try | ||
| 45 | { | ||
| 46 | String provider = (String) java.security.AccessController.doPrivileged( | ||
| 47 | new sun.security.action.GetPropertyAction("com.sun.java.browser.dom.DOMServiceProvider")); | ||
| 48 | |||
| 49 | Class clazz = DOMService.class.forName("sun.plugin.dom.DOMService"); | ||
| 50 | |||
| 51 | return (DOMService) clazz.newInstance(); | ||
| 52 | } | ||
| 53 | catch (Throwable e) | ||
| 54 | { | ||
| 55 | throw new DOMUnsupportedException(e.toString()); | ||
| 56 | } | ||
| 57 | } | ||
| 58 | |||
| 59 | /** | ||
| 60 | * An empty constructor is provided. Implementations of this | ||
| 61 | * abstract class must provide a public no-argument constructor | ||
| 62 | * in order for the static getService() method to work correctly. | ||
| 63 | * Application programmers should not be able to directly | ||
| 64 | * construct implementation subclasses of this abstract subclass. | ||
| 65 | */ | ||
| 66 | public DOMService() | ||
| 67 | { | ||
| 68 | } | ||
| 69 | |||
| 70 | /** | ||
| 71 | * Causes action.run() to be executed synchronously on the | ||
| 72 | * DOM action dispatching thread. This call will block until all | ||
| 73 | * pending DOM actions have been processed and (then) | ||
| 74 | * action.run() returns. This method should be used when an | ||
| 75 | * application thread needs to access the browser's DOM. | ||
| 76 | * It should not be called from the DOMActionDispatchThread. | ||
| 77 | * | ||
| 78 | * Note that if the DOMAction.run() method throws an uncaught | ||
| 79 | * exception (on the DOM action dispatching thread), it's caught | ||
| 80 | * and re-thrown, as an DOMAccessException, on the caller's thread. | ||
| 81 | * | ||
| 82 | * If the DOMAction.run() method throws any DOM security related | ||
| 83 | * exception (on the DOM action dispatching thread), it's caught | ||
| 84 | * and re-thrown, as an DOMSecurityException, on the caller's thread. | ||
| 85 | * | ||
| 86 | * @param action DOMAction. | ||
| 87 | */ | ||
| 88 | public abstract Object invokeAndWait(DOMAction action) throws DOMAccessException; | ||
| 89 | |||
| 90 | /** | ||
| 91 | * Causes action.run() to be executed asynchronously on the | ||
| 92 | * DOM action dispatching thread. This method should be used | ||
| 93 | * when an application thread needs to access the browser's | ||
| 94 | * DOM. It should not be called from the DOMActionDispatchThread. | ||
| 95 | * | ||
| 96 | * Note that if the DOMAction.run() method throws an uncaught | ||
| 97 | * exception (on the DOM action dispatching thread), it will not be | ||
| 98 | * caught and re-thrown on the caller's thread. | ||
| 99 | * | ||
| 100 | * @param action DOMAction. | ||
| 101 | */ | ||
| 102 | public abstract void invokeLater(DOMAction action); | ||
| 103 | } | ||
| @@ -0,0 +1,60 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package com.sun.java.browser.dom; | ||
| 27 | |||
| 28 | public abstract class DOMServiceProvider | ||
| 29 | { | ||
| 30 | /** | ||
| 31 | * An empty constructor is provided. Implementations should | ||
| 32 | * provide a public constructor so that the DOMService | ||
| 33 | * can instantiate instances of the implementation class. | ||
| 34 | * Application programmers should not be able to directly | ||
| 35 | * construct implementation subclasses of this abstract subclass. | ||
| 36 | * The only way an application should be able to obtain a | ||
| 37 | * reference to a DOMServiceProvider implementation | ||
| 38 | * instance is by using the appropriate methods of the | ||
| 39 | * DOMService. | ||
| 40 | */ | ||
| 41 | public DOMServiceProvider() | ||
| 42 | { | ||
| 43 | } | ||
| 44 | |||
| 45 | /** | ||
| 46 | * Returns true if the DOMService can determine the association | ||
| 47 | * between the obj and the underlying DOM in the browser. | ||
| 48 | */ | ||
| 49 | public abstract boolean canHandle(Object obj); | ||
| 50 | |||
| 51 | /** | ||
| 52 | * Returns the Document object of the DOM. | ||
| 53 | */ | ||
| 54 | public abstract org.w3c.dom.Document getDocument(Object obj) throws DOMUnsupportedException; | ||
| 55 | |||
| 56 | /** | ||
| 57 | * Returns the DOMImplemenation object of the DOM. | ||
| 58 | */ | ||
| 59 | public abstract org.w3c.dom.DOMImplementation getDOMImplementation(); | ||
| 60 | } | ||
| @@ -0,0 +1,89 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package com.sun.java.browser.dom; | ||
| 27 | |||
| 28 | |||
| 29 | public class DOMUnsupportedException extends Exception | ||
| 30 | { | ||
| 31 | /** | ||
| 32 | * Constructs a new DOMUnsupportedException with no detail message. | ||
| 33 | */ | ||
| 34 | public DOMUnsupportedException() | ||
| 35 | { | ||
| 36 | this(null, null); | ||
| 37 | } | ||
| 38 | |||
| 39 | /** | ||
| 40 | * Constructs a new DOMUnsupportedException with the given detail message. | ||
| 41 | * | ||
| 42 | * @param msg Detail message. | ||
| 43 | */ | ||
| 44 | public DOMUnsupportedException(String msg) | ||
| 45 | { | ||
| 46 | this(null, msg); | ||
| 47 | } | ||
| 48 | |||
| 49 | /** | ||
| 50 | * Constructs a new DOMUnsupportedException with the given exception as a root clause. | ||
| 51 | * | ||
| 52 | * @param e Exception. | ||
| 53 | */ | ||
| 54 | public DOMUnsupportedException(Exception e) | ||
| 55 | { | ||
| 56 | this(e, null); | ||
| 57 | } | ||
| 58 | |||
| 59 | /** | ||
| 60 | * Constructs a new DOMUnsupportedException with the given exception as a root clause and the given detail message. | ||
| 61 | * | ||
| 62 | * @param e Exception. | ||
| 63 | * @param msg Detail message. | ||
| 64 | */ | ||
| 65 | public DOMUnsupportedException(Exception e, String msg) | ||
| 66 | { | ||
| 67 | this.ex = e; | ||
| 68 | this.msg = msg; | ||
| 69 | } | ||
| 70 | |||
| 71 | /** | ||
| 72 | * Returns the detail message of the error or null if there is no detail message. | ||
| 73 | */ | ||
| 74 | public String getMessage() | ||
| 75 | { | ||
| 76 | return msg; | ||
| 77 | } | ||
| 78 | |||
| 79 | /** | ||
| 80 | * Returns the root cause of the error or null if there is none. | ||
| 81 | */ | ||
| 82 | public Throwable getCause() | ||
| 83 | { | ||
| 84 | return ex; | ||
| 85 | } | ||
| 86 | |||
| 87 | private Throwable ex; | ||
| 88 | private String msg; | ||
| 89 | } | ||
| @@ -0,0 +1,13 @@ | |||
| 1 | <../../../../../../../mkconfig | ||
| 2 | |||
| 3 | TARG=\ | ||
| 4 | DOMAccessException.dis\ | ||
| 5 | DOMAccessor.dis\ | ||
| 6 | DOMAction.dis\ | ||
| 7 | DOMService.dis\ | ||
| 8 | DOMServiceProvider.dis\ | ||
| 9 | DOMUnsupportedException.dis\ | ||
| 10 | |||
| 11 | DISBIN=$ROOT/java/dis/java/java/com/sun/java/browser/dom | ||
| 12 | |||
| 13 | <$ROOT/mkfiles/mkjava | ||
| @@ -0,0 +1,7 @@ | |||
| 1 | <../../../../../../mkconfig | ||
| 2 | |||
| 3 | DIRS=\ | ||
| 4 | dom\ | ||
| 5 | net\ | ||
| 6 | |||
| 7 | <$ROOT/mkfiles/mksubdirs | ||
| @@ -0,0 +1,36 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package com.sun.java.browser.net; | ||
| 27 | |||
| 28 | /** | ||
| 29 | * | ||
| 30 | * @author Zhengyu Gu | ||
| 31 | */ | ||
| 32 | public interface ProxyInfo { | ||
| 33 | public String getHost(); | ||
| 34 | public int getPort(); | ||
| 35 | public boolean isSocks(); | ||
| 36 | } | ||
| @@ -0,0 +1,61 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package com.sun.java.browser.net; | ||
| 27 | |||
| 28 | import java.net.URL; | ||
| 29 | import java.io.IOException; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * | ||
| 33 | * @author Zhengyu Gu | ||
| 34 | */ | ||
| 35 | public class ProxyService extends Object { | ||
| 36 | private static ProxyServiceProvider provider = null; | ||
| 37 | |||
| 38 | |||
| 39 | public static void setProvider(ProxyServiceProvider p) | ||
| 40 | throws IOException { | ||
| 41 | if(null == provider) | ||
| 42 | provider = p; | ||
| 43 | else | ||
| 44 | throw new IOException("Proxy service provider has already been set."); | ||
| 45 | } | ||
| 46 | |||
| 47 | |||
| 48 | /** | ||
| 49 | * <p>The function returns proxy information of the specified URL.</p> | ||
| 50 | * @param url URL | ||
| 51 | * @return returns proxy information. If there is not proxy, returns null | ||
| 52 | * @since 1.4 | ||
| 53 | */ | ||
| 54 | public static ProxyInfo[] getProxyInfo(URL url) | ||
| 55 | throws IOException { | ||
| 56 | if(null == provider) | ||
| 57 | throw new IOException("Proxy service provider is not yet set"); | ||
| 58 | |||
| 59 | return provider.getProxyInfo(url); | ||
| 60 | } | ||
| 61 | } | ||
| @@ -0,0 +1,36 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. | ||
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| 4 | * | ||
| 5 | * This code is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 only, as | ||
| 7 | * published by the Free Software Foundation. Oracle designates this | ||
| 8 | * particular file as subject to the "Classpath" exception as provided | ||
| 9 | * by Oracle in the LICENSE file that accompanied this code. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 14 | * version 2 for more details (a copy is included in the LICENSE file that | ||
| 15 | * accompanied this code). | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License version | ||
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, | ||
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | * | ||
| 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| 22 | * or visit www.oracle.com if you need additional information or have any | ||
| 23 | * questions. | ||
| 24 | */ | ||
| 25 | |||
| 26 | package com.sun.java.browser.net; | ||
| 27 | |||
| 28 | import java.net.URL; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * | ||
| 32 | * @author Zhengyu Gu | ||
| 33 | */ | ||
| 34 | public interface ProxyServiceProvider { | ||
| 35 | public ProxyInfo[] getProxyInfo(URL url); | ||
| 36 | } | ||
| @@ -0,0 +1,10 @@ | |||
| 1 | <../../../../../../../mkconfig | ||
| 2 | |||
| 3 | TARG=\ | ||
| 4 | ProxyInfo.dis\ | ||
| 5 | ProxyService.dis\ | ||
| 6 | ProxyServiceProvider.dis\ | ||
| 7 | |||
| 8 | DISBIN=$ROOT/java/dis/java/java/com/sun/java/browser/net | ||
| 9 | |||
| 10 | <$ROOT/mkfiles/mkjava | ||