本文整理了Java中org.objectweb.fractal.util.Fractal.getNameController()
方法的一些代码示例,展示了Fractal.getNameController()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fractal.getNameController()
方法的具体详情如下:
包路径:org.objectweb.fractal.util.Fractal
类名称:Fractal
方法名:getNameController
[英]Returns the NameController interface of the given component.
[中]返回给定组件的NameController接口。
代码示例来源:origin: org.ow2.petals/petals-microkernel-api
public static NameController getNameController(final Component component) {
try {
return Fractal.getNameController(component);
} catch (NoSuchInterfaceException e) {
throw new UncheckedException("This can't happen", e);
}
}
}
代码示例来源:origin: org.objectweb.fractal.fractaljmx/fractal-jmx
private String getFCName(Component id) {
try {
NameController nc = Fractal.getNameController(id);
return nc.getFcName();
} catch (NoSuchInterfaceException e) {
throw new IllegalStateException("NameController required");
}
}
代码示例来源:origin: com.ebmwebsourcing.easycommons/easycommons-sca-impl
public String getName(final Component comp) {
String res = null;
try {
if (comp != null) {
final NameController nc = Fractal.getNameController(comp);
res = nc.getFcName();
}
} catch (final NoSuchInterfaceException e) {
// Do nothing
}
return res;
}
代码示例来源:origin: org.objectweb.fractal.cecilia.toolchain/plugin-framework
private void escapePluginComponentName(final Component plugin)
throws NoSuchInterfaceException {
final NameController nc = Fractal.getNameController(plugin);
final String originalName = nc.getFcName();
final String escapedName = originalName.replaceAll("[.]", "_");
nc.setFcName(escapedName);
}
代码示例来源:origin: org.ow2.petals/petals-microkernel-api
public static List<Component> getComponentListByPrefix(
final ContentController parentContentController, final String prefix) {
List<Component> components = new ArrayList<>();
// List content controller subcomponents
for (Component component : parentContentController.getFcSubComponents()) {
try {
String componentName = Fractal.getNameController(component).getFcName();
if (componentName.startsWith(prefix)) {
components.add(component);
}
} catch (NoSuchInterfaceException e) {
// do nothing
}
}
return components;
}
代码示例来源:origin: org.ow2.petals/petals-kernel
public static List<Component> getComponentListByPrefix(
final ContentController parentContentController, final String prefix) {
List<Component> components = new ArrayList<Component>();
// List content controller subcomponents
for (Component component : parentContentController.getFcSubComponents()) {
try {
String componentName = Fractal.getNameController(component).getFcName();
if (componentName.startsWith(prefix)) {
components.add(component);
}
} catch (NoSuchInterfaceException e) {
// do nothing
}
}
return components;
}
代码示例来源:origin: org.ow2.fractal.bf/fractal-bf-core
/**
* Used internally to set human-readable names to stubs and skeletons.
*/
private void setComponentName(final Component base,
final Component bindingComponent, final String suffix) {
String bindingComponentName = suffix;
NameController nc;
try {
nc = Fractal.getNameController(base);
} catch (NoSuchInterfaceException e) {
log.warning("Could not retrieve NamingController on component "
+ base + ", not setting any name.");
return;
}
if (nc != null) {
String ownerName = nc.getFcName();
bindingComponentName = ownerName + "-" + bindingComponentName;
}
try {
Fractal.getNameController(bindingComponent).setFcName(
bindingComponentName);
} catch (NoSuchInterfaceException e) {
log.warning("Could not retrieve NamingController on component "
+ bindingComponent + ", not setting any name.");
return;
}
}
代码示例来源:origin: org.ow2.frascati/frascati-fscript-core
@Override
public final String toString()
{
String ownerName = "<unnamed>";
try {
ownerName = Fractal.getNameController(owner).getFcName();
} catch (NoSuchInterfaceException nsie) {
// Ignore.
}
return "#<scaproperty: " + ownerName + "." + getName() + ">";
}
}
代码示例来源:origin: org.ow2.petals/petals-kernel
public static Component getComponentByName(final ContentController parentContentController,
final String name) {
// List content controller subcomponents
for (Component component : parentContentController.getFcSubComponents()) {
try {
String componentName = Fractal.getNameController(component).getFcName();
if (componentName.equals(name)) {
return component;
}
} catch (NoSuchInterfaceException e) {
// do nothing
}
}
return null;
}
代码示例来源:origin: org.ow2.petals/petals-microkernel-api
public static Component getComponentByName(final ContentController parentContentController,
final String name) {
// List content controller subcomponents
for (final Component component : parentContentController.getFcSubComponents()) {
try {
final String componentName = Fractal.getNameController(component).getFcName();
if (name.equals(componentName)) {
return component;
}
} catch (final NoSuchInterfaceException e) {
// do nothing
}
}
return null;
}
代码示例来源:origin: com.ebmwebsourcing.easycommons/easycommons-sca-impl
/**
* Change the name of the component
*
* @param name
* @throws SCAException
*/
public void changeName(final Component comp, final String name) throws SCAException {
try {
final NameController nc = Fractal.getNameController(comp);
nc.setFcName(name);
} catch (final NoSuchInterfaceException e) {
throw new SCAException(
"Impossible to change the name ot this fractal componet: "
+ comp, e);
}
}
代码示例来源:origin: org.ow2.frascati/frascati-assembly-factory
private void newFcInstance0() throws java.lang.Exception {
C45 = new juliac.generated.scaCompositeFCb62().newFcInstance();
org.objectweb.fractal.util.Fractal.getNameController(C45).setFcName("org.ow2.frascati.assembly.factory.EmptyComposite");
}
代码示例来源:origin: org.ow2.frascati/frascati-fscript-core
@Override
public final String toString()
{
Component owner = itf.getFcItfOwner();
String ownerName = "<unnamed>";
try {
ownerName = Fractal.getNameController(owner).getFcName();
} catch (NoSuchInterfaceException nsie) {
// Ignore.
}
return "#<scaservice: " + ownerName + "." + getName() + ">";
}
}
代码示例来源:origin: org.ow2.frascati/frascati-fscript-core
@Override
public final String toString()
{
Component owner = itf.getFcItfOwner();
String ownerName = "<unnamed>";
try {
ownerName = Fractal.getNameController(owner).getFcName();
} catch (NoSuchInterfaceException nsie) {
// Ignore.
}
return "#<scareference: " + ownerName + "." + getName() + ">";
}
}
代码示例来源: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.jasmine.jade/jade-fractal
/**
* @param c
* @param subcmp
* @return
* @deprecated
*/
private static Component search(Component c, String subcmp) {
try {
ContentController cc = Fractal.getContentController(c);
Component[] sub = cc.getFcSubComponents();
for (int i = 0; i < sub.length; i++) {
try {
if (Fractal.getNameController(sub[i]).getFcName().equals(
subcmp))
return sub[i];
} catch (NoSuchInterfaceException e1) {
// no name ctrler ignore it
}
}
} catch (Exception e) {
return null;
}
return null;
}
代码示例来源:origin: org.objectweb.fractal.cecilia.toolchain/task-component
private String getFullItfName(final TaskInterface itf) {
try {
return Fractal.getNameController(itf.getFcItfOwner()).getFcName() + '.'
+ itf.getFcItfName();
} catch (final NoSuchInterfaceException e) {
return "anonymous." + itf.getFcItfName();
}
}
代码示例来源:origin: org.ow2.frascati/frascati-fscript-core
/**
* Get the list of intent nodes for a given business interface.
*
* @param ic - The intent controller of the interface owner (the component under introspection).
* @param itf - The interface to search intents on.
* @return The list of intents found for this interface (can be empty!).
* @throws NoSuchInterfaceException if an interface is not found.
*/
private List<ScaIntentNode> getIntentNodes(SCABasicIntentController ic, Interface itf)
throws NoSuchInterfaceException
{
List<ScaIntentNode> nodes = new ArrayList<ScaIntentNode>();
String itfName = itf.getFcItfName();
if ( !itfName.endsWith("-controller") && !itfName.equals("component")) { // no intents on controllers
List<IntentHandler> intents = ic.listFcIntentHandler( itf.getFcItfName() );
for (IntentHandler intent : intents) {
Component impl = ((Interface) intent).getFcItfOwner();
String name = Fractal.getNameController(impl).getFcName();
nodes.add( new ScaIntentNode((FraSCAtiModel) this.model, ic, name, impl, itf) );
}
}
return nodes;
}
代码示例来源:origin: org.ow2.jasmine.jade/jade-fractal
/**
* @param comp
* @param name
* @return
* @deprecated
*/
private static Component subcomp(Component comp, String name) {
try {
ContentController cc = Fractal.getContentController(comp);
for (Component sc : cc.getFcSubComponents()) {
NameController nc = Fractal.getNameController(sc);
if (name.equals(nc.getFcName())) {
return sc;
}
}
} catch (NoSuchInterfaceException e) {
e.printStackTrace();
return null;
}
return null;
}
代码示例来源:origin: org.objectweb.fractal.cecilia.toolchain/task-component
String getFullInterfaceName(final Interface itf) {
try {
final String ownerName = Fractal.getNameController(itf.getFcItfOwner())
.getFcName();
return ownerName + '.' + itf.getFcItfName();
} catch (final NoSuchInterfaceException e) {
return "anonymous." + itf.getFcItfName();
}
}
内容来源于网络,如有侵权,请联系作者删除!