本文整理了Java中org.objectweb.fractal.util.Fractal.getSuperController()
方法的一些代码示例,展示了Fractal.getSuperController()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fractal.getSuperController()
方法的具体详情如下:
包路径:org.objectweb.fractal.util.Fractal
类名称:Fractal
方法名:getSuperController
[英]Returns the SuperController interface of the given component.
[中]返回给定组件的超级控制器接口。
代码示例来源:origin: org.ow2.fractal.bf/fractal-bf-core
/**
* Return the parent component of the specified component. If the component
* has more than one parent component, the first one is returned.
*
* @param comp
* @return the first parent component of the given component.
* @throws NoSuchInterfaceException
* if the comp does not provide the {@link SuperController}
* interface.
*/
protected Component getParentComponent(Component comp)
throws NoSuchInterfaceException {
Component parentComposite = Fractal.getSuperController(comp)
.getFcSuperComponents()[0];
return parentComposite;
}
代码示例来源:origin: org.objectweb.fractal.bf/util
/**
* Get the enclosing component of a given component. The case of shared components
* is not considered.
*
* @param component a component
* @return return the closest enclosing component, null otherwise
* @throws NoSuchInterfaceException if the input component does not implement
* the {@link SuperController} interface
*/
public static Component directParentOf(final Component component)
throws NoSuchInterfaceException
{
Component parent = null;
SuperController compSC = org.objectweb.fractal.util.Fractal
.getSuperController(component);
Component[] fcSuperComponents = compSC.getFcSuperComponents();
if (fcSuperComponents.length > 0)
{
parent = fcSuperComponents[0];
}
return parent;
}
代码示例来源:origin: org.ow2.jasmine.jade/jade-fractal
public Component[] getApplications() {
List<Component> applications = new ArrayList<Component>();
Component managedElements[] = _this_weaveableCC.getFcSubComponents();
for(Component managedElement : managedElements){
try {
Component parents[] = Fractal.getSuperController(managedElement).getFcSuperComponents();
if(parents.length == 1)
applications.add(managedElement);
} catch (NoSuchInterfaceException ignored) {
}
}
return applications.toArray(new Component[]{});
}
代码示例来源:origin: org.objectweb.fractal.fractaljmx/fractal-jmx
private boolean isShared(Component id) {
boolean shared = false;
try {
Component ids[] = Fractal.getSuperController(id).getFcSuperComponents();
if (ids.length > 1)
shared = true;
else if (ids.length > 1)
shared = isShared(ids[0]);
} catch (NoSuchInterfaceException ignored) {}
return shared;
}
代码示例来源:origin: org.objectweb.fractal.fractaljmx/fractal-jmx
private Set exposeSuper(Component id, Set set) {
try {
SuperController supCtrl = Fractal.getSuperController(id);
Component ids[] = supCtrl.getFcSuperComponents();
if (ids.length == 0){
set.add(id);
}
else for (int j = 0; j < ids.length; j++) {
try{
ids[j].getFcInterface("admin");
exposeSuper(ids[j], set);
} catch (NoSuchInterfaceException e) { set.add(ids[j]);}
}
} catch (NoSuchInterfaceException e) { set.add(id);}
return set;
}
代码示例来源:origin: org.objectweb.fractal.fractaljmx/fractal-jmx
private String[] getFullFCName(Component id) {
String[] names = null;
try {
Component ids[] = Fractal.getSuperController(id).getFcSuperComponents();
List l = new ArrayList();
for (int i = 0; i < ids.length; i++) {
String[] tmp = getFullFCName(ids[i]);
for (int j = 0; j < tmp.length; j++)
tmp[j] += "/" + getFCName(id);
l.addAll(Arrays.asList(tmp));
}
names = (String[]) l.toArray(new String[l.size()]);
} catch (NoSuchInterfaceException ignored) {}
if (names == null || names.length == 0) {
names = new String[1];
names[0] = getFCName(id);
}
return names;
}
代码示例来源:origin: org.ow2.frascati/frascati-binding-factory
/**
* Return the parent container of the specified component.
* A container is a component with the "-container" suffix.
*
* @param comp - A binding component
* @return the parent container of the given component, null if not found.
* @throws NoSuchInterfaceException
* if the comp does not provide the {@link SuperController}
* interface.
*/
@Override
protected final Component getParentComponent(Component comp)
throws NoSuchInterfaceException
{
Component[] parents = Fractal.getSuperController(comp).getFcSuperComponents();
for (Component parent: parents) {
if (Fractal.getNameController(parent).getFcName().endsWith("-container")) {
return parent;
}
}
return parents[0]; // No container found, keep the previous behavior: return the first parent
}
代码示例来源:origin: org.ow2.petals/petals-microkernel-api
/**
* Return the component that contains the parameter component.
*
* We make the assumption this component is owned by only one component.
*
* @param component
* @return the (unique) parent component
* @throws NoSuchInterfaceException
* @throws PetalsException
*/
public static final Component getParentComponent(Component component) throws NoSuchInterfaceException,
PetalsException {
final SuperController sc = Fractal.getSuperController(component);
if (sc.getFcSuperComponents().length != 1) {
throw new PetalsException("Error in fractal architecture");
}
return sc.getFcSuperComponents()[0];
}
代码示例来源:origin: com.ebmwebsourcing.easycommons/easycommons-sca-impl
public Component getParent(final Component childrenComponent)
throws SCAException {
Component parent = null;
try {
final SuperController superController = Fractal
.getSuperController(childrenComponent);
Component parents[] = superController.getFcSuperComponents();
if (parents.length > 1) {
throw new SCAException("This component ("
+ childrenComponent
+ ") has several parents: It is a shared component");
}
if (parents.length == 1) {
parent = parents[0];
}
} catch (final NoSuchInterfaceException e) {
throw new SCAException(e);
}
return parent;
}
代码示例来源:origin: org.ow2.frascati/frascati-fscript-core
SuperController cc = Fractal.getSuperController(comp);
Set<Node> result = new HashSet<Node>();
for (Component parent : cc.getFcSuperComponents()) {
代码示例来源:origin: org.ow2.petals.dsb/dsb-kernel
public <T> T get(Class<T> t, String componentName, String serviceName) {
T result = null;
try {
SuperController sc = Fractal.getSuperController(this.component);
Component parentcontainer = sc.getFcSuperComponents()[0];
ContentController cc = Fractal.getContentController(parentcontainer);
Component c = FractalHelper.getRecursiveComponentByName(cc, componentName);
if (c != null) {
String name = (serviceName != null) ? serviceName : "service";
Object o = c.getFcInterface(name);
if (o != null) {
try {
result = t.cast(o);
} catch (ClassCastException e) {
e.printStackTrace();
}
}
} else {
System.out.println("No such component : " + componentName);
}
} catch (NoSuchInterfaceException e) {
e.printStackTrace();
}
return result;
}
}
代码示例来源:origin: org.objectweb.fractal.cecilia.toolchain/plugin-framework
.getSuperController(this.weaveableC);
代码示例来源:origin: org.ow2.petals.dsb/dsb-kernel
public void onStop() {
try {
SuperController sc = Fractal.getSuperController(this.component);
if (sc.getFcSuperComponents().length != 1) {
this.log.warning("Can not find a super component to look for shutdown annotations in the architecture");
代码示例来源:origin: org.ow2.petals.dsb/dsb-kernel
public <T> T get(Class<T> t, String componentName, String serviceName) throws DSBException {
T result = null;
try {
SuperController sc = Fractal.getSuperController(this.component);
Component parentcontainer = sc.getFcSuperComponents()[0];
ContentController cc = Fractal.getContentController(parentcontainer);
Component c = FractalHelper.getRecursiveComponentByName(cc, componentName);
if (c != null) {
String name = (serviceName != null) ? serviceName : DEFAULT_SERVICE_NAME;
Object o = c.getFcInterface(name);
if (o != null) {
try {
result = t.cast(o);
} catch (ClassCastException e) {
throw new DSBException(e.getMessage());
}
}
} else {
throw new DSBException("No such component : " + componentName);
}
} catch (NoSuchInterfaceException e) {
throw new DSBException(e.getMessage());
}
return result;
}
}
代码示例来源:origin: org.ow2.petals.dsb/dsb-kernel
public void onStart() {
try {
SuperController sc = Fractal.getSuperController(this.component);
if (sc.getFcSuperComponents().length != 1) {
this.log.warning("Can not find a super component to look for startup annotations in the architecture");
代码示例来源:origin: org.ow2.frascati/frascati-fscript-core
Component[] parents = Fractal.getSuperController(itfOwner).getFcSuperComponents();
for (Component parent : parents) {
Component[] children = Fractal.getContentController(parent).getFcSubComponents();
代码示例来源:origin: org.ow2.petals.dsb/dsb-kernel
SuperController sc = Fractal.getSuperController(this.component);
if (sc.getFcSuperComponents().length != 1) {
this.log.warning("Can not find a super component to look at WS children");
代码示例来源:origin: org.objectweb.petals/petals-kernel
/**
* Initialization of the petals component.
*
* @throws PetalsException :
* impossible to start the component
* @throws JBIException :
* JBI error
* @throws NoSuchInterfaceException :
* Fractal Error
* @throws ADLException :
* Fractal error
*
*/
@LifeCycle(on = LifeCycleType.START)
public void start() throws PetalsException, NoSuchInterfaceException,
JBIException, ADLException {
this.log = new LoggingUtil(this.logger);
this.log.start();
ContainerServiceImpl.fractalHelper = FractalHelper.getFractalHelper();
SuperController sc = Fractal.getSuperController(this.comp);
if (sc.getFcSuperComponents().length != 1) {
throw new PetalsException("Error in fractal architecture");
}
this.parentcontainer = sc.getFcSuperComponents()[0];
this.log.end();
}
代码示例来源:origin: org.ow2.petals/petals-kernel
SuperController sc = Fractal.getSuperController(this.comp);
if (sc.getFcSuperComponents().length != 1) {
throw new PetalsException("Error in fractal architecture");
代码示例来源:origin: org.ow2.frascati/frascati-assembly-factory
try {
Component[] parents = Fractal.getSuperController(component).getFcSuperComponents();
内容来源于网络,如有侵权,请联系作者删除!