Add a callback for a Bean message type.

@param type      The {@link com.punchthrough.bean.sdk.internal.BeanMessageID} the callback
will answer to
@param callback  The callback to store
175501
private void addCallback(BeanMessageID type, Callback<?> callback) {
        List<Callback<?>> callbacks = beanCallbacks.get(type);
        if (callbacks == null) {
            callbacks = new ArrayList<>(16);
            beanCallbacks.put(type, callbacks);
        }
        callbacks.add(callback);
    }
355362
function(type, callback) {
        var list = this.__hooks[type] || [];
            list.push(callback);

        this.__hooks[type] = list;
    }
1045338
protected function call( $type, $params ) {
		if ( !isset( $this->callbacks[$type] ) ) {
			return;
		}
		foreach ( $this->callbacks[$type] as $callback ) {
			if ( is_callable( $callback ) ) {
				call_user_func_array( $callback, $params );
			}
		}
	}
313111
public void         add(Type type, String message, Throwable exception)
    {
        String          queueMessage = message;
        if ( (type == Type.ERROR) && (exception != null) )
        {
            queueMessage += " (" + getExceptionMessage(exception) + ")";
        }

        if ( type.addToUI() )
        {
            while ( queue.size() > windowSizeLines )  // NOTE: due to concurrency, this may make the queue shorter than MAX - that's OK (and in some cases longer)
            {
                queue.remove();
            }
            queue.add(new Message(queueMessage, type));
        }
        type.log(message, exception);
    }
322784
public function addMessage($message, $type = 'success')
    {
        Events::dispatch('onMessageDisplay', array('message' => $message, 'type' => $type));
        $this->messages[] = array('message' => $message, 'type' => $type);
    }
1201459
public final void addCallback(StatusCallback callback) {
        synchronized (callbacks) {
            if (callback != null && !callbacks.contains(callback)) {
                callbacks.add(callback);
            }
        }
    }
728052
void root(ProtoType type) {
    if (type == null) throw new NullPointerException("type == null");
    checkArgument(!identifierSet.excludes(type));
    checkArgument(!members.containsKey(type));
    types.add(type);
  }
1333635
public void add(final FieldDescriptor type) {
    if (type.getJavaType() == FieldDescriptor.JavaType.MESSAGE) {
      throw new IllegalArgumentException(
        "ExtensionRegistry.add() must be provided a default instance when " +
        "adding an embedded message extension.");
    }
    add(new ExtensionInfo(type, null));
  }
1150850
public function log($message, $type = null)
	{
		$this->log[] = array('message' => $message, 'type' => $type);

		if (!$this->ignoreCallbacks && isset($this->callbacks['message']) && is_callable($this->callbacks['message']))
		{
			$this->callbacks['message']($message, $type);
		}
	}
602551
@SuppressWarnings("unchecked")
    public <E> MessageHandler<? super E> addSentMessageHandler(Class<E> type,
            MessageHandler<? super E> handler) {
        sentMessageHandlerCache.clear();
        return (MessageHandler<? super E>) sentMessageHandlers.put(type, handler);
    }
50236
public function addMessage($message, $type) {
		if(!($this->session->get($this->sessionKey, [])) == null)
		{
			$messages = $this->session->get($this->sessionKey, []);
		}
		
		$messages[] = [
			'message' => $message,
			'type' => $type,
		];
		
		$this->session->set($this->sessionKey, $messages);
	}
886500
public void setType(MsgType type) {
        this.type = type;
        if (type == MsgType.flash) {
            this.mclass = MClassType.flash;
        } else {
            this.mclass = MClassType.normal;
        }
    }
1053980
public void setMessagingType( String messagingType ) {

		// Properties are injected on every modification.
		// So, we just want to track changes.

		// We only want to reconfigure the messaging client
		// when the messaging type changes.
		if( ! Objects.equals( this.messagingType, messagingType )) {
			this.messagingType = messagingType;
			this.logger.fine( "Messaging type set to " + this.messagingType );

			// Explicitly require a reconfiguration.
			reconfigure();
		}
	}
1030582
public void register(Type<?> type) {
        jdbcTypeMapping.register(type.getSQLTypes()[0], type.getReturnedClass());
        javaTypeMapping.register(type);
    }
1391
@SuppressWarnings("unchecked")
    public <E> MessageHandler<? super E> addReceivedMessageHandler(Class<E> type,
            MessageHandler<? super E> handler) {
        receivedMessageHandlerCache.clear();
        return (MessageHandler<? super E>) receivedMessageHandlers.put(type, handler);
    }
468246
def add(self, callback_type, callback):
        """"""

        with self.lock:
            self.callbacks[callback_type].append(callback)
138656
public CmsNotificationMessage sendBusy(Type type, final String message) {

        CmsNotificationMessage notificationMessage = new CmsNotificationMessage(Mode.BUSY, type, message);
        m_messages.add(notificationMessage);
        if (hasWidget()) {
            m_widget.addMessage(notificationMessage);
        }
        return notificationMessage;
    }