ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

Disallow service creation in Ballerina with the MI Connector #7327

Closed poorna2152 closed 2 weeks ago

poorna2152 commented 2 weeks ago

Current Limitation

Ballerina code for the ballerina-mi connector can have service definitions inside it.

Suggested Improvement

Ballerina services can be defined in the code either through a service declaration or by registering services dynamically at runtime. However, when the MI connector is imported, creating or registering services at runtime should be disallowed. This restriction is necessary to prevent the allocation of ports within the Ballerina code used in the MI environment.

Version

No response

poorna2152 commented 2 weeks ago

It was decided to update the compiler plugin to disallow, service declarations and listener declarations and also to disallow objects and class definitions which are having the shape of the Listener in Ballerina. The listener declaration and the disallowing type definitions with the shape of Listener is to dis allow dynamic registering of services at the runtime