001    /*
002     * Copyright 2001-2004 The Apache Software Foundation.
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package javax.xml.rpc;
017    
018    import java.util.Iterator;
019    
020    /**
021     * The interface <code>javax.xml.rpc.Stub</code> is the common base interface
022     * for the stub classes. All generated stub classes are required to
023     * implement the <code>javax.xml.rpc.Stub</code> interface. An instance
024     * of a stub class represents a client side proxy or stub instance for
025     * the target service endpoint.
026     *
027     * <p>The <code>javax.xml.rpc.Stub</code> interface provides an
028     * extensible property mechanism for the dynamic configuration of
029     * a stub instance.
030     *
031     * @version 1.0
032     */
033    public interface Stub {
034    
035        // Constants for the standard properties
036    
037        /**
038         * Standard property: User name for authentication.
039         * <p>Type: java.lang.String
040         */
041        public static final String USERNAME_PROPERTY = Call.USERNAME_PROPERTY;
042    
043        /**
044         * Standard property: Password for authentication.
045         * <p>Type: java.lang.String
046         */
047        public static final String PASSWORD_PROPERTY = Call.PASSWORD_PROPERTY;
048    
049        /**
050         * Standard property: Target service endpoint address. The
051         * URI scheme for the endpoint address specification must
052         * correspond to the protocol/transport binding for this
053         * stub class.
054         * <p>Type: java.lang.String
055         */
056        public static final String ENDPOINT_ADDRESS_PROPERTY =
057            "javax.xml.rpc.service.endpoint.address";
058    
059        /**
060         * Standard property: This boolean property is used by a service
061         * client to indicate whether or not it wants to participate in
062         * a session with a service endpoint. If this property is set to
063         * true, the service client indicates that it wants the session
064         * to be maintained. If set to false, the session is not maintained.
065         * The default value for this property is false.
066         * <p>Type: java.lang.Boolean
067         */
068        public static final String SESSION_MAINTAIN_PROPERTY =
069            Call.SESSION_MAINTAIN_PROPERTY;
070    
071        /**
072         * Sets the name and value of a configuration property
073         * for this Stub instance. If the Stub instances contains
074         * a value of the same property, the old value is replaced.
075         * <p>Note that the <code>_setProperty</code> method may not
076         * perform validity check on a configured property value. An
077         * example is the standard property for the target service
078         * endpoint address that is not checked for validity in the
079         * <code>_setProperty</code> method.
080         * In this case, stub configuration errors are detected at
081         * the remote method invocation.
082         *
083         * @param name Name of the configuration property
084         * @param value Value of the property
085         * @throws JAXRPCException <ul>
086         *     <li>If an optional standard property name is
087         *         specified, however this Stub implementation
088         *         class does not support the configuration of
089         *         this property.
090         *     <li>If an invalid or unsupported property name is
091         *         specified or if a value of mismatched property
092         *         type is passed.
093         *     <li>If there is any error in the configuration of
094         *         a valid property.
095         *     </ul>
096         */
097        public void _setProperty(String name, Object value);
098    
099        /**
100         * Gets the value of a specific configuration property.
101         *
102         * @param name Name of the property whose value is to be
103         *          retrieved
104         * @return Value of the configuration property
105         * @throws JAXRPCException if an invalid or
106         *     unsupported property name is passed.
107         */
108        public Object _getProperty(String name);
109    
110        /**
111         * Returns an <code>Iterator</code> view of the names of the properties
112         * that can be configured on this stub instance.
113         *
114         * @return Iterator for the property names of the type
115         *     <code>java.lang.String</code>
116         */
117        public Iterator _getPropertyNames();
118    }    // interface Stub
119