|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.kernel.KernelContext
class KernelContext
This is the implementation of KernelAppContext used by
the kernel to manage the context of a single application. It knows
the name of an application, its available managers, and its backing
services.
FIXME: the context should check that it isn't shutdown before
handing out services and managers
| Field Summary | |
|---|---|
protected ComponentRegistry |
managerComponents
|
protected ComponentRegistry |
serviceComponents
|
| Constructor Summary | |
|---|---|
(package private) |
KernelContext(KernelContext context)
Creates an instance of KernelContext based on the
components that have already been collected in another instance. |
protected |
KernelContext(String applicationName,
ComponentRegistry serviceComponents,
ComponentRegistry managerComponents)
Creates an instance KernelContext with the given name
and components. |
| Method Summary | ||
|---|---|---|
(package private) ChannelManager |
getChannelManager()
Returns the ChannelManager used in this context. |
|
(package private) DataManager |
getDataManager()
Returns the DataManager used in this context. |
|
(package private)
|
getManager(Class<T> type)
Returns a manager based on the given type. |
|
(package private)
|
getService(Class<T> type)
Returns a Service based on the given type. |
|
(package private) TaskManager |
getTaskManager()
Returns the TaskManager used in this context. |
|
(package private) void |
notifyReady()
Notifies all included Services that the system is now ready. |
|
(package private) void |
shutdownServices()
Shut down all the service components in the reverse order that they were added. |
|
String |
toString()
Returns a unique representation of this context, in this case the name of the application. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final ComponentRegistry managerComponents
protected final ComponentRegistry serviceComponents
| Constructor Detail |
|---|
KernelContext(KernelContext context)
KernelContext based on the
components that have already been collected in another instance.
context - the existing KernelContext to use as a
source of components
protected KernelContext(String applicationName,
ComponentRegistry serviceComponents,
ComponentRegistry managerComponents)
KernelContext with the given name
and components. This is used by sub-classes to create an instance
that can be provided components as needed by adding to the provided
ComponentRegistry instances.
applicationName - the name of the application represented by
this contextserviceComponents - the services available in this contextmanagerComponents - the managers available in this context| Method Detail |
|---|
ChannelManager getChannelManager()
ChannelManager used in this context.
ChannelManagerDataManager getDataManager()
DataManager used in this context.
DataManagerTaskManager getTaskManager()
TaskManager used in this context.
TaskManager<T> T getManager(Class<T> type)
ManagerNotFoundException is thrown. This may be used
to find any available manager, including the three standard
managers.
type - the Class of the requested manager
ManagerNotFoundException - if there wasn't exactly one match to
the requested type<T extends Service> T getService(Class<T> type)
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 - the Class of the requested Service
Service
MissingResourceException - if there wasn't exactly one match to
the requested type
void notifyReady()
throws Exception
Exception - if there is any failure during notificationvoid shutdownServices()
public String toString()
toString in class ObjectString representation of the context
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||