Hi Niclas, it was a very good system you brought up, but hte problem is that we do not have control over the listener interface. We are using the J/Xfs spec for our hardware drivers and wrap the devices with a very thin layer just to be able to introduce some decoupling later on. However, these wrappers have method getDevice() that returns the J/Xfs driver device directly in order to be able to do finegrained configuration for e.g. the state machine component.
So we would like to get hold of all our hardware wrappers during upstart from different other interested components that will do: /** @avalon.stage id = "hardwareWrapperInterestedClientsProvideThisStage" */ public class HardwareWrapper(JXfsDevice device) { } /** @avalon.extension id = "hardwareWrapperInterestedClientsProvideThisStage" */ public class Display implements jxfs....OperationCompleteListener, Creator //stage method public create(Object obj) { logger.debug ("I got the object" + obj); if (obj instanceOf DeviceWrapper && ((DeviceWrapper)obj).getDevice() instanceOf SoftKeyDevice) { JXfsDeviceContro device = ((DeviceWrapper)obj).getDevice(); //the event provider(s) device.addCompletionEventListener(this); //this is the external spec } } public completionEventOccured(JXfsCompletionEvent event) { updateButtonRendering(event.getPressedKey()); } } The question - is it possible to do this with several providers for the same stage? That would probably provide the flexibility we need and we can scrap our HardwareManager that all HardwareWrappers register in since alla interested parties have references anyway this way. Is there a way to enable/choose/disable several extension providers for the same extension? I'm thinking something like this to work: /** @avalon.extension id = "hardwareWrapperInterestedClientsProvideThisStage" */ public class Display2 implements jxfs....OperationCompleteListener, Creator //stage methodpublic create(Object obj) { logger.debug ("I got the object too!!!" + obj); if (obj instanceOf DeviceWrapper && ((DeviceWrapper)obj).getDevice() instanceOf SoftKeyDevice) { JXfsDeviceContro device = ((DeviceWrapper)obj).getDevice(); //the event provider(s) device.addCompletionEventListener(this); //this is the external spec } } What do you think? /peter
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]