@Override
        public String put(String key, String value) {
            Map<String,Object> eventParams = new HashMap<>();
            String answer;
            String keyString = key;

            try {
                synchronized ((getName() + keyString).intern()) {
                    if (properties.containsKey(keyString)) {
                        String originalValue = properties.get(keyString);
                        answer = properties.put(keyString, value);
                        UserManager.getUserPropertyProvider().updateProperty(username, keyString, value);
                        // Configure event.
                        eventParams.put("type", "propertyModified");
                        eventParams.put("propertyKey", key);
                        eventParams.put("originalValue", originalValue);
                    }
                    else {
                        answer = properties.put(keyString, value);
                        UserManager.getUserPropertyProvider().insertProperty(username, keyString, value);
                        // Configure event.
                        eventParams.put("type", "propertyAdded");
                        eventParams.put("propertyKey", key);
                    }
                }

                // Fire event.
                UserEventDispatcher.dispatchEvent(User.this,
                                                  UserEventDispatcher.EventType.user_modified, eventParams);
                return answer;
            } catch (UserNotFoundException e ) {
                Log.error( "Unable to put property for user " + username, e );
            }
            return null;
        }
Map implementation that updates the database when properties are modified.
xmppserver/src/main/java/org/jivesoftware/openfire/user/User.java