anchor.diff:  
   ==== Finding the Activity Collector
   
  -Locating the Activity Collector will be dependent upon the environment. This section outlines the different approaches that may be used.
  -
  -===== JEE Environment
  -
  -In a JEE environment, the Activity Collector is obtained using the following code:
  -
  -----
  -import org.overlord.rtgov.activity.collector.ActivityCollector;
  -import org.overlord.rtgov.activity.collector.ActivityCollectorAccessor;
  -
  +The Activity Collector can be obtained using the Service Registry as follows:
  +
  +----
  +ActivityCollector activityCollector=null;
   ....
   
  -ActivityCollector activityCollector = ActivityCollectorAccessor.getActivityCollector();
  -----
  -
  -The accessor is initialized with an instance of the ActivityCollector when it is instantiated by the system (e.g. CDI). If an instance has not been initialized when this method is invoked, then the client will be blocked for a short period of time, waiting for the instance. If the instance has not been initialized after this period, then a null will be returned.
  +ServiceRegistryUtil.addServiceListener(ActivityCollector.class, new ServiceListener<ActivityCollector>() {
  +
  +    public void registered(ActivityCollector service) {
  +        activityCollector = service;
  +    }
  +
  +    public void unregistered(ActivityCollector service) {
  +        activityCollector = null;
  +    }            
  +});
  +----
   
   
   ==== Pre-Processing Activity Information
  
positive.code: 
  .....
  
          RESTActivityServer restc=new RESTActivityServer();
          restc.setServerURL(_activityServerURL);
  
          ActivityServerLogger activityUnitLogger=new ActivityServerLogger();
          activityUnitLogger.setActivityServer(restc);
  
          activityUnitLogger.init();
  
          _collector.setActivityUnitLogger(activityUnitLogger);
  ----
  
  This shows a situation where an embedded Activity Collector is being initialized with an Activity Server Logger, which uses the REST Activity Server client implementation.
  
negative.code: import org.codehaus.jackson.type.TypeReference;
  import org.overlord.rtgov.activity.model.ActivityUnit;
  
  .....
  
  java.net.URL queryUrl = new java.net.URL(....);   // <host>/overlord-rtgov/activity/unit?id=<id>
  
  java.net.HttpURLConnection connection = (java.net.HttpURLConnection) queryUrl.openConnection();
  
  String userPassword = username + ":" + password;
  String encoding = org.apache.commons.codec.binary.Base64.encodeBase64String(userPassword.getBytes());
  
  connection.setRequestProperty("Authorization", "Basic " + encoding);
  
  connection.setRequestMethod("GET");
  connection.setDoOutput(true);
  connection.setDoInput(true);
  connection.setUseCaches(false);
  connection.setAllowUserInteraction(false);
  connection.setRequestProperty("Content-Type", "application/json");
  
  java.io.InputStream is=connection.getInputStream();
  
  ActivityUnit au = mapper.readValue(is, ActivityUnit.class);
  
  is.close();
  ----
  
  See the REST API documentation in the docs folder of the distribution.
  