Sun Java System Portal Server Mobile Access 7.1 Developer's Guide

Creating Custom Subclasses

This section presents guidelines that you should follow when deriving your own classes from Context or ContextCache.

public static <YOUR_SUBCLASS_NAME> getContext(PageContext

pageContext)throws Exception

{

return (<YOUR_SUBCLASS_NAME>) Context.getContext(pageContext,

CONTEXT_CLASS_NAME,CONTEXT_CACHE_CLASS_NAME,CONTEXT_TYPE);

}

return (ABContext) Context.getContext(pageContext,

CONTEXT_CLASS_NAME,CONTEXT_CACHE_CLASS_NAME,CONTEXT_TYPE);


// Inside a Context subclass
public void init(HttpServletRequest request, SSOToken session,
SSOAdapter ssoAdapter) throws Exception{

super.init(request,session,<your_custom_service_name>,ssoAdapter);


... // your app-specific code from here on

Failure to do so will prevent the context from being initialized correctly.


package com.whatever.im;

import com.sun.portal.wireless.taglibs.base.*;

public class IMContextCache extends ContextCache { }