






Integrating New Translators into an Existing Mapper
After creating a new translator, you need to instantiate it into an existing mapper or create a totally new mapper. Ways to do are different between type-based and instance-based translators.
Instantiating a type-based translator
A type-based translator is instantiated typically in start() method of the corresponding mapper. Suppose the MyTranslator, which we have seen in the previous section, is a type-based Bluetooth-uMiddle translator. In this case, it will be instantiated in the start() method of BluetoothMapper as follows.
protected void start() throws Exception {
String devName = <name of a uMiddle device that will contain MyTranslator>; // such as BluetoothBIP and UPnP_MediaRenderer
String srvName = <name of the translator>; // such as camera, TV, printer, etc.
DeviceEntity device = new DeviceEntity(devName);
MyTranslator service = new MyTranslator(); // we probably don't need to pass any device ID or something since MyTranslator is type-based.
device.addService(srvName, service); // add the translator to the device. this exports MyTranslator to the uMiddle network.
}
Instantiating a instance-based translator
If you are to implement a new mapper, proceed to the next section. If you are required to modify an existing mapper, proceed to one of the followings.
Link to this Page
- uMiddle HOWTOs last edited on 24 June 2005 at 1:16 pm by lawn-199-77-211-58.lawn.gatech.edu