com.pentagaia.tb.start
Interface IPdsAppKernelAppContext


public interface IPdsAppKernelAppContext

Interface for custom app kernel app context classes

Since:
0.1.0
Version:
0.1.0
Author:
mepeisen

Method Summary
 Object getChannelManager()
          Returns the ChannelManager used in this context.
 Object getDataManager()
          Returns the DataManager used in this context.
<T> T
getManager(Class<T> type)
          Returns a manager based on the given type.
<T> T
getService(Class<T> type)
          Returns a Service based on the given type.
 Object getTaskManager()
          Returns the TaskManager used in this context.
 void initialize(String applicationName, Set<Object> services, Set<Object> managers)
          Initializes the app context.
 Iterable<Object> listManagers()
          Lists all managers
 Iterable<Object> listServices()
          Lists all services
 void shutdownServices()
          Shut down all the service components in the reverse order that they were added.
 

Method Detail

initialize

void initialize(String applicationName,
                Set<Object> services,
                Set<Object> managers)
Initializes the app context.

Parameters:
applicationName - the application name
services - the services list
managers - the managers list
Throws:
IllegalStateException - thrown if the app context was initialized before (duplicate method invocation).

getChannelManager

Object getChannelManager()
Returns the ChannelManager used in this context.

Returns:
the context's ChannelManager

getDataManager

Object getDataManager()
Returns the DataManager used in this context.

Returns:
the context's DataManager

getTaskManager

Object getTaskManager()
Returns the TaskManager used in this context.

Returns:
the context's TaskManager

getManager

<T> T getManager(Class<T> type)
Returns a manager based on the given type. If the manager type is unknown, or if there is more than one manager of the given type, ManagerNotFoundException is thrown. This may be used to find any available manager, including the three standard managers.

Type Parameters:
T - the Class of the requested Service
Parameters:
type - the Class of the requested manager
Returns:
the requested manager
Throws:
ManagerNotFoundException - if there wasn't exactly one match to the requested type

getService

<T> T getService(Class<T> type)
Returns a Service based on the given type. If the type is unknown, or if there is more than one Service of the given type, MissingResourceException is thrown. This is the only way to resolve service components directly, and should be used with care, as Services should not be resolved and invoked directly outside of a transactional context.

Type Parameters:
T - the Class of the requested Service
Parameters:
type - the Class of the requested Service
Returns:
the requested Service
Throws:
MissingResourceException - if there wasn't exactly one match to the requested type

shutdownServices

void shutdownServices()
Shut down all the service components in the reverse order that they were added.


listServices

Iterable<Object> listServices()
Lists all services

Returns:
services iterator

listManagers

Iterable<Object> listManagers()
Lists all managers

Returns:
managers iterator


Copyright © 2008. All Rights Reserved.