Search in sources :

Example 1 with SharedContextChangedNotification

use of org.eclipse.scout.rt.shared.services.common.context.SharedContextChangedNotification in project scout.rt by eclipse.

the class AbstractServerSession method initConfig.

protected void initConfig() {
    m_sharedVariableMap.addPropertyChangeListener(new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent e) {
            if (IClientNodeId.CURRENT.get() != null) {
                String sessionId = getId();
                if (sessionId != null) {
                    SharedContextChangedNotification notification = new SharedContextChangedNotification(new SharedVariableMap(m_sharedVariableMap));
                    BEANS.get(ClientNotificationRegistry.class).putTransactionalForSession(sessionId, notification);
                } else {
                    LOG.warn("No sessionId set");
                }
            }
        }
    });
    if (m_initialized) {
        return;
    }
    m_initialized = true;
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) SharedContextChangedNotification(org.eclipse.scout.rt.shared.services.common.context.SharedContextChangedNotification) SharedVariableMap(org.eclipse.scout.rt.shared.services.common.context.SharedVariableMap)

Aggregations

PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 SharedContextChangedNotification (org.eclipse.scout.rt.shared.services.common.context.SharedContextChangedNotification)1 SharedVariableMap (org.eclipse.scout.rt.shared.services.common.context.SharedVariableMap)1