]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms.ui/src/org/argeo/cms/ui/internal/Activator.java
1 package org
.argeo
.cms
.ui
.internal
;
3 import org
.argeo
.cms
.maintenance
.MaintenanceUi
;
4 import org
.argeo
.cms
.ui
.internal
.rwt
.UserUi
;
5 import org
.argeo
.node
.NodeState
;
6 import org
.argeo
.util
.LangUtils
;
7 import org
.eclipse
.rap
.rwt
.application
.ApplicationConfiguration
;
8 import org
.osgi
.framework
.BundleActivator
;
9 import org
.osgi
.framework
.BundleContext
;
10 import org
.osgi
.util
.tracker
.ServiceTracker
;
12 public class Activator
implements BundleActivator
{
14 // avoid dependency to RWT OSGi
15 private final static String CONTEXT_NAME_PROP
= "contextName";
17 private static ServiceTracker
<NodeState
, NodeState
> nodeState
;
20 public void start(BundleContext bc
) throws Exception
{
22 bc
.registerService(ApplicationConfiguration
.class, new MaintenanceUi(),
23 LangUtils
.dico(CONTEXT_NAME_PROP
, "system"));
24 bc
.registerService(ApplicationConfiguration
.class, new UserUi(), LangUtils
.dico(CONTEXT_NAME_PROP
, "user"));
26 nodeState
= new ServiceTracker
<>(bc
, NodeState
.class, null);
31 public void stop(BundleContext context
) throws Exception
{
32 if (nodeState
!= null) {
38 public static NodeState
getNodeState() {
39 return nodeState
.getService();