org.fusesource.hawtdispatch.Dispatch.createQueue()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.fusesource.hawtdispatch.Dispatch.createQueue()方法的一些代码示例,展示了Dispatch.createQueue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dispatch.createQueue()方法的具体详情如下:
包路径:org.fusesource.hawtdispatch.Dispatch
类名称:Dispatch
方法名:createQueue

Dispatch.createQueue介绍

[英]Creates a new serial dispatch queue to which runnable objects may be submitted.

Same thing as createQueue(null)
[中]创建一个新的串行调度队列,可将可运行对象提交到该队列。
createQueue(null)相同

代码示例

代码示例来源:origin: fusesource/mqtt-client

public CallbackConnection(MQTT mqtt) {
  this.mqtt = mqtt;
  if(this.mqtt.dispatchQueue == null) {
    this.queue = createQueue("mqtt client");
  } else {
    this.queue = this.mqtt.dispatchQueue;
  }
}

代码示例来源:origin: org.fusesource.mqtt-client/mqtt-client

public CallbackConnection(MQTT mqtt) {
  this.mqtt = mqtt;
  if(this.mqtt.dispatchQueue == null) {
    this.queue = createQueue("mqtt client");
  } else {
    this.queue = this.mqtt.dispatchQueue;
  }
}

代码示例来源:origin: org.apache.activemq/apollo-mqtt

public MqttSession(HostState host_state, UTF8Buffer client_id, SessionState session_state) {
  this.host_state = host_state;
  this.client_id = client_id;
  this.queue = createQueue("mqtt: " + client_id);
  this.session_state = session_state;
}

代码示例来源:origin: jboss-fuse/fabric8

public Manager(BundleContext context, CuratorFramework curator, String uri, String exportedAddress, long timeout) throws Exception {
  this.queue = Dispatch.createQueue();
  this.importedServices = new ConcurrentHashMap<EndpointDescription, Map<Long, ImportRegistration>>();
  this.exportedServices = new ConcurrentHashMap<ServiceReference, ExportRegistration>();
  this.listeners = new ConcurrentHashMap<ListenerInfo, SimpleFilter>();
  this.serializationStrategies = new ConcurrentHashMap<String, SerializationStrategy>();
  this.remoteEndpoints = new CapabilitySet<EndpointDescription>(
      Arrays.asList(Constants.OBJECTCLASS, ENDPOINT_FRAMEWORK_UUID), false);
  this.bundleContext = context;
  this.curator = curator;
  this.uri = uri;
  this.exportedAddress = exportedAddress;
  this.timeout = timeout;
}

代码示例来源:origin: sitewhere/sitewhere

@Override
public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException {
this.queue = Dispatch.createQueue(getComponentId().toString());
this.mqtt = MqttLifecycleComponent.configure(this, queue);
}

代码示例来源:origin: com.sitewhere/sitewhere-core

@Override
public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException {
this.queue = Dispatch.createQueue(getComponentId());
this.mqtt = MqttLifecycleComponent.configure(this, queue);
}

代码示例来源:origin: org.apache.qpid/proton-hawtdispatch

static public AmqpTransport connect(AmqpConnectOptions options) {
  AmqpConnectOptions opts = options.clone();
  if( opts.getDispatchQueue() == null ) {
    opts.setDispatchQueue(Dispatch.createQueue());
  }
  if( opts.getBlockingExecutor() == null ) {
    opts.setBlockingExecutor(AmqpConnectOptions.getBlockingThreadPool());
  }
  return new AmqpTransport(opts.getDispatchQueue()).connecting(opts);
}

代码示例来源:origin: com.sitewhere/sitewhere-core

@Override
public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException {
if ((topic == null) && ((multicaster == null) && (routeBuilder == null))) {
  throw new SiteWhereException("No topic specified and no multicaster or route builder configured.");
}
// Required for filters.
super.start(monitor);
// Start multicaster if configured.
if (multicaster != null) {
  startNestedComponent(multicaster, monitor, true);
}
// Start route builder if configured.
if (routeBuilder != null) {
  startNestedComponent(routeBuilder, monitor, true);
}
// Use common MQTT configuration setup.
this.queue = Dispatch.createQueue(getComponentId());
this.mqtt = MqttLifecycleComponent.configure(this, queue);
LOGGER.info("Connecting to MQTT broker at '" + getHostname() + ":" + getPort() + "'...");
connection = mqtt.futureConnection();
try {
  Future<Void> future = connection.connect();
  future.await(MqttLifecycleComponent.DEFAULT_CONNECT_TIMEOUT_SECS, TimeUnit.SECONDS);
} catch (Exception e) {
  throw new SiteWhereException("Unable to connect to MQTT broker.", e);
}
LOGGER.info("Connected to MQTT broker.");
}

代码示例来源:origin: fusesource/stompjms

dispatchQueue = createQueue("stomp client");

代码示例来源:origin: org.fusesource.stompjms/stompjms-client

dispatchQueue = createQueue("stomp client");

代码示例来源:origin: sitewhere/sitewhere

@Override
public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException {
if ((topic == null) && ((multicaster == null) && (routeBuilder == null))) {
  throw new SiteWhereException("No topic specified and no multicaster or route builder configured.");
}
// Required for filters.
super.start(monitor);
// Start multicaster if configured.
if (multicaster != null) {
  startNestedComponent(multicaster, monitor, true);
}
// Start route builder if configured.
if (routeBuilder != null) {
  startNestedComponent(routeBuilder, monitor, true);
}
// Use common MQTT configuration setup.
this.queue = Dispatch.createQueue(getComponentId().toString());
this.mqtt = MqttLifecycleComponent.configure(this, queue);
getLogger().info("Connecting to MQTT broker at '" + getHostname() + ":" + getPort() + "'...");
connection = mqtt.futureConnection();
try {
  Future<Void> future = connection.connect();
  future.await(MqttLifecycleComponent.DEFAULT_CONNECT_TIMEOUT_SECS, TimeUnit.SECONDS);
} catch (Exception e) {
  throw new SiteWhereException("Unable to connect to MQTT broker.", e);
}
getLogger().info("Connected to MQTT broker.");
}

相关文章