// upon construction
container = getContainerManagerService().getContainerFactory()
.createContainer(containerType,
new Object[] { topicId, queueId });
// Get IRemoteServiceContainerAdapter
IRemoteServiceContainerAdapter remoteServiceAdapter = (IRemoteServiceContainerAdapter) container
.getAdapter(IRemoteServiceContainerAdapter.class);
Properties properties = new Properties();
// This is setting (currently) magical service property that indicates
// that
// this service registration is a load balancing service host
properties.put(Constants.SERVICE_REGISTER_PROXY, "true");
// Register the remote service with the IDataProcessor interface as it's
// service registration.
// Note that the Constants.SERVICE_REGISTER_PROXY allows null to be specified
// as the registered remote service implementation.
// This object does not implement the IDataProcessor service interface,
// but it is not actually used. Rather,
// the LOAD_BALANCING_SERVICE_PROPERTY set to "true" specifies that for
// this container the remote service
// requests are proxied and forwarded to the JMS queue (where they are
// load balanced among the n servers
// that are consumers from that queue)
dataProcessorServiceHostRegistration = remoteServiceAdapter
.registerRemoteService(new String[] { IDataProcessor.class
.getName() }, null, properties);
System.out.println("LB Service Host: DataProcessor Registered via ECF Remote Services topic="+topicId);
// wait for remote service requests until stopped