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

Class AccessContextFactory

java.lang.Object
  extended by com.sap.netweaver.bc.rf.util.context.AbstractContextFactory
      extended by com.sap.netweaver.bc.rf.util.context.AbstractIndependentThreadContextFactory
          extended by 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.


Field Summary
 
Fields inherited from class com.sap.netweaver.bc.rf.util.context.AbstractIndependentThreadContextFactory
threadLocal
 
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
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2011 SAP AG Complete Copyright Notice