com.groiss.component
Class ApplicationContext
java.lang.Object
com.groiss.component.ApplicationContext
public class ApplicationContext
- extends java.lang.Object
Handling dependencies between applications. Register and retrieve
services.
Register a service with the method registerService, retrieve it with getService.
Services can be objects containing data or methods, urls. etc.
More than one application can register the same service. A preference value is
used to select the "best" implementation - the one with the highest number.
Normally, not more than two registrations of a service should exist: A default value
in the application that needs the service and a full implementation in another application.
It is a convention to give the default implementation the preference 10, the full implementation
the preference 100.
Method Summary |
static java.lang.Object |
getService(java.lang.String serviceid)
Get a service by id. |
static void |
registerService(java.lang.String serviceid,
java.lang.Object service,
int preference)
Register a service. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ApplicationContext
public ApplicationContext()
getService
public static java.lang.Object getService(java.lang.String serviceid)
- Get a service by id.
registerService
public static void registerService(java.lang.String serviceid,
java.lang.Object service,
int preference)
- Register a service.
@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.