Internal services #45
Conversation
…loading embedded services
} | ||
else if (this.internalServiceProgram != null) { | ||
program = this.internalServiceProgram; | ||
OLParseTreeOptimizer optimizer = new OLParseTreeOptimizer( program ); |
fmontesi
May 18, 2015
Member
Looks like this code is duplicated with the one in the next branch.
Looks like this code is duplicated with the one in the next branch.
this.type = type; | ||
} | ||
|
||
public Constants.EmbeddedServiceType getType() |
fmontesi
May 18, 2015
Member
Please rename getType() to type()
Please rename getType() to type()
null, | ||
protocolConfiguration, | ||
new InputPortInfo.AggregationItemInfo[] {}, | ||
new HashMap<String, String>() ); |
fmontesi
May 18, 2015
Member
Use Collections.emptyMap()
Use Collections.emptyMap()
//initialize internal interface and interface list | ||
List< InterfaceDefinition > interfaceList = new ArrayList< InterfaceDefinition >(); | ||
|
||
OLSyntaxNode internal_main = null; |
fmontesi
May 18, 2015
Member
internal_main -> internalMain
internal_main -> internalMain
List< InterfaceDefinition > interfaceList = new ArrayList< InterfaceDefinition >(); | ||
|
||
OLSyntaxNode internal_main = null; | ||
SequenceStatement internal_init = null; |
fmontesi
May 18, 2015
Member
internal_init -> internalInit
internal_init -> internalInit
fmontesi
May 18, 2015
Member
internal_init could probably just be OLSyntaxNode, SequenceStatement seems redundant.
internal_init could probably just be OLSyntaxNode, SequenceStatement seems redundant.
@@ -30,6 +32,8 @@ | |||
private final String servicePath; | |||
private final String portId; | |||
private final Constants.EmbeddedServiceType type; | |||
|
|||
private final List< OLSyntaxNode > children = new ArrayList< OLSyntaxNode > (); |
fmontesi
May 18, 2015
Member
Why a generic children list, and not just store a Program reference?
Why a generic children list, and not just store a Program reference?
@@ -0,0 +1,458 @@ | |||
/*************************************************************************** |
fmontesi
May 18, 2015
Member
Where is this class used? Please remove it if unused (we could move it to an external library though maybe... but let's leave it for another patch).
Where is this class used? Please remove it if unused (we could move it to an external library though maybe... but let's leave it for another patch).
if ( child instanceof TypeInlineDefinition || | ||
child instanceof InterfaceDefinition || | ||
child instanceof OutputPortInfo || | ||
child instanceof EmbeddedServiceNode ) |
fmontesi
May 18, 2015
Member
This does not look like the right way of implementing the first requirement in Semantics of #27 .
It's going to duplicate embedded services, which could be a problem in case of sub-services written in Jolie (and even Java, although many are harmless, like Console).
What we should do is implement some mechanism for the internal service to wait for the bindings for the output ports at runtime. This doesn't look too easy, we need to think of the lifecycle defined in:
https://github.com/jolie/jolie/blob/master/jolie/src/jolie/process/InitDefinitionProcess.java
Embedded services are loaded before the init procedure starts, so the internal service can't wait for the parent's init to end before "copying over" the bindings for the output ports or we'll create a deadlock.
This does not look like the right way of implementing the first requirement in Semantics of #27 .
It's going to duplicate embedded services, which could be a problem in case of sub-services written in Jolie (and even Java, although many are harmless, like Console).
What we should do is implement some mechanism for the internal service to wait for the bindings for the output ports at runtime. This doesn't look too easy, we need to think of the lifecycle defined in:
https://github.com/jolie/jolie/blob/master/jolie/src/jolie/process/InitDefinitionProcess.java
Embedded services are loaded before the init procedure starts, so the internal service can't wait for the parent's init to end before "copying over" the bindings for the output ports or we'll create a deadlock.
Great patch, thanks. :-) Indentation looks weird sometimes. Please follow the style of the rest of the code (spaces in parentheses) and use tabs instead of spaces. @jolie/developers More eyeballs on the patch are welcome. |
The formatting rules I used (updated to last year I think, but netbeans should not have changed so much hopefully?..) |
Again, thank you for the comments and recommendations! The latest commits should fix the concerns that you had. Let me know if further changes are needed! |
Adding support for internal services