Protocom cannot handle a component with two interfaces?

Description

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
java.lang.reflect.InvocationTargetException
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)
at org.palladiosimulator.protocom.framework.java.se.AbstractMain.invokeM
ethod(AbstractMain.java:261)
at org.palladiosimulator.protocom.framework.java.se.AbstractMain.handleM
enuItem(AbstractMain.java:138)
at org.palladiosimulator.protocom.framework.java.se.AbstractMain.createU
serMenu(AbstractMain.java:94)
at org.palladiosimulator.protocom.framework.java.se.AbstractMain.run(Abs
tractMain.java:85)
at ProtoComBootstrap.Main.main(Main.java:39)
Caused by: java.lang.ClassCastException: com.sun.proxy.$Proxy5 cannot be cast to
brs_repository.IAdmin
at defaultsystem.impl.defaultSystem.<init>(defaultSystem.java:30)
at defaultsystem.impl.defaultSystem.main(defaultSystem.java:190)
... 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.

Environment

None

Activity

Show:
Steffen Becker
August 30, 2016, 5:29 PM

I guess Sebastian has to look at it briefly and at least comment on it...

Assignee

Steffen Becker

Reporter

Anne Koziolek

Labels

None

Requirement Category

Functional

External issue URL

None

Affects versions

Priority

Major