public CallbackConnection(MQTT mqtt) { this.mqtt = mqtt; if(this.mqtt.dispatchQueue == null) { this.queue = createQueue("mqtt client"); } else { this.queue = this.mqtt.dispatchQueue; } }
public CallbackConnection(MQTT mqtt) { this.mqtt = mqtt; if(this.mqtt.dispatchQueue == null) { this.queue = createQueue("mqtt client"); } else { this.queue = this.mqtt.dispatchQueue; } }
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; }
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; }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { this.queue = Dispatch.createQueue(getComponentId().toString()); this.mqtt = MqttLifecycleComponent.configure(this, queue); }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { this.queue = Dispatch.createQueue(getComponentId()); this.mqtt = MqttLifecycleComponent.configure(this, queue); }
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); }
@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."); }
dispatchQueue = createQueue("stomp client");
dispatchQueue = createQueue("stomp client");
@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."); }