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

com.github.linyuzai.connection.loadbalance.sse.concept.SseConnectionFactory Maven / Gradle / Ivy

The newest version!
package com.github.linyuzai.connection.loadbalance.sse.concept;

import com.github.linyuzai.connection.loadbalance.core.concept.AbstractConnection;
import com.github.linyuzai.connection.loadbalance.core.concept.AbstractConnectionFactory;
import com.github.linyuzai.connection.loadbalance.core.concept.ConnectionLoadBalanceConcept;

import java.util.Map;

/**
 * SSE 连接工厂抽象类。
 * 

* Abstract class of SSE connection factory. */ public abstract class SseConnectionFactory extends AbstractConnectionFactory { public SseConnectionFactory() { addScopes(SseScoped.NAME); } @Override public boolean support(Object o, Map metadata, ConnectionLoadBalanceConcept concept) { return o instanceof SseCreation; } @SuppressWarnings("unchecked") @Override protected AbstractConnection doCreate(Object o, ConnectionLoadBalanceConcept concept) { R request = (R) o; SseConnection connection = doCreate(request, concept); connection.setCreation(request); return connection; } protected abstract SseConnection doCreate(R request, ConnectionLoadBalanceConcept concept); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy