Protocom cannot handle a component with two interfaces?
In our Business Reporting Example, the InnerCoreReportingEngine has two Interfaces, IAdmin and IReporting. It seems that Protocom can only handle one interface per AssemblyContext. Maybe the problem only occurs at the system interface.
It seems to me that there is a design flaw, namely that an assembly context is typed by one of its interfaces. This does not work for multiple offered interfaces.
In the generated defaultsystem.impl.defaultSystem, the AssemblyContexts are looked up (line 151ff) as IPerformancePrototypePorts. The generated interface classes like IAdmin_InnerCoreReportingEngine inherit from this class. Later, the assembly contexts at the system boundary are cast to to offered interface (in our case brs_repository.IAdmin, line 29). This cast fails for the InnerCoreReportingEngine assembly context:
18:32 INFO [main]: IHTTP_defaultSystem_ bound in registry
18:32 ERROR [main]: Failed to run main method
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
Caused by: java.lang.ClassCastException: com.sun.proxy.$Proxy5 cannot be cast to
... 9 more
I suspect that the assembly context has the type of its other interface, but I did not check in detail.
The BRS system can be found in the SVN at stud\DanielSachsenmeier\BRS REV30090 or in the attached zip file. The Protocom instance was generated by using the flatbrs.allocation and flatbrs.usagescenario models. The generated code is also attached.
I guess Sebastian has to look at it briefly and at least comment on it...