Package org.serviceconnector.ctx
Class AppContext
java.lang.Object
org.serviceconnector.ctx.AppContext
The Class AppContext. The AppContext is singleton and holds all factories and registries. Its the top context in a service connector, server or even in clients. Its a superset
of the specific contexts and unifies the data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic AtomicIntegerThe attached communicators. current attached communicators.static ObjectThe communicators lock. communicator lock.static ScheduledThreadPoolExecutorThe executer observes timeouts of services(ECI)/servers(CRI).static ScheduledThreadPoolExecutorThe executer, triggers all operation timeout for sending. -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddestroy()Destroy the whole application context and release resources.static Stringdump()dumps the entire application context.static org.apache.commons.configuration2.CompositeConfigurationGets the apache composite config.static BasicConfigurationGets the basic configuration.static CacheModuleRegistryGets the cache modules registry.static FlyweightCommandFactoryGets the command factory.static ConnectionFactoryGets the connection factory.Gets the encoder decoder factory.static EndpointFactoryGets the endpoint factory.static io.netty.util.concurrent.EventExecutorGroupGets the ordered SC worker thread pool.static RemoteNodeListConfigurationGets the requester configuration.static ListenerListConfigurationGets the responder configuration.static ResponderRegistryGets the responder registry.static SCCacheGets the SC cache.static SCCacheConfigurationGets the SC cache configuration.static SCMPSessionCompositeRegistryGets the SCMP session composite registry.static io.netty.util.concurrent.EventExecutorGroupGets the SC worker thread pool.static ServerRegistryGets the server registry.static ServiceListConfigurationGets the service configuration.static ServiceRegistryGets the service registry.static SessionRegistryGets the session registry.static SrvServiceRegistryGets the srv service registry.static SubscriptionRegistryGets the subscription registry.static voidinit()Initialize the application context.static voidInitialize after configuration load.static voidinitCommands(FlyweightCommandFactory commandFactory) Initializes the commands.static voidinitConfiguration(String configFile) Initializes the configuration.static booleanChecks if is sc environment.static voidsetSCEnvironment(boolean scEnvironment) Sets the sC environment.
-
Field Details
-
communicatorsLock
The communicators lock. communicator lock. -
attachedCommunicators
The attached communicators. current attached communicators. -
otiScheduler
The executer, triggers all operation timeout for sending. -
eci_cri_Scheduler
The executer observes timeouts of services(ECI)/servers(CRI).
-
-
Method Details
-
init
public static void init()Initialize the application context. -
initCommands
Initializes the commands.- Parameters:
commandFactory- the command factory
-
getCommandFactory
Gets the command factory.- Returns:
- the command factory
-
getConnectionFactory
Gets the connection factory.- Returns:
- the connection factory
-
getEncoderDecoderFactory
Gets the encoder decoder factory.- Returns:
- the encoder decoder factory
-
getEndpointFactory
Gets the endpoint factory.- Returns:
- the endpoint factory
-
getResponderRegistry
Gets the responder registry.- Returns:
- the responder registry
-
getSrvServiceRegistry
Gets the srv service registry.- Returns:
- the srv service registry
-
getServerRegistry
Gets the server registry.- Returns:
- the server registry
-
getServiceRegistry
Gets the service registry.- Returns:
- the service registry
-
getSessionRegistry
Gets the session registry.- Returns:
- the session registry
-
getSubscriptionRegistry
Gets the subscription registry.- Returns:
- the subscription registry
-
getSCMPSessionCompositeRegistry
Gets the SCMP session composite registry.- Returns:
- the SCMP session composite registry
-
getCacheModuleRegistry
Gets the cache modules registry.- Returns:
- the cache modules registry
-
getSCCache
Gets the SC cache.- Returns:
- the SC cache
-
initConfiguration
Initializes the configuration.- Parameters:
configFile- the configuration file- Throws:
Exception- the exception
-
getApacheCompositeConfig
public static org.apache.commons.configuration2.CompositeConfiguration getApacheCompositeConfig()Gets the apache composite config.- Returns:
- the apache composite config
-
getBasicConfiguration
Gets the basic configuration.- Returns:
- the basic configuration
-
getSCCacheConfiguration
Gets the SC cache configuration.- Returns:
- the SC cache configuration
-
getResponderConfiguration
Gets the responder configuration.- Returns:
- the responder configuration
-
getRequesterConfiguration
Gets the requester configuration.- Returns:
- the requester configuration
-
getServiceConfiguration
Gets the service configuration.- Returns:
- the service configuration
-
setSCEnvironment
public static void setSCEnvironment(boolean scEnvironment) Sets the sC environment.- Parameters:
scEnvironment- the new sC environment
-
isScEnvironment
public static boolean isScEnvironment()Checks if is sc environment.- Returns:
- true, if is sc environment
-
getSCWorkerThreadPool
public static io.netty.util.concurrent.EventExecutorGroup getSCWorkerThreadPool()Gets the SC worker thread pool.- Returns:
- the SC worker thread pool
-
getOrderedSCWorkerThreadPool
public static io.netty.util.concurrent.EventExecutorGroup getOrderedSCWorkerThreadPool()Gets the ordered SC worker thread pool.- Returns:
- the ordered SC worker thread pool
-
destroy
public static void destroy()Destroy the whole application context and release resources. -
initAfterConfigurationLoad
public static void initAfterConfigurationLoad()Initialize after configuration load. Some things we need to set up new. Loaded configuration may have affects. -
dump
dumps the entire application context.- Returns:
- the string
- Throws:
Exception- the exception
-