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
85ceca6b
Commit
85ceca6b
authored
Jan 26, 2010
by
Christophe Demarey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add bindings introspections on SCA services.
parent
e8e2e661
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
2 deletions
+56
-2
explorer/core/src/main/java/org/ow2/frascati/explorer/context/ScaInterfaceContext.java
...rg/ow2/frascati/explorer/context/ScaInterfaceContext.java
+2
-2
explorer/core/src/main/java/org/ow2/frascati/explorer/context/ServiceContext.java
...ava/org/ow2/frascati/explorer/context/ServiceContext.java
+54
-0
No files found.
explorer/core/src/main/java/org/ow2/frascati/explorer/context/ScaInterfaceContext.java
View file @
85ceca6b
...
...
@@ -152,7 +152,7 @@ public abstract class ScaInterfaceContext implements Context {
}
}
entries
.
addAll
(
getBindingEntriesFromComponentController
(
owner
,
itf
)
);
entries
.
addAll
(
get
Rmi
BindingEntriesFromComponentController
(
owner
,
itf
)
);
return
entries
;
}
...
...
@@ -164,7 +164,7 @@ public abstract class ScaInterfaceContext implements Context {
* @param itf The interface to search bindings on.
* @return a List with an entry for each binding.
*/
private
List
<
Entry
>
getBindingEntriesFromComponentController
(
Component
owner
,
Interface
itf
)
{
private
List
<
Entry
>
get
Rmi
BindingEntriesFromComponentController
(
Component
owner
,
Interface
itf
)
{
List
<
Entry
>
entries
=
new
ArrayList
<
Entry
>();
try
{
...
...
explorer/core/src/main/java/org/ow2/frascati/explorer/context/ServiceContext.java
View file @
85ceca6b
...
...
@@ -30,7 +30,12 @@ import java.util.List;
import
org.objectweb.fractal.api.Component
;
import
org.objectweb.fractal.api.Interface
;
import
org.objectweb.fractal.api.NoSuchInterfaceException
;
import
org.objectweb.fractal.api.control.BindingController
;
import
org.objectweb.fractal.api.control.ContentController
;
import
org.objectweb.fractal.api.type.InterfaceType
;
import
org.objectweb.fractal.bf.AbstractSkeleton
;
import
org.objectweb.fractal.explorer.FcExplorer
;
import
org.objectweb.util.explorer.api.Entry
;
import
org.objectweb.util.explorer.core.naming.lib.DefaultEntry
;
...
...
@@ -68,6 +73,54 @@ public class ServiceContext extends ScaInterfaceContext {
return
entries
;
}
/**
* Get bindings on SCA services.
* Bindings are implemented as Fractal components. For each binding, you can
* find a skeleton component in the container (the parent) of the service owner.
* So we will search for such skeleton components.
*
* @param owner The component owning the interface to search bindings on.
* @param itf The interface to search bindings on.
* @return a List with an explorer entry for each binding.
*/
private
List
<
Entry
>
getServiceBindingEntries
(
Component
owner
,
Interface
itf
)
{
List
<
Entry
>
entries
=
new
ArrayList
<
Entry
>();
try
{
Component
[]
parents
=
FcExplorer
.
getSuperController
(
owner
).
getFcSuperComponents
();
for
(
Component
c
:
parents
)
{
ContentController
cc
=
FcExplorer
.
getContentController
(
c
);
Component
[]
children
=
cc
.
getFcSubComponents
();
for
(
Component
child
:
children
)
{
String
childName
=
FcExplorer
.
getName
(
child
);
if
(
childName
.
endsWith
(
"-skeleton"
)
)
{
// check that the skeleton is bound to owner
BindingController
bc
=
FcExplorer
.
getBindingController
(
child
);
Interface
servant
=
(
Interface
)
bc
.
lookupFc
(
AbstractSkeleton
.
SERVANT_CLIENT_ITF_NAME
);
if
(
servant
==
itf
)
{
Object
bindingEntry
=
null
;
Interface
servantItf
=
(
Interface
)
child
.
getFcInterface
(
AbstractSkeleton
.
SERVANT_CLIENT_ITF_NAME
);
// Check the binding kind
if
(
childName
.
endsWith
(
"-ws-skeleton"
)
)
bindingEntry
=
new
WsBindingWrapper
(
servantItf
);
else
if
(
childName
.
endsWith
(
"-RESTful-skeleton"
)
)
bindingEntry
=
new
RestBindingWrapper
(
servantItf
);
if
(
bindingEntry
!=
null
)
entries
.
add
(
new
DefaultEntry
(
childName
+
"."
+
AbstractSkeleton
.
SERVANT_CLIENT_ITF_NAME
,
bindingEntry
)
);
}
}
}
}
}
catch
(
NoSuchInterfaceException
e
)
{
e
.
printStackTrace
();
}
return
entries
;
}
/**
* @see org.objectweb.util.explorer.api.Context#getEntries(java.lang.Object)
...
...
@@ -83,6 +136,7 @@ public class ServiceContext extends ScaInterfaceContext {
// Add entries for SCA bindings
entries
.
addAll
(
getBindingEntries
(
owner
,
itf
)
);
entries
.
addAll
(
getServiceBindingEntries
(
owner
,
itf
)
);
// Add entries for SCA intents
entries
.
addAll
(
getIntentEntries
(
owner
,
itfName
)
);
...
...
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