Class AppContext

java.lang.Object
org.serviceconnector.ctx.AppContext

public final class AppContext extends Object
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 Details

    • communicatorsLock

      public static Object communicatorsLock
      The communicators lock. communicator lock.
    • attachedCommunicators

      public static AtomicInteger attachedCommunicators
      The attached communicators. current attached communicators.
    • otiScheduler

      public static ScheduledThreadPoolExecutor otiScheduler
      The executer, triggers all operation timeout for sending.
    • eci_cri_Scheduler

      public static ScheduledThreadPoolExecutor eci_cri_Scheduler
      The executer observes timeouts of services(ECI)/servers(CRI).
  • Method Details

    • init

      public static void init()
      Initialize the application context.
    • initCommands

      public static void initCommands(FlyweightCommandFactory commandFactory)
      Initializes the commands.
      Parameters:
      commandFactory - the command factory
    • getCommandFactory

      public static FlyweightCommandFactory getCommandFactory()
      Gets the command factory.
      Returns:
      the command factory
    • getConnectionFactory

      public static ConnectionFactory getConnectionFactory()
      Gets the connection factory.
      Returns:
      the connection factory
    • getEncoderDecoderFactory

      public static FlyweightEncoderDecoderFactory getEncoderDecoderFactory()
      Gets the encoder decoder factory.
      Returns:
      the encoder decoder factory
    • getEndpointFactory

      public static EndpointFactory getEndpointFactory()
      Gets the endpoint factory.
      Returns:
      the endpoint factory
    • getResponderRegistry

      public static ResponderRegistry getResponderRegistry()
      Gets the responder registry.
      Returns:
      the responder registry
    • getSrvServiceRegistry

      public static SrvServiceRegistry getSrvServiceRegistry()
      Gets the srv service registry.
      Returns:
      the srv service registry
    • getServerRegistry

      public static ServerRegistry getServerRegistry()
      Gets the server registry.
      Returns:
      the server registry
    • getServiceRegistry

      public static ServiceRegistry getServiceRegistry()
      Gets the service registry.
      Returns:
      the service registry
    • getSessionRegistry

      public static SessionRegistry getSessionRegistry()
      Gets the session registry.
      Returns:
      the session registry
    • getSubscriptionRegistry

      public static SubscriptionRegistry getSubscriptionRegistry()
      Gets the subscription registry.
      Returns:
      the subscription registry
    • getSCMPSessionCompositeRegistry

      public static SCMPSessionCompositeRegistry getSCMPSessionCompositeRegistry()
      Gets the SCMP session composite registry.
      Returns:
      the SCMP session composite registry
    • getCacheModuleRegistry

      public static CacheModuleRegistry getCacheModuleRegistry()
      Gets the cache modules registry.
      Returns:
      the cache modules registry
    • getSCCache

      public static SCCache getSCCache()
      Gets the SC cache.
      Returns:
      the SC cache
    • initConfiguration

      public static void initConfiguration(String configFile) throws Exception
      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

      public static BasicConfiguration getBasicConfiguration()
      Gets the basic configuration.
      Returns:
      the basic configuration
    • getSCCacheConfiguration

      public static SCCacheConfiguration getSCCacheConfiguration()
      Gets the SC cache configuration.
      Returns:
      the SC cache configuration
    • getResponderConfiguration

      public static ListenerListConfiguration getResponderConfiguration()
      Gets the responder configuration.
      Returns:
      the responder configuration
    • getRequesterConfiguration

      public static RemoteNodeListConfiguration getRequesterConfiguration()
      Gets the requester configuration.
      Returns:
      the requester configuration
    • getServiceConfiguration

      public static ServiceListConfiguration 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

      public static String dump() throws Exception
      dumps the entire application context.
      Returns:
      the string
      Throws:
      Exception - the exception