]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - cms/ui/internal/Activator.java
1 package org
.argeo
.cms
.ui
.internal
;
3 import org
.argeo
.api
.cms
.CmsState
;
4 import org
.osgi
.framework
.BundleActivator
;
5 import org
.osgi
.framework
.BundleContext
;
6 import org
.osgi
.util
.tracker
.ServiceTracker
;
8 public class Activator
implements BundleActivator
{
10 // avoid dependency to RWT OSGi
11 private final static String CONTEXT_NAME_PROP
= "contextName";
13 private static ServiceTracker
<CmsState
, CmsState
> nodeState
;
16 public void start(BundleContext bc
) throws Exception
{
18 // bc.registerService(ApplicationConfiguration.class, new MaintenanceUi(),
19 // LangUtils.dico(CONTEXT_NAME_PROP, "system"));
20 // bc.registerService(ApplicationConfiguration.class, new UserUi(), LangUtils.dico(CONTEXT_NAME_PROP, "user"));
22 nodeState
= new ServiceTracker
<>(bc
, CmsState
.class, null);
27 public void stop(BundleContext context
) throws Exception
{
28 if (nodeState
!= null) {
34 public static CmsState
getNodeState() {
35 return nodeState
.getService();