All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.signalr.Subscription Maven / Gradle / Ivy

There is a newer version: 9.0.0-preview.7.24406.2
Show newest version
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

package com.microsoft.signalr;

import java.util.List;

/**
 * Represents the registration of a handler for a client method.
 */
public class Subscription {
    private final CallbackMap handlers;
    private final InvocationHandler handler;
    private final String target;

    Subscription(CallbackMap handlers, InvocationHandler handler, String target) {
        this.handlers = handlers;
        this.handler = handler;
        this.target = target;
    }

    /**
     * Removes the client method handler represented by this subscription.
     */
    public void unsubscribe() {
        List handler = this.handlers.get(target);
        if (handler != null) {
            handler.remove(this.handler);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy