本文整理了Java中org.apache.activemq.broker.Broker.getBrokerService()
方法的一些代码示例,展示了Broker.getBrokerService()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Broker.getBrokerService()
方法的具体详情如下:
包路径:org.apache.activemq.broker.Broker
类名称:Broker
方法名:getBrokerService
暂无
代码示例来源:origin: apache/activemq
@Override
public BrokerService getBrokerService() {
return getNext().getBrokerService();
}
代码示例来源:origin: apache/activemq
@Override
public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception {
super.addConnection(context, info);
this.contextBroker.getBrokerService().incrementCurrentConnections();
this.contextBroker.getBrokerService().incrementTotalConnections();
}
代码示例来源:origin: apache/activemq
public void setLastStoredSequenceId(long l) {
auditProducerSequenceIds = true;
if (connectionContext.isNetworkConnection()) {
brokerService = connectionContext.getBroker().getBrokerService();
isNetworkProducer = true;
}
lastSendSequenceNumber.set(l);
LOG.debug("last stored sequence id set: {}", l);
}
代码示例来源:origin: apache/activemq
@Override
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
super.removeConnection(context, info, error);
this.contextBroker.getBrokerService().decrementCurrentConnections();
}
代码示例来源:origin: apache/activemq
@Override
public Broker installPlugin(Broker broker) throws Exception {
if (!broker.getBrokerService().isSchedulerSupport()) {
throw new IllegalStateException("RedeliveryPlugin requires schedulerSupport=true on the broker");
}
validatePolicyDelay(1000);
return super.installPlugin(broker);
}
代码示例来源:origin: apache/activemq
private boolean hasNoLocalChanged(SubscriptionInfo info1, ConsumerInfo info2) throws IOException {
//Not all persistence adapters store the noLocal value for a subscription
PersistenceAdapter adapter = broker.getBrokerService().getPersistenceAdapter();
if (adapter instanceof NoLocalSubscriptionAware) {
if (info1.isNoLocal() ^ info2.isNoLocal()) {
return true;
}
}
return false;
}
代码示例来源:origin: apache/activemq
@Override
public void start() throws Exception {
if (started.compareAndSet(false, true)) {
if( this.broker != null) {
wireFormat.setVersion(this.broker.getBrokerService().getStoreOpenWireVersion());
}
super.start();
if (systemUsage != null) {
systemUsage.getMemoryUsage().addUsageListener(this);
}
}
}
代码示例来源:origin: apache/activemq
@Override
protected void doFillBatch() throws Exception {
hadSpace = this.hasSpace();
if (!broker.getBrokerService().isPersistent() || hadSpace) {
this.store.recoverNextMessages(this.maxBatchSize, this);
dealWithDuplicates(); // without the index lock
}
}
代码示例来源:origin: apache/activemq
/**
* @returns the ObjectName of the Connection that created this subscription
*/
@Override
public ObjectName getConnection() {
ObjectName result = null;
if (clientId != null && subscription != null) {
ConnectionContext ctx = subscription.getContext();
if (ctx != null && ctx.getBroker() != null && ctx.getBroker().getBrokerService() != null) {
BrokerService service = ctx.getBroker().getBrokerService();
ManagementContext managementCtx = service.getManagementContext();
if (managementCtx != null) {
try {
ObjectName query = createConnectionQuery(managementCtx, service.getBrokerName());
Set<ObjectName> names = managementCtx.queryNames(query, null);
if (names.size() == 1) {
result = names.iterator().next();
}
} catch (Exception e) {
}
}
}
}
return result;
}
代码示例来源:origin: apache/activemq
final BrokerService brokerService = context.getConnectionContext().getBroker().getBrokerService();
for (final ActiveMQDestination destination : matchingDestinations) {
if (concurrent.getCount() > 0) {
代码示例来源:origin: apache/activemq
public ManagedTransportConnection(TransportConnector connector, Transport transport, Broker broker,
TaskRunnerFactory factory, TaskRunnerFactory stopFactory,
ManagementContext context, ObjectName connectorName)
throws IOException {
super(connector, transport, broker, factory, stopFactory);
this.managementContext = context;
this.connectorName = connectorName;
this.mbean = new ConnectionView(this, managementContext);
this.populateUserName = broker.getBrokerService().isPopulateUserNameInMBeans();
if (managementContext.isAllowRemoteAddressInMBeanNames()) {
byAddressName = createObjectName("remoteAddress", transport.getRemoteAddress());
registerMBean(byAddressName);
}
}
代码示例来源:origin: apache/activemq
final BrokerService brokerService = broker.getBrokerService();
代码示例来源:origin: apache/activemq
/**
* @param broker Broker for this cursor
* @param clientId clientId for this cursor
* @param subscriberName subscriber name for this cursor
* @param maxBatchSize currently ignored
* @param subscription subscription for this cursor
*/
public StoreDurableSubscriberCursor(Broker broker,String clientId, String subscriberName,int maxBatchSize, DurableTopicSubscription subscription) {
super(AbstractPendingMessageCursor.isPrioritizedMessageSubscriber(broker,subscription));
this.subscription=subscription;
this.clientId = clientId;
this.subscriberName = subscriberName;
if (broker.getBrokerService().isPersistent()) {
this.nonPersistent = new FilePendingMessageCursor(broker,clientId + subscriberName,this.prioritizedMessages);
} else {
this.nonPersistent = new VMPendingMessageCursor(this.prioritizedMessages);
}
this.nonPersistent.setMaxBatchSize(maxBatchSize);
this.nonPersistent.setSystemUsage(systemUsage);
this.storePrefetches.add(this.nonPersistent);
if (prioritizedMessages) {
setMaxAuditDepth(10*getMaxAuditDepth());
}
}
代码示例来源:origin: apache/activemq
@Override
public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception {
SubscriptionKey key = new SubscriptionKey(context.getClientId(), info.getSubscriptionName());
RegionBroker regionBroker = null;
if (next instanceof RegionBroker) {
regionBroker = (RegionBroker) next;
} else {
BrokerService service = next.getBrokerService();
regionBroker = (RegionBroker) service.getRegionBroker();
}
if (regionBroker == null) {
LOG.warn("Cannot locate a RegionBroker instance to pass along the removeSubscription call");
throw new IllegalStateException("No RegionBroker found.");
}
DurableTopicSubscription sub = ((TopicRegion) regionBroker.getTopicRegion()).getDurableSubscription(key);
super.removeSubscription(context, info);
if (sub == null) {
LOG.warn("We cannot send an advisory message for a durable sub removal when we don't know about the durable sub");
return;
}
ActiveMQDestination dest = sub.getConsumerInfo().getDestination();
// Don't advise advisory topics.
if (!AdvisorySupport.isAdvisoryTopic(dest)) {
ActiveMQTopic topic = AdvisorySupport.getConsumerAdvisoryTopic(dest);
fireConsumerAdvisory(context, dest, topic, info);
}
}
代码示例来源:origin: apache/activemq
if (config.isSyncDurableSubs() && protocolVersion.get() >= CommandTypes.PROTOCOL_VERSION_DURABLE_SYNC) {
LOG.debug("SyncDurableSubs is enabled, Sending BrokerSubscriptionInfo");
dispatchSync(NetworkBridgeUtils.getBrokerSubscriptionInfo(this.broker.getBrokerService(), config));
dispatchSync(NetworkBridgeUtils.getBrokerSubscriptionInfo(this.broker.getBrokerService(), config));
代码示例来源:origin: apache/activemq
this.connector = connector;
this.broker = broker;
this.brokerService = broker.getBrokerService();
代码示例来源:origin: apache/activemq
@Override
public synchronized void start() throws Exception {
started = true;
super.start();
if (nonPersistent == null) {
if (broker.getBrokerService().isPersistent()) {
nonPersistent = new FilePendingMessageCursor(broker,queue.getName(),this.prioritizedMessages);
}else {
nonPersistent = new VMPendingMessageCursor(this.prioritizedMessages);
}
nonPersistent.setMaxBatchSize(getMaxBatchSize());
nonPersistent.setSystemUsage(systemUsage);
nonPersistent.setEnableAudit(isEnableAudit());
nonPersistent.setMaxAuditDepth(getMaxAuditDepth());
nonPersistent.setMaxProducersToAudit(getMaxProducersToAudit());
}
nonPersistent.setMessageAudit(getMessageAudit());
nonPersistent.start();
persistent.setMessageAudit(getMessageAudit());
persistent.start();
pendingCount = persistent.size() + nonPersistent.size();
}
代码示例来源:origin: apache/activemq
brokerInfo.setPeerBrokerInfos(broker.getPeerBrokerInfos());
brokerInfo.setFaultTolerantConfiguration(broker.isFaultTolerantConfiguration());
brokerInfo.setBrokerURL(broker.getBrokerService().getDefaultSocketURIString());
getServer().setAcceptListener(new TransportAcceptListener() {
@Override
代码示例来源:origin: org.apache.activemq/activemq-broker
public void setLastStoredSequenceId(long l) {
auditProducerSequenceIds = true;
if (connectionContext.isNetworkConnection()) {
brokerService = connectionContext.getBroker().getBrokerService();
isNetworkProducer = true;
}
lastSendSequenceNumber.set(l);
LOG.debug("last stored sequence id set: {}", l);
}
代码示例来源:origin: org.apache.activemq/activemq-broker
@Override
public Broker installPlugin(Broker broker) throws Exception {
if (!broker.getBrokerService().isSchedulerSupport()) {
throw new IllegalStateException("RedeliveryPlugin requires schedulerSupport=true on the broker");
}
validatePolicyDelay(1000);
return super.installPlugin(broker);
}
内容来源于网络,如有侵权,请联系作者删除!