DataCollector.java revision 673:6b017d166ac2
1/*
2 * Copyright (c) 2002, 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 */
25package com.sun.corba.se.spi.orb ;
26
27import java.applet.Applet ;
28import java.util.Properties ;
29import java.util.Vector ;
30
31/** Interface for collecting all sources of ORB configuration properties
32 * into a single properties object.   A PropertyParser is needed so that
33 * the set of property names of interest is known.
34 */
35public interface DataCollector {
36    /** Return true iff this DataCollector was created from
37     * applet data.
38     */
39    boolean isApplet() ;
40
41    /** Return true iff the local host and ORB initial host are the same.
42    * This is provided to avoid exposing the local host in insecure
43    * contexts.
44    */
45    boolean initialHostIsLocal() ;
46
47    /** Set the parser which is used to obtain property names.
48     * This must be called before getProperties
49     * may be called.  It may be called multiple times if different
50     * sets of properties are needed for the same data sources.
51     */
52    void setParser( PropertyParser parser ) ;
53
54    /** Return the consolidated property information to be used
55     * for ORB configuration.  Note that -ORBInitRef arguments are
56     * handled specially: all -ORBInitRef name=value arguments are
57     * converted into ( org.omg.CORBA.ORBInitRef.name, value )
58     * mappings in the resulting properties.  Also, -ORBInitialServices
59     * is handled specially in applet mode: they are converted from
60     * relative to absolute URLs.
61     * @throws IllegalStateException if setPropertyNames has not
62     * been called.
63     */
64    Properties getProperties() ;
65}
66