本文整理了Java中org.objectweb.fractal.util.Fractal.getLifeCycleController()
方法的一些代码示例,展示了Fractal.getLifeCycleController()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fractal.getLifeCycleController()
方法的具体详情如下:
包路径:org.objectweb.fractal.util.Fractal
类名称:Fractal
方法名:getLifeCycleController
[英]Returns the LifeCycleController interface of the given component.
[中]返回给定组件的LifeCycleController接口。
代码示例来源:origin: org.objectweb.fractal.cecilia.toolchain/plugin-framework
private void startPlugin(final Component plugin)
throws NoSuchInterfaceException, IllegalLifeCycleException {
final LifeCycleController lc = Fractal.getLifeCycleController(plugin);
lc.startFc();
}
代码示例来源:origin: org.ow2.frascati.tinfi/frascati-tinfi-runtime
/**
* Stop the specified component. Defined to mimic SCADomain.close().
*/
public static void close( Component c )
throws IllegalLifeCycleException, NoSuchInterfaceException {
Fractal.getLifeCycleController(c).stopFc();
}
}
代码示例来源:origin: org.ow2.petals/petals-microkernel-api
public static LifeCycleController getLifeCycleController(final Component component) {
try {
return Fractal.getLifeCycleController(component);
} catch (NoSuchInterfaceException e) {
throw new UncheckedException("This can't happen", e);
}
}
代码示例来源:origin: com.ebmwebsourcing.easycommons/easycommons-sca-impl
public boolean isStarted(final Component comp) {
boolean res = false;
if (comp != null) {
try {
final LifeCycleController lifeCycleController = Fractal
.getLifeCycleController(comp);
if (lifeCycleController.getFcState() == LifeCycleController.STARTED) {
res = true;
}
} catch (final NoSuchInterfaceException e) {
// do nothing, return null
res = false;
}
}
return res;
}
代码示例来源:origin: org.objectweb.petals/petals-kernel
/**
* A utility function allowing to get a component LifeCycleController from a
* content controller.
*
* @param parentContentController
* the parent content controller
* @param name
* the name of the component
* @return the LifeCycleController of the component, null if not found
*/
protected LifeCycleController getLifeCycleControllerByName(
final ContentController parentContentController, final String name) {
LifeCycleController lifeCycleController = null;
Component comp = this.getComponentByName(parentContentController, name);
if (comp != null) {
try {
lifeCycleController = Fractal.getLifeCycleController(comp);
} catch (NoSuchInterfaceException e) {
// do nothing, return null
lifeCycleController = null;
}
}
return lifeCycleController;
}
代码示例来源:origin: org.ow2.petals/petals-kernel
/**
* A utility function allowing to get a component LifeCycleController from a
* content controller.
*
* @param parentContentController
* the parent content controller
* @param name
* the name of the component
* @return the LifeCycleController of the component, null if not found
*/
public static final LifeCycleController getLifeCycleControllerByName(
final ContentController parentContentController, final String name) {
LifeCycleController lifeCycleController = null;
Component comp = getRecursiveComponentByName(parentContentController, name);
if (comp != null) {
try {
lifeCycleController = Fractal.getLifeCycleController(comp);
} catch (NoSuchInterfaceException e) {
// do nothing, return null
lifeCycleController = null;
}
}
return lifeCycleController;
}
}
代码示例来源:origin: org.ow2.frascati.factory/frascati-af-runtime
/**
* Create a new FraScati Domain component
*/
public SCADomain() {
try {
Class<?> cl = Class.forName(DOMAIN_DEFINITION);
Object o = cl.newInstance();
scaDomain = ((Factory) o).newFcInstance();
Fractal.getLifeCycleController(scaDomain).startFc();
} catch (Exception e) {
throw new FactoryException("Failed while creating SCADomain instance",e);
}
}
代码示例来源:origin: org.ow2.frascati.tinfi/frascati-tinfi-runtime
/**
* Return an instance of the component described by the specified ADL.
*/
public static Component getComponent( String adl )
throws
ClassNotFoundException, InstantiationException, IllegalAccessException,
IllegalLifeCycleException, NoSuchInterfaceException,
java.lang.InstantiationException {
Class<?> cl = Class.forName(adl);
Object o = cl.newInstance();
if( !(o instanceof Factory) ) {
String msg =
"The specified descriptor is not a component factory: "+adl;
throw new IllegalArgumentException(msg);
}
Factory factory = (Factory) o;
Component c = factory.newFcInstance();
Fractal.getLifeCycleController(c).startFc();
return c;
}
代码示例来源:origin: org.ow2.petals/petals-kernel
/**
* A utility function to start the given fractal component.
*
* @param component
* the fractal component
*
* @return true if the component was found and stopped, false otherwise
* @throws NoSuchInterfaceException
* : impossible to stop the component
* @throws IllegalLifeCycleException
* : impossible to stop the component
*/
public static final boolean startComponent(final Component component)
throws NoSuchInterfaceException, IllegalLifeCycleException {
boolean result = false;
LifeCycleController lifeCycleController = Fractal.getLifeCycleController(component);
if (lifeCycleController != null
&& LifeCycleController.STOPPED.equals(lifeCycleController.getFcState())) {
lifeCycleController.startFc();
result = true;
}
return result;
}
代码示例来源:origin: org.ow2.petals/petals-kernel
/**
* A utility function to stop the given fractal component.
*
* @param component
* the fractal component to stop
*
* @return true if the component was found and stopped, false otherwise
* @throws NoSuchInterfaceException
* : impossible to stop the component
* @throws IllegalLifeCycleException
* : impossible to stop the component
*/
public static final boolean stopComponent(final Component component)
throws NoSuchInterfaceException, IllegalLifeCycleException {
boolean result = false;
LifeCycleController lifeCycleController = Fractal.getLifeCycleController(component);
if (LifeCycleController.STARTED.equals(lifeCycleController.getFcState())) {
lifeCycleController.stopFc();
result = true;
}
return result;
}
代码示例来源:origin: org.objectweb.petals/petals-kernel
/**
* A utility function to stop the given fractal component.
*
* @param component
* the fractal component to stop
*
* @return true if the component was found and stopped, false otherwise
* @throws NoSuchInterfaceException :
* impossible to stop the component
* @throws IllegalLifeCycleException :
* impossible to stop the component
*/
public boolean stopComponent(final Component component)
throws NoSuchInterfaceException, IllegalLifeCycleException {
boolean result = false;
LifeCycleController lifeCycleController = Fractal
.getLifeCycleController(component);
if (lifeCycleController.getFcState()
.equals(LifeCycleController.STARTED)) {
lifeCycleController.stopFc();
result = true;
}
return result;
}
代码示例来源:origin: com.ebmwebsourcing.easycommons/easycommons-sca-impl
/**
* A utility function allowing to get a component LifeCycleController from a
* content controller.
*
* @param parentContentController
* the parent content controller
* @param name
* the name of the component
* @return the LifeCycleController of the component, null if not found
* @throws SCAException
*/
public LifeCycleController getLifeCycleControllerByName(
final Component parent, final String name) throws SCAException {
LifeCycleController lifeCycleController = null;
final List<Component> comps = this.getComponentsByName(parent, name);
if ((comps != null) && (comps.size() > 1)) {
throw new SCAException("Several component with the same name");
}
Component comp = null;
comp = comps.get(0);
if (comp != null) {
try {
lifeCycleController = Fractal.getLifeCycleController(comp);
} catch (final NoSuchInterfaceException e) {
// do nothing, return null
lifeCycleController = null;
}
}
return lifeCycleController;
}
代码示例来源:origin: org.objectweb.petals/petals-kernel
/**
* A utility function to start the given fractal component.
*
* @param component
* the fractal component
*
* @return true if the component was found and stopped, false otherwise
* @throws NoSuchInterfaceException :
* impossible to stop the component
* @throws IllegalLifeCycleException :
* impossible to stop the component
*/
public boolean startComponent(final Component component)
throws NoSuchInterfaceException, IllegalLifeCycleException {
boolean result = false;
LifeCycleController lifeCycleController = Fractal
.getLifeCycleController(component);
if (lifeCycleController != null) {
if (lifeCycleController.getFcState().equals(
LifeCycleController.STOPPED)) {
lifeCycleController.startFc();
result = true;
}
}
return result;
}
代码示例来源:origin: org.ow2.frascati.factory/frascati-af-runtime
private void initItfsExcept()
throws
InstantiationException, IllegalLifeCycleException,
NoSuchInterfaceException, ClassNotFoundException,
IllegalAccessException, java.lang.InstantiationException {
Component fd = TinfiDomain.getComponent("org.ow2.frascati.factory.FrascatiDomain");
Fractal.getLifeCycleController(fd).startFc();
domain = (Domain) fd.getFcInterface(SCADomain.DOMAIN_ITF);
config = (DomainConfig) fd.getFcInterface(SCADomain.DOMAIN_CONF_ITF);
}
}
代码示例来源:origin: org.ow2.fractal.bf/fractal-bf-core
Fractal.getLifeCycleController(bf).startFc();
代码示例来源:origin: com.ebmwebsourcing.easycommons/easycommons-sca-impl
/**
* A utility function to stop the given fractal component.
*
* @param component
* the fractal component to stop
*
* @return true if the component was found and stopped, false otherwise
* @throws NoSuchInterfaceException :
* impossible to stop the component
* @throws IllegalLifeCycleException :
* impossible to stop the component
*/
public boolean stopComponent(final Component component)
throws SCAException {
boolean result = false;
try {
final LifeCycleController lifeCycleController = Fractal
.getLifeCycleController(component);
if (lifeCycleController.getFcState().equals(
LifeCycleController.STARTED)) {
lifeCycleController.stopFc();
result = true;
}
} catch (final NoSuchInterfaceException e) {
throw new SCAException("Impossible to stop the component", e);
} catch (final IllegalLifeCycleException e) {
throw new SCAException("Impossible to stop the component", e);
}
return result;
}
代码示例来源:origin: org.ow2.frascati/frascati-fscript-core
Fractal.getLifeCycleController(itfOwner).stopFc();
Fractal.getLifeCycleController(itfOwner).startFc();
} catch (NoSuchInterfaceException nsie) {
log.log(Level.SEVERE, "Cannot retrieve the interface name!", nsie);
代码示例来源:origin: org.ow2.fractal.bf/fractal-bf-core
/**
* Return the the default configuration of the BindingFactory.
*
* @return
* @throws BindingFactoryException
*/
public static synchronized BindingFactory getBindingFactory()
throws BindingFactoryException {
try {
if (SINGLETON == null) {
if (adlFactory == null) {
adlFactory = FactoryFactory
.getFactory(FactoryFactory.FRACTAL_BACKEND);
}
Component bf = (Component) adlFactory.newComponent(
"org.objectweb.fractal.bf.BindingFactoryComp",
new HashMap<String, String>());
Fractal.getLifeCycleController(bf).startFc();
SINGLETON = (BindingFactory) bf
.getFcInterface("binding-factory");
}
} catch (Exception e) {
throw new BindingFactoryException(
"Some error occurred while retrieving the BindingFactory",
e);
}
return SINGLETON;
}
代码示例来源:origin: com.ebmwebsourcing.easycommons/easycommons-sca-impl
public boolean startComponentAndSubComponents(final Component component)
throws SCAException {
boolean result = false;
if (component != null) {
try {
final LifeCycleController lifeCycleController = Fractal
.getLifeCycleController(component);
if (lifeCycleController != null) {
if (lifeCycleController.getFcState().equals(
LifeCycleController.STOPPED)) {
lifeCycleController.startFc();
result = true;
}
List<Component> children = SCAHelper.getSCAHelper().getComponents(component);
for(Component child : children){
startComponent(child);
}
}
} catch (final NoSuchInterfaceException e) {
throw new SCAException("Impossible to start the component",
e);
} catch (final IllegalLifeCycleException e) {
throw new SCAException("Impossible to start the component",
e);
}
}
return result;
}
代码示例来源:origin: org.ow2.petals/petals-kernel
LifeCycleController lifeCycleController = Fractal.getLifeCycleController(component);
if (LifeCycleController.STARTED.equals(lifeCycleController.getFcState())) {
lifeCycleController.stopFc();
内容来源于网络,如有侵权,请联系作者删除!