public class TelegramScope extends Object implements org.springframework.beans.factory.config.Scope
The bean lifetime after the last call can be redefined using the property TelegramConfigurationProperties.getSessionSeconds().
Note: All TelegramSession instances have this scope by
default.
TelegramScopeException| Modifier and Type | Method and Description |
|---|---|
Object |
get(String name,
org.springframework.beans.factory.ObjectFactory<?> objectFactory) |
String |
getConversationId() |
void |
registerDestructionCallback(String name,
Runnable callback) |
Object |
remove(String name) |
Object |
resolveContextualObject(String key) |
public static final String SCOPE
@NonNull public Object get(@NonNull String name, @NonNull org.springframework.beans.factory.ObjectFactory<?> objectFactory) throws TelegramScopeException
get in interface org.springframework.beans.factory.config.ScopeTelegramScopeExceptionpublic Object remove(@NonNull String name)
remove in interface org.springframework.beans.factory.config.Scopepublic void registerDestructionCallback(@NonNull
String name,
@NonNull
Runnable callback)
registerDestructionCallback in interface org.springframework.beans.factory.config.Scopepublic Object resolveContextualObject(@NonNull String key)
resolveContextualObject in interface org.springframework.beans.factory.config.Scopepublic String getConversationId()
getConversationId in interface org.springframework.beans.factory.config.ScopeCopyright © 2022. All rights reserved.