blackboard.platform.context
Interface ContextManager


public interface ContextManager

Service that manages the Context used by service APIs for information about the current user, virtual installation, etc.

Proper usage is to ensure that setContext is called before any service APIs are invoked. Failure to do so may result in UnsetContextException to be thrown.

Additionally, releaseContext must be called for every setContext must be called.

Since:
Blackboard 6.0
Version:
$Revision: #1 $ $Date: 2005/06/27 $

Method Summary
 Context getContext()
          Retrieves the current context previously set via setContext(HttpServletRequest).
 void purgeContext()
          Releases the current context and flushes it from thread local storage.
 void releaseContext()
          Releases the current context.
 Context setContext(javax.servlet.http.HttpServletRequest request)
          High-level API that must be called to ensure that proper Context data is parsed from the current HTTP request.
 Context setContext(Id virtualHostId, Id courseId, Id userId, Id groupId, Id contentId)
           
 

Method Detail

getContext

Context getContext()
                   throws UnsetContextException
Retrieves the current context previously set via setContext(HttpServletRequest). The default server implementation uses thread-based storage to retrieve the correct Context.

Returns:
Current context
Throws:
UnsetContextException

setContext

Context setContext(javax.servlet.http.HttpServletRequest request)
High-level API that must be called to ensure that proper Context data is parsed from the current HTTP request.

Parameters:
request - current HTTP request
Returns:
Parsed context object.

setContext

Context setContext(Id virtualHostId,
                   Id courseId,
                   Id userId,
                   Id groupId,
                   Id contentId)

releaseContext

void releaseContext()
Releases the current context. The default server implementation performs reference counting to ensure that the context is not released until all objects that requested it have released it.


purgeContext

void purgeContext()
Releases the current context and flushes it from thread local storage. Note:This method should only be called if you are certain that no other API calls will be made in the scope of the current service request.



Copyright © 2003 Blackboard, Inc. All Rights Reserved.