当前位置: 首页>>代码示例>>Java>>正文


Java Architecture.getInstanceDescription方法代码示例

本文整理汇总了Java中org.apache.felix.ipojo.architecture.Architecture.getInstanceDescription方法的典型用法代码示例。如果您正苦于以下问题:Java Architecture.getInstanceDescription方法的具体用法?Java Architecture.getInstanceDescription怎么用?Java Architecture.getInstanceDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.felix.ipojo.architecture.Architecture的用法示例。


在下文中一共展示了Architecture.getInstanceDescription方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.apache.felix.ipojo.architecture.Architecture; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {

    ShellTable table = new ShellTable();
    table.column("Name");
    table.column("Bundle Id");
    table.column("State");

    for (Architecture architecture : managerService.getArchitectures()) {
        InstanceDescription instanceDescription = architecture.getInstanceDescription();
        if (verbose || instanceDescription.getState() != ComponentInstance.DISPOSED) {
            table.addRow().addContent(instanceDescription.getName(), instanceDescription.getBundleId(), IPojoManagerService.instanceDescriptionState(instanceDescription.getState()));
        }
    }

    table.print(System.out);

    return null;
}
 
开发者ID:andyphillips404,项目名称:awplab-core,代码行数:20,代码来源:InstancesCommand.java

示例2: getInvalidControllers

import org.apache.felix.ipojo.architecture.Architecture; //导入方法依赖的package包/类
private List<InstanceDescription> getInvalidControllers() {
    List<InstanceDescription> invalid = new ArrayList<>();
    for (Architecture architecture : architectures) {
        final InstanceDescription description = architecture.getInstanceDescription();
        // Is it invalid ?
        if (description.getState() == ComponentInstance.INVALID) {
            // Is it a controller
            ProvidedServiceHandlerDescription hd = (ProvidedServiceHandlerDescription)
                    description.getHandlerDescription("org.apache.felix.ipojo:provides");
            if (hd != null) {
                for (ProvidedServiceDescription psd : hd.getProvidedServices()) {
                    if (Arrays.asList(psd.getServiceSpecifications()).contains(org.wisdom.api.Controller.class
                            .getName())) {
                        invalid.add(description);
                    }
                }
            }
        }
    }
    return invalid;
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:22,代码来源:ControllerExtension.java

示例3: dumpArchitecture

import org.apache.felix.ipojo.architecture.Architecture; //导入方法依赖的package包/类
public static void dumpArchitecture(BundleContext context) {
    OSGiHelper helper = new OSGiHelper(context);
    StringBuilder builder = new StringBuilder();
    try {
        for (Architecture arch : helper.getServiceObjects(Architecture.class)) {
            InstanceDescription description = arch.getInstanceDescription();
            builder.append("Instance : ").append(description.getName()).append(" - ").append(formatInstanceState
                    (description.getState())).append("\n");
            builder.append(description.getDescription().toString());
            builder.append("\n---------------------------------------\n");
        }
    } finally {
        helper.dispose();
    }
    System.out.println(builder.toString());
}
 
开发者ID:ow2-chameleon,项目名称:osgi-testing-helpers,代码行数:17,代码来源:ArchitectureDumpHelper.java

示例4: getInstanceDescription

import org.apache.felix.ipojo.architecture.Architecture; //导入方法依赖的package包/类
@Override
public InstanceDescription getInstanceDescription(Object instance) {
    for (Architecture architecture : architectures) {
        if (architecture.getInstanceDescription().getState() == ComponentInstance.VALID) {
            if (architecture.getInstanceDescription().getInstance() instanceof InstanceManager) {
                InstanceManager instanceManager = (InstanceManager) architecture.getInstanceDescription().getInstance();
                if (Arrays.asList(instanceManager.getPojoObjects()).contains(instance)) {
                    return architecture.getInstanceDescription();
                }
            }
        }
    }

    return null;
}
 
开发者ID:andyphillips404,项目名称:awplab-core,代码行数:16,代码来源:IPojoManagerProvider.java

示例5: execute

import org.apache.felix.ipojo.architecture.Architecture; //导入方法依赖的package包/类
@Override
public Object execute() throws Exception {

    AnsiPrintToolkit toolkit = new AnsiPrintToolkit();
    boolean found = false;
    for (Architecture arch : managerService.getArchitectures()) {
        InstanceDescription instance = arch.getInstanceDescription();
        if (name.equals(instance.getName())) {
            printInstanceDetails(toolkit, instance);
            found = true;
        }
    }

    PrintStream stream = System.out;
    if (!found) {
        // Use error stream
        stream = System.err;
        Ansi buffer = toolkit.getBuffer();

        // Creates an error message
        buffer.a(" [");
        toolkit.red("ERROR");
        buffer.a("] ");

        buffer.a("Instance '");
        toolkit.italic(name);
        buffer.a("' was not found.\n");
    }

    // Flush buffer's content
    stream.println(toolkit.getBuffer().toString());

    return null;
}
 
开发者ID:andyphillips404,项目名称:awplab-core,代码行数:35,代码来源:InstanceCommand.java


注:本文中的org.apache.felix.ipojo.architecture.Architecture.getInstanceDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。