@Override public void initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.initialize(monitor); // Set up metrics. this.processedEvents = createMeterMetric("processedEvents"); }
@Override public void initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.initialize(monitor); // Set up metrics. this.processedEvents = createMeterMetric("processedEvents"); this.failedEvents = createMeterMetric("failedEvents"); this.deviceLookupTimer = createTimerMetric("deviceLookup"); this.assignmentLookupTimer = createTimerMetric("assignmentLookup"); this.eventStorageTimer = createTimerMetric("eventStorage"); this.eventStorageStrategy = new UnaryEventStorageStrategy((IInboundProcessingTenantEngine) getTenantEngine(), this); }
@Override public void initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.initialize(monitor); if (getScriptId() == null) { throw new SiteWhereException("Script id was not initialized properly."); } this.scriptMetadata = ((IConfigurableMicroservice<?>) getMicroservice()).getScriptManagement() .getScriptMetadata(getMicroservice().getIdentifier(), getTenantEngine().getTenant().getId(), getScriptId()); if (getScriptMetadata() == null) { throw new SiteWhereException("Script '" + getScriptId() + "' was not found."); } getLogger().info(String.format("Groovy component will use version %s of script '%s'", getScriptMetadata().getActiveVersion(), getScriptMetadata().getName())); }
@Override public void initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.initialize(monitor); if ((getInboundEventReceivers() == null) || (getInboundEventReceivers().size() == 0)) { throw new SiteWhereException("No inbound event receivers registered for event source."); } if (getDeviceEventDecoder() == null) { throw new SiteWhereException("No device event decoder assigned."); } // Set up metrics. this.decodedEvents = createMeterMetric(getMetricPrefix() + "decodedEvents"); this.decodeFailures = createMeterMetric(getMetricPrefix() + "decodeFailures"); this.duplicates = createMeterMetric(getMetricPrefix() + "duplicates"); // Initialize device event decoder. initializeNestedComponent(getDeviceEventDecoder(), monitor, true); // Initialize device event deduplicator if provided. if (getDeviceEventDeduplicator() != null) { initializeNestedComponent(getDeviceEventDeduplicator(), monitor, true); } // Initialize event receivers. for (IInboundEventReceiver<T> receiver : getInboundEventReceivers()) { receiver.setEventSource(this); initializeNestedComponent(receiver, monitor, true); } }