public class RabbitMQClusterPolicy extends Object implements ClusterPolicy, com.rabbitmq.client.Consumer
Constructor and Description |
---|
RabbitMQClusterPolicy(Properties props) |
Modifier and Type | Method and Description |
---|---|
void |
clear(String region)
清除本地整个缓存区域
|
void |
connect(Properties props,
CacheProviderHolder holder)
连接到集群
|
void |
disconnect()
断开集群连接
|
void |
evict(String region,
String... keys)
删除本地某个缓存条目
|
void |
handleCancel(String s) |
void |
handleCancelOk(String s) |
void |
handleConsumeOk(String s) |
void |
handleDelivery(String s,
com.rabbitmq.client.Envelope envelope,
com.rabbitmq.client.AMQP.BasicProperties basicProperties,
byte[] bytes) |
void |
handleRecoverOk(String s) |
void |
handleShutdownSignal(String s,
com.rabbitmq.client.ShutdownSignalException e) |
boolean |
isLocalCommand(Command cmd)
判断是否本地实例的命令
|
void |
publish(Command cmd)
发布消息
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleCommand, sendClearCmd, sendEvictCmd
public RabbitMQClusterPolicy(Properties props)
props
- RabbitMQ 配置信息public boolean isLocalCommand(Command cmd)
ClusterPolicy
isLocalCommand
in interface ClusterPolicy
cmd
- 命令信息public void evict(String region, String... keys)
evict
in interface ClusterPolicy
region
- 区域名称keys
- 缓存键值public void clear(String region)
clear
in interface ClusterPolicy
region
- 区域名称public void connect(Properties props, CacheProviderHolder holder)
ClusterPolicy
connect
in interface ClusterPolicy
props
- j2cache 配置信息holder
- Cache Provider Instancepublic void publish(Command cmd)
publish
in interface ClusterPolicy
cmd
- 消息数据public void disconnect()
ClusterPolicy
disconnect
in interface ClusterPolicy
public void handleDelivery(String s, com.rabbitmq.client.Envelope envelope, com.rabbitmq.client.AMQP.BasicProperties basicProperties, byte[] bytes)
handleDelivery
in interface com.rabbitmq.client.Consumer
public void handleConsumeOk(String s)
handleConsumeOk
in interface com.rabbitmq.client.Consumer
public void handleCancelOk(String s)
handleCancelOk
in interface com.rabbitmq.client.Consumer
public void handleCancel(String s)
handleCancel
in interface com.rabbitmq.client.Consumer
public void handleShutdownSignal(String s, com.rabbitmq.client.ShutdownSignalException e)
handleShutdownSignal
in interface com.rabbitmq.client.Consumer
public void handleRecoverOk(String s)
handleRecoverOk
in interface com.rabbitmq.client.Consumer
Copyright © 2018. All rights reserved.