FileDocCategorySizeDatePackage
RMDemoImpl.javaAPI DocExample3850Tue May 29 16:57:52 BST 2007rmdemo.server

RMDemoImpl

public class RMDemoImpl extends Object

Fields Summary
private final com.sun.xml.ws.runtime.util.SessionManager
sessionManager
private WebServiceContext
context
Constructors Summary
Methods Summary
public voidaddString(java.lang.String s)

        /* append string to session data */
        setSessionData(getSessionData() + " " + s);
    
public java.lang.StringgetResult()

        /* return session data */
        return getSessionData();
    
private java.lang.StringgetSessionData()

        String id = getSessionId();
        Hashtable userData = (Hashtable)sessionManager.getSession(id).getUserData();
       String ret = (String)userData.get(id);
        return ret != null ? ret : "";

    
private java.lang.StringgetSessionId()


    /* Get SesssionId using well-known key in MessageContext */
       
        return (String)context.getMessageContext()
                .get("com.sun.xml.ws.sessionid");

    
private voidsetSessionData(java.lang.String data)

        String id = getSessionId();
        com.sun.xml.ws.runtime.util.Session session = sessionManager.getSession(id);
        Hashtable table = (Hashtable)session.getUserData()   ;
        table.put(id,data);