A Scope is also used as a lattice element for flow-sensitive type inference. As a lattice element, a Scope is viewed as a map from names to types. A name not in the map is considered to have the bottom type. The join of two maps m1 and m2 is the map of the union of names with {@link JSType#getLeastSupertype}to meet the m1 type and m2 type. @see NodeTraversal @see DataFlowAnalysis
Example scope from OpenID Connect indicating access to the user's email and profile details:
Scope scope = new Scope(); scope.add(OIDCScopeValue.OPENID); scope.add(OIDCScopeValue.EMAIL); scope.add(OIDCScopeValue.PROFILE);
Related specifications:
A Scope does not itself contain the details of the elements corresponding to the parameters, methods and fields of the methods and classes containing its position. However, these elements can be determined from the enclosing elements.
Scopes may be contained in an enclosing scope. The outermost scope contains those elements available via "star import" declarations; the scope within that contains the top level elements of the compilation unit, including any named imports. @since 1.6
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Scopes are instantiated once on their first usage and stored within one container.
Scope
class abstracts the lock scope as defined by RFC 2518.
String[] onProvideCompletionsFromMyField(String input) { return . . .; }
The following features are supported:
An example of a scope is {@link Scopes#SINGLETON}. @author crazybob@google.com (Bob Lee)
a type could be matter type, event type, etc
@author mugoA stateful object shared between a group of clients connected to the same context path. Scopes are arranged in a hierarchical way, so a scope always has a parent unless its a "global" scope. If a client is connected to a scope then they are also connected to its parent scope. The scope object is used to access resources, shared object, streams, etc.
Scope layout:
/Global scope - Contains application scopes /Application scope - Contains room, shared object, and stream scopes /Room scope - Contains other room, shared object, and / or stream scopes /Shared object scope - Contains shared object /Broadcast stream scope - Contains a broadcast stream@author The Red5 Project @author Paul Gregoire (mondain@gmail.com) @author Nathan Smith (nathgs@gmail.com)
{@link org.springframework.context.ApplicationContext} implementationssuch as a {@link org.springframework.web.context.WebApplicationContext}may register additional standard scopes specific to their environment, e.g. {@link org.springframework.web.context.WebApplicationContext#SCOPE_REQUEST "request"}and {@link org.springframework.web.context.WebApplicationContext#SCOPE_SESSION "session"}, based on this Scope SPI.
Even if its primary use is for extended scopes in a web environment, this SPI is completely generic: It provides the ability to get and put objects from any underlying storage mechanism, such as an HTTP session or a custom conversation mechanism. The name passed into this class's get
and remove
methods will identify the target object in the current scope.
Scope
implementations are expected to be thread-safe. One Scope
instance can be used with multiple bean factories at the same time, if desired (unless it explicitly wants to be aware of the containing BeanFactory), with any number of threads accessing the Scope
concurrently from any number of factories.
@author Juergen Hoeller
@author Rob Harrop
@since 2.0
@see ConfigurableBeanFactory#registerScope
@see CustomScopeConfigurer
@see org.springframework.aop.scope.ScopedProxyFactoryBean
@see org.springframework.web.context.request.RequestScope
@see org.springframework.web.context.request.SessionScope
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|