When working with the GeoEvent SDK, there are times when you need to utilize a framework service from the underlying GeoEvent system. In order to do this you must inject the service into your bean in the configuration file. This blog discusses how to do that and provides a list of services that are available. This blog is not intended to be all encompassing, so I'll update it as needed.
To reference an underlying SDK resource you must add it to your Blueprint config.xml file.
1. Add the service reference towards the top of the xml:
<reference id="geoDefManagerService" interface="com.esri.ges.manager.geoeventdefinition.GeoEventDefinitionManager" />
2. Inside your bean declaration, add a property that identifies the reference and gives it a unique name:
<property name="manager" ref="geoDefManagerService" />
3. Inside your Service class, implement a method to allow the reference to be injected into your service:
private GeoEventDefinitionManager geoEventDefinitionManager;
public void setManager(GeoEventDefinitionManager geoEventDefinitionManager) {
this.geoEventDefinitionManager = geoEventDefinitionManager;
}
4. Use the injected reference when instantiating your implementation class:
EventJoiner eventJoiner = new EventJoiner(definition, this.geoEventDefinitionManager);
The following resources are available without having to create a reference in your config.xml.
If you need to store data on disk (such as configuration or non-volatile cache) you can add a data folder property to your bean. Using the data folder property is the same for the Service and Implementation classes as documented above for the referenced resources.
<property name="dataFolder" value="./data/myfolder" />
The path in the value above points to the GeoEvent installation data directory (typically C:\Program Files\ArcGIS\Server\GeoEvent\data\ ).
Allows you to find/use/modify existing GeoEvent Definitions and/or create new ones.
Interface: com.esri.ges.manager.geoeventdefinition.GeoEventDefinitionManager
Documentation:
file:///C:/Program%20Files/ArcGIS/Server/GeoEvent/sdk/api/com/esri/ges/manager/geoeventdefinition/GeoEventDefinitionManager.html
Allows you to create/publish GeoEvents and subscribe to GeoEvent listeners. The main use of this reference is to get access to a GeoEventCreator.
Interface: com.esri.ges.messaging.Messaging
Documentation:
file:///C:/Program%20Files/ArcGIS/Server/GeoEvent/sdk/api/com/esri/ges/messaging/Messaging.html
Example for Implementation Class:
private GeoEventCreator geoEventCreator;
public void setMessaging(Messaging messaging) {
geoEventCreator = messaging.createGeoEventCreator();
}
Gives you access to the GeoEvent Server's HTTP client services. Use this to create HTTP clients that honor GeoEvent Server's global settings for proxy, etc.
Interface: com.esri.ges.core.http.GeoEventHttpClientService
Documentation:
file:///C:/Program%20Files/ArcGIS/Server/GeoEvent/sdk/api/com/esri/ges/core/http/GeoEventHttpClientService.html
Example for Implementation Class:
private GeoEventHttpClient httpclient;
public class AnImplementationClass(GeoEventHttpClientService httpClientService) {
this.httpclient = httpClientService.createNewClient();
}
If you need to create some custom TAGs, you can use the tag manager to do that.
Interface: com.esri.ges.manager.tag.TagManager
Documentation:
file:///C:/Program%20Files/ArcGIS/Server/GeoEvent/sdk/api/com/esri/ges/manager/tag/TagManager.html
If you need to connect to a registered data store.
Interface: com.esri.ges.manager.datastore.agsconnection.ArcGISServerConnectionManager
Documentation:
file:///C:/Program%20Files/ArcGIS/Server/GeoEvent/sdk/api/com/esri/ges/manager/datastore/agsconnection/ArcGISServerConnectionManager.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.