Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frascati
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
114
Issues
114
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
frascati
frascati
Commits
c1c75470
Commit
c1c75470
authored
Feb 15, 2010
by
Christophe Demarey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scaparent, scasibling, scaancestor axes.
parent
a48c0540
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
126 additions
and
6 deletions
+126
-6
fscript/RELEASE_NOTES.txt
fscript/RELEASE_NOTES.txt
+3
-0
fscript/src/main/java/org/ow2/frascati/fscript/model/FraSCAtiModel.java
...in/java/org/ow2/frascati/fscript/model/FraSCAtiModel.java
+7
-6
fscript/src/main/java/org/ow2/frascati/fscript/model/ScaParentAxis.java
...in/java/org/ow2/frascati/fscript/model/ScaParentAxis.java
+116
-0
No files found.
fscript/RELEASE_NOTES.txt
View file @
c1c75470
FraSCAti Script 1.3
---------------------
* Add a transitive (scadescendant) and reflexive (scadescendant-or-self) axis for scachild
* Add the scaparent axis
* Add a transitive (scaancestor) and reflexive (scaancestor-or-self) axis for scaparent
* Add the scasibling axis
FraSCAti Script 1.2
---------------------
...
...
fscript/src/main/java/org/ow2/frascati/fscript/model/FraSCAtiModel.java
View file @
c1c75470
...
...
@@ -29,6 +29,7 @@ import static org.objectweb.fractal.fscript.types.PrimitiveType.STRING;
import
org.objectweb.fractal.api.Component
;
import
org.objectweb.fractal.api.Interface
;
import
org.objectweb.fractal.api.NoSuchInterfaceException
;
import
org.objectweb.fractal.fscript.model.ComposedAxis
;
import
org.objectweb.fractal.fscript.model.Model
;
import
org.objectweb.fractal.fscript.model.Property
;
import
org.objectweb.fractal.fscript.model.ReflectiveAxis
;
...
...
@@ -93,7 +94,7 @@ public class FraSCAtiModel
super
.
createAxes
();
// Base axes
addAxis
(
new
ScaChildAxis
(
this
));
// addAxis(new
ParentAxis(this));
addAxis
(
new
Sca
ParentAxis
(
this
));
// addAxis(new ComponentAxis(this));
addAxis
(
new
ScaServiceAxis
(
this
));
addAxis
(
new
ScaReferenceAxis
(
this
));
...
...
@@ -103,15 +104,15 @@ public class FraSCAtiModel
addAxis
(
new
ScaIntentAxis
(
this
));
// Transitive axes
addAxis
(
new
TransitiveAxis
(
getAxis
(
"scachild"
),
"scadescendant"
));
//
addAxis(new TransitiveAxis(getAxis("scaparent"), "scaancestor"));
addAxis
(
new
TransitiveAxis
(
getAxis
(
"scaparent"
),
"scaancestor"
));
// Composed axes
// addAxis(new ComposedAxis("
sibling", getAxis("scaparent"), getAxis("scachild")));
addAxis
(
new
ComposedAxis
(
"sca
sibling"
,
getAxis
(
"scaparent"
),
getAxis
(
"scachild"
)));
// Reflective axes
addAxis
(
new
ReflectiveAxis
(
getAxis
(
"scachild"
)));
//
addAxis(new ReflectiveAxis(getAxis("scaparent")));
addAxis
(
new
ReflectiveAxis
(
getAxis
(
"scaparent"
)));
addAxis
(
new
ReflectiveAxis
(
getAxis
(
"scadescendant"
)));
//
addAxis(new ReflectiveAxis(getAxis("scaancestor")));
//
addAxis(new ReflectiveAxis(getAxis("scasibling")));
addAxis
(
new
ReflectiveAxis
(
getAxis
(
"scaancestor"
)));
addAxis
(
new
ReflectiveAxis
(
getAxis
(
"scasibling"
)));
}
/**
...
...
fscript/src/main/java/org/ow2/frascati/fscript/model/ScaParentAxis.java
0 → 100644
View file @
c1c75470
/***
* OW2 FraSCAti fscript
* Copyright (C) 2010 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Demarey
*
* Contributor(s):
*
*/
package
org.ow2.frascati.fscript.model
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.Set
;
import
java.util.logging.Logger
;
import
org.objectweb.fractal.api.Component
;
import
org.objectweb.fractal.api.NoSuchInterfaceException
;
import
org.objectweb.fractal.api.control.SuperController
;
import
org.objectweb.fractal.fscript.model.AbstractAxis
;
import
org.objectweb.fractal.fscript.model.Node
;
import
org.objectweb.fractal.fscript.model.fractal.ComponentNode
;
import
org.objectweb.fractal.util.Fractal
;
/**
* Implements the <code>scaparent</code> axis in FPath. This axis connects SCA
* components to their direct parents (if any). This axis is not modifiable
* directly (although changes to the <code>child</code> axis will reflect on
* this one).
*
* @author Christophe Demarey.
*/
public
class
ScaParentAxis
extends
AbstractAxis
{
/** The logger */
private
static
Logger
logger
=
Logger
.
getLogger
(
"org.ow2.frascati.fscript.model.ScaParentAxis"
);
/**
* Default constructor.
*
* @param model The model referencing this axis.
*/
public
ScaParentAxis
(
FraSCAtiModel
model
)
{
super
(
model
,
"scaparent"
,
"scacomponent"
,
"scacomponent"
);
}
public
boolean
isPrimitive
()
{
return
true
;
}
public
boolean
isModifiable
()
{
return
false
;
}
/**
* Get nodes for this axis from the specified source node.
*
* @param source The source node to introspect.
* @return A set of nodes.
*/
public
Set
<
Node
>
selectFrom
(
Node
source
)
{
Component
comp
=
((
ComponentNode
)
source
).
getComponent
();
String
compName
=
null
;
try
{
compName
=
Fractal
.
getNameController
(
comp
).
getFcName
();
}
catch
(
NoSuchInterfaceException
e1
)
{
logger
.
warning
(
comp
+
"should have a Name Controller!"
);
}
try
{
SuperController
cc
=
Fractal
.
getSuperController
(
comp
);
Set
<
Node
>
result
=
new
HashSet
<
Node
>();
for
(
Component
parent
:
cc
.
getFcSuperComponents
())
{
try
{
parent
.
getFcInterface
(
org
.
ow2
.
frascati
.
tinfi
.
control
.
component
.
ReconfigurableComponentContext
.
NAME
);
ScaComponentNode
node
=
((
NodeFactory
)
model
).
createScaComponentNode
(
parent
);
// Check that parent is not an hidden frascati container
if
(
compName
!=
null
)
{
String
parentName
=
null
;
try
{
parentName
=
Fractal
.
getNameController
(
parent
).
getFcName
();
}
catch
(
NoSuchInterfaceException
e1
)
{
logger
.
warning
(
parent
+
"should have a Name Controller!"
);
}
if
(
(
parentName
!=
null
)
&&
(
parentName
.
compareTo
(
compName
+
"-container"
)
!=
0
))
result
.
add
(
node
);
}
}
catch
(
NoSuchInterfaceException
e
)
{
/* The sca-component-controller cannot be found!
This component is not a SCA component => Nothing to do! */
}
}
return
result
;
// Collections.unmodifiableSet(result);
}
catch
(
NoSuchInterfaceException
e
)
{
// Not a composite, no children.
return
Collections
.
emptySet
();
}
}
}
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