SAP NetWeaver '04

com.sap.netweaver.bc.rf.common.context
Class AccessContextFactory

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.common_api.jar]
java.lang.Object
  |
  +--com.sap.netweaver.bc.rf.util.context.AbstractContextFactory
        |
        +--com.sap.netweaver.bc.rf.util.context.AbstractIndependentThreadContextFactory
              |
              +--com.sap.netweaver.bc.rf.common.context.AccessContextFactory
All Implemented Interfaces:
IContextFactory

public class AccessContextFactory
extends AbstractIndependentThreadContextFactory

Context factory providing means to get and set the access context.


Fields inherited from class com.sap.netweaver.bc.rf.util.context.AbstractIndependentThreadContextFactory
inheritableThreadLocal
 
Constructor Summary
AccessContextFactory()
           
 
Method Summary
 IAccessContext getContext()
          Get actual context from stack of contexts.
 IAccessContext getContextOrNullIfUnavailable()
          Get actual context from stack of contexts.
static AccessContextFactory getInstance()
          Get singleton instance of this class.
 IAccessContext popContext()
          Get and remove actual context from the stack of contexts.
 void pushContext(IAccessContext context)
          Add new context to the top of the stack of contexts.
 void removeContext()
          Remove actual context including all other stacked contexts completely.
 void setContext(IAccessContext context)
          Replace actual context with new one in stack of contexts.
 
Methods inherited from class com.sap.netweaver.bc.rf.util.context.AbstractIndependentThreadContextFactory
getContextStack, getTypeUnsafeContext, getTypeUnsafeContextOrNullIfUnavailable, isAvailable, popTypeUnsafeContext, pushTypeUnsafeContext, removeTypeUnsafeContext, setContextStack, setTypeUnsafeContext, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessContextFactory

public AccessContextFactory()
Method Detail

getInstance

public static AccessContextFactory getInstance()
Get singleton instance of this class.
Returns:
singleton instance of this class

getContext

public IAccessContext getContext()
                          throws ContextUnavailableException
Get actual context from stack of contexts.
Returns:
actual context on the context stack
Throws:
ContextUnavailableException - when no (more) context is available on the context stack

getContextOrNullIfUnavailable

public IAccessContext getContextOrNullIfUnavailable()
Get actual context from stack of contexts. Return null if none is availble and don't throw a ContextUnavailableException.
Returns:
actual context on the context stack

setContext

public void setContext(IAccessContext context)
Replace actual context with new one in stack of contexts. If no context is stored, this one will be added.
Parameters:
context - new actual context replacing the old one on the stack

removeContext

public void removeContext()
Remove actual context including all other stacked contexts completely.

popContext

public IAccessContext popContext()
                          throws ContextUnavailableException
Get and remove actual context from the stack of contexts.
Returns:
last actual context on the context stack
Throws:
ContextUnavailableException - when no (more) context is available on the context stack

pushContext

public void pushContext(IAccessContext context)
Add new context to the top of the stack of contexts.
Parameters:
context - new actual context

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.