Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
frascati
frascati
Commits
6452c02a
Commit
6452c02a
authored
Jan 21, 2017
by
Lionel Seinturier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor to decrease the dependency to Juliac.
parent
a7318f66
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
70 additions
and
56 deletions
+70
-56
tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/FCCompCtrlSourceCodeGenerator.java
...rascati/tinfi/opt/comp/FCCompCtrlSourceCodeGenerator.java
+21
-14
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/CallBackInterfaceClassGenerator.java
...rascati/tinfi/opt/oo/CallBackInterfaceClassGenerator.java
+3
-3
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/ClientInterfaceClassGenerator.java
.../frascati/tinfi/opt/oo/ClientInterfaceClassGenerator.java
+5
-5
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/FCOOCtrlSourceCodeGenerator.java
...w2/frascati/tinfi/opt/oo/FCOOCtrlSourceCodeGenerator.java
+21
-14
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/SCAContentInterceptorSourceCodeGenerator.java
...infi/opt/oo/SCAContentInterceptorSourceCodeGenerator.java
+3
-3
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/SCAIntentInterceptorSourceCodeGenerator.java
...tinfi/opt/oo/SCAIntentInterceptorSourceCodeGenerator.java
+3
-3
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/SCATinfiInterceptorSourceCodeGenerator.java
.../tinfi/opt/oo/SCATinfiInterceptorSourceCodeGenerator.java
+3
-3
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/ServerInterfaceClassGenerator.java
.../frascati/tinfi/opt/oo/ServerInterfaceClassGenerator.java
+3
-3
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/ServiceReferenceClassGenerator.java
...frascati/tinfi/opt/oo/ServiceReferenceClassGenerator.java
+5
-5
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/SCAContentControllerClassGenerator.java
...infi/opt/oo/light/SCAContentControllerClassGenerator.java
+3
-3
No files found.
tinfi/module/opt-comp/core/src/main/java/org/ow2/frascati/tinfi/opt/comp/FCCompCtrlSourceCodeGenerator.java
View file @
6452c02a
...
...
@@ -124,13 +124,14 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
* for choosing interface source code generator.
*/
String
signature
=
it
.
getFcItfSignature
();
Class
<?>
cl
=
jc
.
loadClass
(
signature
);
final
String
signature
=
it
.
getFcItfSignature
();
final
Class
<?>
cl
=
jc
.
loadClass
(
signature
);
final
String
pkgRoot
=
jc
.
getJuliacConfig
().
getPkgRoot
();
if
(
itname
.
endsWith
(
"-controller"
)
||
itname
.
equals
(
"component"
)
)
{
pcg
=
new
InterfaceImplementationClassGenerator
(
jc
,
it
,
cl
,
membraneDesc
,
false
);
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
false
);
}
else
{
if
(
it
.
isFcClientItf
()
)
{
...
...
@@ -145,12 +146,12 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
*/
pcg
=
new
ClientInterfaceClassGenerator
(
jc
,
it
,
cl
,
membraneDesc
,
false
);
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
false
);
}
else
{
pcg
=
new
ServerInterfaceClassGenerator
(
jc
,
it
,
cl
,
membraneDesc
,
false
);
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
false
);
}
}
...
...
@@ -165,8 +166,9 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
protected
void
generateInterfaceImpl
(
InterfaceType
it
,
String
ctrlDesc
)
throws
IOException
{
String
signature
=
it
.
getFcItfSignature
();
Class
<?>
cl
=
jc
.
loadClass
(
signature
);
final
String
signature
=
it
.
getFcItfSignature
();
final
Class
<?>
cl
=
jc
.
loadClass
(
signature
);
final
String
pkgRoot
=
jc
.
getJuliacConfig
().
getPkgRoot
();
String
itname
=
it
.
getFcItfName
();
if
(
itname
.
endsWith
(
"-controller"
)
||
itname
.
equals
(
"component"
)
)
{
...
...
@@ -181,7 +183,8 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
* for Julia control interfaces.
*/
SourceCodeGeneratorItf
cg
=
new
InterfaceImplementationClassGenerator
(
jc
,
it
,
cl
,
null
,
false
);
new
InterfaceImplementationClassGenerator
(
jc
,
it
,
cl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
}
else
{
...
...
@@ -192,7 +195,7 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
// Server (input) interface implementation
SourceCodeGeneratorItf
cg
=
new
ServerInterfaceClassGenerator
(
jc
,
it
,
cl
,
null
,
false
);
new
ServerInterfaceClassGenerator
(
jc
,
it
,
cl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
if
(
it
.
isFcClientItf
()
)
{
...
...
@@ -202,12 +205,13 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
* since client interface implementations extend the server
* interface implementation corresponding to the same type.
*/
cg
=
new
ClientInterfaceClassGenerator
(
jc
,
it
,
cl
,
null
,
false
);
cg
=
new
ClientInterfaceClassGenerator
(
jc
,
it
,
cl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
}
// ServiceReference implementation
cg
=
new
ServiceReferenceClassGenerator
(
jc
,
it
,
cl
,
null
,
false
);
cg
=
new
ServiceReferenceClassGenerator
(
jc
,
it
,
cl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
// ServiceReference and input interface implementations for callbacks
...
...
@@ -217,14 +221,17 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
"org.oasisopen.sca.annotation.Callback"
,
"org.osoa.sca.annotations.Callback"
);
if
(
annot
!=
null
)
{
Class
<?>
cbcl
=
AnnotationHelper
.
getAnnotationParamValue
(
annot
,
"value"
);
Class
<?>
cbcl
=
AnnotationHelper
.
getAnnotationParamValue
(
annot
,
"value"
);
InterfaceType
cbit
=
new
BasicInterfaceType
(
"callback"
,
cbcl
.
getName
(),
false
,
false
,
false
);
cg
=
new
ServiceReferenceClassGenerator
(
jc
,
cbit
,
cbcl
,
null
,
false
);
cg
=
new
ServiceReferenceClassGenerator
(
jc
,
cbit
,
cbcl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
cg
=
new
CallBackInterfaceClassGenerator
(
jc
,
cbit
,
cbcl
,
null
,
false
);
cg
=
new
CallBackInterfaceClassGenerator
(
jc
,
cbit
,
cbcl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
}
}
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/CallBackInterfaceClassGenerator.java
View file @
6452c02a
...
...
@@ -49,10 +49,10 @@ extends AbstractProxyClassGenerator {
public
CallBackInterfaceClassGenerator
()
{}
public
CallBackInterfaceClassGenerator
(
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
String
pkgRoot
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
super
(
jc
,
it
,
cl
,
membraneDesc
,
mergeable
);
super
(
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
mergeable
);
}
/**
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/ClientInterfaceClassGenerator.java
View file @
6452c02a
...
...
@@ -48,10 +48,10 @@ public class ClientInterfaceClassGenerator
extends
ServerInterfaceClassGenerator
{
public
ClientInterfaceClassGenerator
(
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
String
pkgRoot
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
super
(
jc
,
it
,
cl
,
membraneDesc
,
mergeable
);
super
(
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
mergeable
);
}
/**
...
...
@@ -71,7 +71,7 @@ extends ServerInterfaceClassGenerator {
*/
SourceCodeGeneratorItf
cg
=
new
ServerInterfaceClassGenerator
(
jc
,
it
,
proxycl
,
membraneDesc
,
mergeable
);
jc
,
it
,
proxycl
,
pkgRoot
,
membraneDesc
,
mergeable
);
String
name
=
cg
.
getTargetTypeName
();
/*
...
...
@@ -116,7 +116,7 @@ extends ServerInterfaceClassGenerator {
"getServiceReference"
,
null
,
null
);
SourceCodeGeneratorItf
cg
=
new
ServiceReferenceClassGenerator
(
jc
,
it
,
this
.
proxycl
,
membraneDesc
,
mergeable
);
jc
,
it
,
this
.
proxycl
,
pkgRoot
,
membraneDesc
,
mergeable
);
String
srclname
=
cg
.
getTargetTypeName
();
mv
.
visit
(
" return new "
);
mv
.
visit
(
srclname
);
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/FCOOCtrlSourceCodeGenerator.java
View file @
6452c02a
...
...
@@ -101,9 +101,10 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
public
ProxyClassGeneratorItf
getInterfaceClassGenerator
(
InterfaceType
it
,
MembraneDesc
<?>
membraneDesc
)
{
String
signature
=
it
.
getFcItfSignature
();
Class
<?>
cl
=
jc
.
loadClass
(
signature
);
final
String
signature
=
it
.
getFcItfSignature
();
final
Class
<?>
cl
=
jc
.
loadClass
(
signature
);
final
String
pkgRoot
=
jc
.
getJuliacConfig
().
getPkgRoot
();
ProxyClassGeneratorItf
pcg
=
null
;
String
itname
=
it
.
getFcItfName
();
...
...
@@ -115,7 +116,7 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
if
(
itname
.
endsWith
(
"-controller"
)
||
itname
.
equals
(
"component"
)
)
{
pcg
=
new
InterfaceImplementationClassGenerator
(
jc
,
it
,
cl
,
membraneDesc
,
false
);
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
false
);
}
else
{
if
(
it
.
isFcClientItf
()
)
{
...
...
@@ -130,12 +131,12 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
*/
pcg
=
new
ClientInterfaceClassGenerator
(
jc
,
it
,
cl
,
membraneDesc
,
false
);
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
false
);
}
else
{
pcg
=
new
ServerInterfaceClassGenerator
(
jc
,
it
,
cl
,
membraneDesc
,
false
);
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
false
);
}
}
...
...
@@ -150,8 +151,9 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
protected
void
generateInterfaceImpl
(
InterfaceType
it
,
String
ctrlDesc
)
throws
IOException
{
String
signature
=
it
.
getFcItfSignature
();
Class
<?>
cl
=
jc
.
loadClass
(
signature
);
final
String
signature
=
it
.
getFcItfSignature
();
final
Class
<?>
cl
=
jc
.
loadClass
(
signature
);
final
String
pkgRoot
=
jc
.
getJuliacConfig
().
getPkgRoot
();
String
itname
=
it
.
getFcItfName
();
if
(
itname
.
endsWith
(
"-controller"
)
||
itname
.
equals
(
"component"
)
)
{
...
...
@@ -166,7 +168,8 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
* for Julia control interfaces.
*/
SourceCodeGeneratorItf
cg
=
new
InterfaceImplementationClassGenerator
(
jc
,
it
,
cl
,
null
,
false
);
new
InterfaceImplementationClassGenerator
(
jc
,
it
,
cl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
}
else
{
...
...
@@ -177,7 +180,7 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
// Server (input) interface implementation
SourceCodeGeneratorItf
cg
=
new
ServerInterfaceClassGenerator
(
jc
,
it
,
cl
,
null
,
false
);
new
ServerInterfaceClassGenerator
(
jc
,
it
,
cl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
if
(
it
.
isFcClientItf
()
)
{
...
...
@@ -187,12 +190,14 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
* since client interface implementations extend the server
* interface implementation corresponding to the same type.
*/
cg
=
new
ClientInterfaceClassGenerator
(
jc
,
it
,
cl
,
null
,
false
);
cg
=
new
ClientInterfaceClassGenerator
(
jc
,
it
,
cl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
}
// ServiceReference implementation
cg
=
new
ServiceReferenceClassGenerator
(
jc
,
it
,
cl
,
null
,
false
);
cg
=
new
ServiceReferenceClassGenerator
(
jc
,
it
,
cl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
// ServiceReference and input interface implementations for callbacks
...
...
@@ -207,10 +212,12 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
InterfaceType
cbit
=
new
BasicInterfaceType
(
"callback"
,
cbcl
.
getName
(),
false
,
false
,
false
);
cg
=
new
ServiceReferenceClassGenerator
(
jc
,
cbit
,
cbcl
,
null
,
false
);
cg
=
new
ServiceReferenceClassGenerator
(
jc
,
cbit
,
cbcl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
cg
=
new
CallBackInterfaceClassGenerator
(
jc
,
cbit
,
cbcl
,
null
,
false
);
cg
=
new
CallBackInterfaceClassGenerator
(
jc
,
cbit
,
cbcl
,
pkgRoot
,
null
,
false
);
jc
.
generateSourceCode
(
cg
);
}
}
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/SCAContentInterceptorSourceCodeGenerator.java
View file @
6452c02a
...
...
@@ -50,10 +50,10 @@ extends AbstractInterceptorSourceCodeGenerator {
}
public
SCAContentInterceptorSourceCodeGenerator
(
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
String
pkgRoot
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
super
(
jc
,
it
,
cl
,
membraneDesc
,
mergeable
);
super
(
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
mergeable
);
}
/**
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/SCAIntentInterceptorSourceCodeGenerator.java
View file @
6452c02a
...
...
@@ -58,10 +58,10 @@ extends AbstractInterceptorSourceCodeGenerator {
}
public
SCAIntentInterceptorSourceCodeGenerator
(
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
String
pkgRoot
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
super
(
jc
,
it
,
cl
,
membraneDesc
,
mergeable
);
super
(
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
mergeable
);
}
/**
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/SCATinfiInterceptorSourceCodeGenerator.java
View file @
6452c02a
...
...
@@ -46,10 +46,10 @@ extends AbstractInterceptorSourceCodeGenerator {
}
public
SCATinfiInterceptorSourceCodeGenerator
(
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
String
pkgRoot
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
super
(
jc
,
it
,
cl
,
membraneDesc
,
mergeable
);
super
(
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
mergeable
);
}
/**
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/ServerInterfaceClassGenerator.java
View file @
6452c02a
...
...
@@ -44,10 +44,10 @@ public class ServerInterfaceClassGenerator
extends
InterfaceImplementationClassGenerator
{
public
ServerInterfaceClassGenerator
(
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
String
pkgRoot
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
super
(
jc
,
it
,
cl
,
membraneDesc
,
mergeable
);
super
(
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
mergeable
);
}
/**
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/ServiceReferenceClassGenerator.java
View file @
6452c02a
...
...
@@ -62,10 +62,10 @@ extends AbstractProxyClassGenerator {
public
ServiceReferenceClassGenerator
()
{}
public
ServiceReferenceClassGenerator
(
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
Juliac
jc
,
InterfaceType
it
,
Class
<?>
cl
,
String
pkgRoot
,
MembraneDesc
<?>
membraneDesc
,
boolean
mergeable
)
{
super
(
jc
,
it
,
cl
,
membraneDesc
,
mergeable
);
super
(
jc
,
it
,
cl
,
pkgRoot
,
membraneDesc
,
mergeable
);
}
/**
...
...
@@ -233,12 +233,12 @@ extends AbstractProxyClassGenerator {
"callback"
,
callbackClass
.
getName
(),
false
,
false
,
false
);
SourceCodeGeneratorItf
cg
=
new
CallBackInterfaceClassGenerator
(
jc
,
cbit
,
callbackClass
,
null
,
mergeable
);
jc
,
cbit
,
callbackClass
,
pkgRoot
,
null
,
mergeable
);
String
cbitfclname
=
cg
.
getTargetTypeName
();
cg
=
new
ServiceReferenceClassGenerator
(
jc
,
cbit
,
callbackClass
,
null
,
mergeable
);
jc
,
cbit
,
callbackClass
,
pkgRoot
,
null
,
mergeable
);
String
cbcrclname
=
cg
.
getTargetTypeName
();
mv
.
visit
(
" "
+
ComponentInterface
.
class
.
getName
()+
" ci = ("
);
...
...
tinfi/module/opt-oo/core/src/main/java/org/ow2/frascati/tinfi/opt/oo/light/SCAContentControllerClassGenerator.java
View file @
6452c02a
...
...
@@ -142,9 +142,9 @@ extends ClassGenerator {
* Return the name of the class generated by this generator.
*/
public
String
getTargetTypeName
()
{
String
targetClassName
=
contentClassName
+
SUFFIX
;
String
rootedT
argetClassName
=
jc
.
getRootedClassName
(
targe
tClassName
)
;
return
rootedT
argetClassName
;
final
String
pkgRoot
=
jc
.
getJuliacConfig
().
getPkgRoot
()
;
final
String
t
argetClassName
=
pkgRoot
+
conten
tClassName
+
SUFFIX
;
return
t
argetClassName
;
}
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment