⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 messagecontext.java

📁 Java有关XML编程需要用到axis 的源代码 把里面bin下的包导入相应的Java工程 进行使用
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
     *     * @return the soap constants     */    public SOAPConstants getSOAPConstants() {        return soapConstants;    }    /**     * Set the <code>SOAPConstants</code> used by this message context.     * This may also affect the encoding style.     *     * @param soapConstants  the new soap constants to use     */    public void setSOAPConstants(SOAPConstants soapConstants) {        // when changing SOAP versions, remember to keep the encodingURI        // in synch.        if (this.soapConstants.getEncodingURI().equals(encodingStyle)) {            encodingStyle = soapConstants.getEncodingURI();        }        this.soapConstants = soapConstants;    }    /**     * Get the XML schema version information.     *     * @return the <code>SchemaVersion</code> in use     */    public SchemaVersion getSchemaVersion() {        return schemaVersion;    }    /**     * Set the XML schema version this message context will use.     *     * @param schemaVersion  the new <code>SchemaVersion</code>     */    public void setSchemaVersion(SchemaVersion schemaVersion) {        this.schemaVersion = schemaVersion;    }    /**     * Get the current session.     *     * @return the <code>Session</code> this message context is within     */    public Session getSession()    {        return session;    }    /**     * Set the current session.     *     * @param session  the new <code>Session</code>     */    public void setSession(Session session)    {        this.session = session;    }    /**     * Indicates if the opration is encoded.     *     * @return <code>true</code> if it is encoded, <code>false</code> otherwise     */    public boolean isEncoded() {        return (getOperationUse() == Use.ENCODED);        //return soapConstants.getEncodingURI().equals(encodingStyle);    }    /**     * Set whether we are maintaining session state.     *     * @param yesno flag to set to <code>true</code> to maintain sessions     */    public void setMaintainSession (boolean yesno) {        maintainSession = yesno;    }    /**     * Discover if we are maintaining session state.     *     * @return <code>true</code> if we are maintaining state, <code>false</code>     *              otherwise     */    public boolean getMaintainSession () {        return maintainSession;    }    /**     * Get the request message.     *     * @return the request message (may be null).     */    public Message getRequestMessage() {        return requestMessage ;    }    /**     * Set the request message, and make sure that message is associated     * with this MessageContext.     *     * @param reqMsg the new request Message.     */    public void setRequestMessage(Message reqMsg) {        requestMessage = reqMsg ;        if (requestMessage != null) {            requestMessage.setMessageContext(this);        }    }    /**     * Get the response message.     *     * @return the response message (may be null).     */    public Message getResponseMessage() { return responseMessage ; }    /**     * Set the response message, and make sure that message is associated     * with this MessageContext.     *     * @param respMsg the new response Message.     */    public void setResponseMessage(Message respMsg) {        responseMessage = respMsg;        if (responseMessage != null) {            responseMessage.setMessageContext(this);            //if we have received attachments of a particular type            // than that should be the default type to send.            Message reqMsg = getRequestMessage();            if (null != reqMsg) {                Attachments reqAttch = reqMsg.getAttachmentsImpl();                Attachments respAttch = respMsg.getAttachmentsImpl();                if (null != reqAttch && null != respAttch) {                    if (respAttch.getSendType() == Attachments.SEND_TYPE_NOTSET)                        //only if not explicity set.                        respAttch.setSendType(reqAttch.getSendType());                }            }        }    }    /**     * Return the current (i.e. request before the pivot, response after)     * message.     *     * @return the current <code>Message</code>     */    public Message getCurrentMessage()    {        return (havePassedPivot ? responseMessage : requestMessage);    }    /**     *  Gets the SOAPMessage from this message context.     *     *  @return the <code>SOAPMessage</code>, <code>null</code> if no request     *          <code>SOAPMessage</code> is present in this     *          <code>SOAPMessageContext</code>     */    public javax.xml.soap.SOAPMessage getMessage() {        return getCurrentMessage();    }    /**     * Set the current message. This will set the request before the pivot,     * and the response afterwards, as guaged by the passedPivod property.     *     * @param curMsg  the <code>Message</code> to assign     */    public void setCurrentMessage(Message curMsg)    {        if ( curMsg != null )            curMsg.setMessageContext(this);        if (havePassedPivot) {            responseMessage = curMsg;        } else {            requestMessage = curMsg;        }    }    /**     * Sets the SOAPMessage for this message context.     * This is equivalent to casting <code>message</code> to     * <code>Message</code> and then passing it on to     * <code>setCurrentMessage()</code>.     *     * @param message  the <code>SOAPMessage</code> this context is for     */    public void setMessage(javax.xml.soap.SOAPMessage message) {        setCurrentMessage((Message)message);    }    /**     * Determine when we've passed the pivot.     *     * @return <code>true</code> if we have, <code>false</code> otherwise     */    public boolean getPastPivot()    {        return havePassedPivot;    }    // fixme: is there any legitimate case where we could pass the pivot and    //  then go back again? Is there documentation about the life-cycle of a    //  MessageContext, and in particular the re-use of instances that would be    //  relevant?    /**     * Indicate when we've passed the pivot.     *     * @param pastPivot  true if we are past the pivot point, false otherwise     */    public void setPastPivot(boolean pastPivot)    {        havePassedPivot = pastPivot;    }    /**     * Set timeout in our MessageContext.     *     * @param value the maximum amount of time, in milliseconds     */    public void setTimeout (int value) {        timeout = value;    }    /**     * Get timeout from our MessageContext.     *     * @return value the maximum amount of time, in milliseconds     */    public int getTimeout () {        return timeout;    }    /**     * Get the classloader, implicitly binding to the thread context     * classloader if an override has not been supplied.     *     * @return the class loader     */    public ClassLoader getClassLoader() {        if ( classLoader == null ) {            classLoader = Thread.currentThread().getContextClassLoader();        }        return( classLoader );    }    /**     * Set a new classloader. Setting to null will result in getClassLoader()     * binding back to the thread context class loader.     *     * @param cl    the new <code>ClassLoader</code> or <code>null</code>     */    public void setClassLoader(ClassLoader cl ) {        classLoader = cl ;    }    /**     * Get the name of the targed service for this message.     *     * @return the target service     */    public String getTargetService() {        return targetService;    }    /**     * Get the axis engine. This will be <code>null</code> if the message was     * created outside an engine     *     * @return the current axis engine     */    public AxisEngine getAxisEngine()    {        return axisEngine;    }    /**     * Set the target service for this message.     * <p>     * This looks up the named service in the registry, and has     * the side effect of setting our TypeMappingRegistry to the     * service's.     *     * @param tServ the name of the target service     * @throws AxisFault  if anything goes wrong in resolving or setting the     *              service     */    public void setTargetService(String tServ) throws AxisFault {        log.debug("MessageContext: setTargetService(" + tServ+")");        if (tServ == null) {            setService(null);        }        else {            try {                setService(getAxisEngine().getService(tServ));            } catch (AxisFault fault) {                // If we're on the client, don't throw this fault...                if (!isClient()) {                    throw fault;                }            }        }        targetService = tServ;    }    /** ServiceHandler is the handler that is the "service".  This handler     * can (and probably will actually be a chain that contains the     * service specific request/response/pivot point handlers     */    private SOAPService serviceHandler ;    /**     * Get the <code>SOAPService</code> used to handle services in this     * context.     *     * @return the service handler     */    public SOAPService getService() {        return  serviceHandler;    }    /**     * Set the <code>SOAPService</code> used to handle services in this     * context. This method configures a wide range of     * <code>MessageContext</code> properties to suit the handler.     *     * @param sh the new service handler     * @throws AxisFault if the service could not be set     */    public void setService(SOAPService sh) throws AxisFault    {        log.debug("MessageContext: setServiceHandler("+sh+")");        serviceHandler = sh;        if (sh != null) {            if(!sh.isRunning()) {                throw new AxisFault(Messages.getMessage("disabled00"));            }            targetService = sh.getName();            SOAPService service = sh;            TypeMappingRegistry tmr = service.getTypeMappingRegistry();            setTypeMappingRegistry(tmr);            // styles are not "soap version aware" so compensate...            setEncodingStyle(service.getUse().getEncoding());            // This MessageContext should now defer properties it can't find            // to the Service's options.            bag.setParent(sh.getOptions());            // Note that we need (or don't need) high-fidelity SAX recording            // of deserialized messages according to the setting on the            // new service.            highFidelity = service.needsHighFidelityRecording();            service.getInitializedServiceDesc(this);        }    }    /**     * Let us know whether this is the client or the server.     *     * @return true if we are a client     */    public boolean isClient()    {        return (axisEngine instanceof AxisClient);    }    // fixme: public final statics tend to go in a block at the top of the    //  class deffinition, not marooned in the middle    // fixme: chose public static final /or/ public final static    /** Contains an instance of Handler, which is the     *  ServiceContext and the entrypoint of this service.     *     *  (if it has been so configured - will our deployment     *   tool do this by default?  - todo by Jacek)     */    public static final String ENGINE_HANDLER      = "engine.handler";    /** This String is the URL that the message came to.     */    public static final String TRANS_URL           = "transport.url";    /** Has a quit been requested? Hackish... but useful... -- RobJ */    public static final String QUIT_REQUESTED = "quit.requested";    /** Place to store an AuthenticatedUser. */    public static final String AUTHUSER            = "authenticatedUser";    /** If on the client - this is the Call object. */    public static final String CALL                = "call_object" ;    /** Are we doing Msg vs RPC? - For Java Binding. */    public static final String IS_MSG              = "isMsg" ;    /** The directory where in coming attachments are created. */    public static final String ATTACHMENTS_DIR   = "attachments.directory" ;    /** A boolean param, to control whether we accept missing parameters     * as nulls or refuse to acknowledge them.     */    public final static String ACCEPTMISSINGPARAMS = "acceptMissingParams";    /** The value of the property is used by service WSDL generation (aka ?WSDL)     * For the service's interface namespace if not set TRANS_URL property is used.     */    public static final String WSDLGEN_INTFNAMESPACE      = "axis.wsdlgen.intfnamespace";    /** The value of the property is used by service WSDL generation (aka ?WSDL).     * For the service's location if not set TRANS_URL property is used.     *  (helps provide support through proxies.     */    public static final String WSDLGEN_SERV_LOC_URL      = "axis.wsdlgen.serv.loc.url";    // fixme: should this be a type-safe e-num?    /** The value of the property is used by service WSDL generation (aka ?WSDL).     *  Set this property to request a certain level of HTTP.     *  The values MUST use org.apache.axis.transport.http.HTTPConstants.HEADER_PROTOCOL_10     *    for HTTP 1.0     *  The values MUST use org.apache.axis.transport.http.HTTPConstants.HEADER_PROTOCOL_11     *    for HTTP 1.1     */    public static final String HTTP_TRANSPORT_VERSION  = "axis.transport.version";    // fixme: is this the name of a security provider, or the name of a security    //  provider class, or the actualy class of a security provider, or    //  something else?    /**     * The security provider.     */    public static final String SECURITY_PROVIDER = "securityProvider";    /*     * IMPORTANT.     * If adding any new constants to this class. Make them final. The     * ones above are left non-final for compatibility reasons.     */    /**     * Get a <code>String</code> property by name.     *     * @param propName the name of the property to fetch     * @return the value of the named property     * @throws ClassCastException if the property named does not have a     *              <code>String</code> value     */    public String getStrProp(String propName) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -