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


Java ComponentInstance.VALID属性代码示例

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


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

示例1: instanceDescriptionState

static String instanceDescriptionState(int state) {

        switch (state) {
            case ComponentInstance.VALID:
                return Ansi.ansi().fg(Ansi.Color.GREEN).a("VALID").reset().toString();
            case ComponentInstance.INVALID:
                return Ansi.ansi().fg(Ansi.Color.RED).a("INVALID").reset().toString();
            case ComponentInstance.STOPPED:
                return Ansi.ansi().fg(Ansi.Color.YELLOW).a("STOPPED").reset().toString();
            case ComponentInstance.DISPOSED:
                return Ansi.ansi().fg(Ansi.Color.BLUE).a("DISPOSED").reset().toString();
        }
        // Should not happen (no other known component instances states)
        return Ansi.ansi().fg(Ansi.Color.RED).a("UNKNOWN").toString();


    }
 
开发者ID:andyphillips404,项目名称:awplab-core,代码行数:17,代码来源:IPojoManagerService.java

示例2: stateAsString

private static String stateAsString(int state) {
    switch (state) {
        case ComponentInstance.VALID:
            return "valid";
        case ComponentInstance.INVALID:
            return "invalid";
        case ComponentInstance.STOPPED:
            return "stopped";
        case ComponentInstance.DISPOSED:
            return "disposed";
        case -2:
            return "changing";
        default:
            return "unknown";
    }
}
 
开发者ID:ow2-chameleon,项目名称:everest,代码行数:16,代码来源:InstanceResource.java

示例3: getInstanceDescription

@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,代码行数:15,代码来源:IPojoManagerProvider.java

示例4: getStateName

private String getStateName(int state) {
    switch (state) {
        case ComponentInstance.VALID:
            return "VALID";
        case ComponentInstance.INVALID:
            return "INVALID";
        case ComponentInstance.STOPPED:
            return "STOPPED";
        case ComponentInstance.DISPOSED:
            return "DISPOSED";
    }
    // Should not happen (no other known component instances states)
    return "";
}
 
开发者ID:andyphillips404,项目名称:awplab-core,代码行数:14,代码来源:InstanceCommand.java

示例5: stringAsState

private static Integer stringAsState(String state) {
    if ("valid".equalsIgnoreCase(state)) {
        return ComponentInstance.VALID;
    } else if ("invalid".equalsIgnoreCase(state)) {
        return ComponentInstance.INVALID;
    } else if ("stopped".equalsIgnoreCase(state)) {
        return ComponentInstance.STOPPED;
    } else if ("disposed".equalsIgnoreCase(state)) {
        return ComponentInstance.DISPOSED;
    }
    // Unknown state
    return null;
}
 
开发者ID:ow2-chameleon,项目名称:everest,代码行数:13,代码来源:InstanceResource.java

示例6: getState

/**
 * @return the instance's state.
 */
public String getState() {
    switch (architecture.getInstanceDescription().getState()) {
        case ComponentInstance.DISPOSED:
            return "DISPOSED";
        case ComponentInstance.INVALID:
            return "INVALID";
        case ComponentInstance.VALID:
            return "VALID";
        case ComponentInstance.STOPPED:
            return "STOPPED";
        default:
            return "UNKNOWN";
    }
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:17,代码来源:InstanceModel.java

示例7: formatInstanceState

private static String formatInstanceState(int state) {
    switch (state) {
        case ComponentInstance.VALID:
            return "VALID";
        case ComponentInstance.INVALID:
            return "INVALID";
        case ComponentInstance.DISPOSED:
            return "DISPOSED";
        case ComponentInstance.STOPPED:
            return "STOPPED";
        default:
            return "UNKNOWN";
    }
}
 
开发者ID:ow2-chameleon,项目名称:osgi-testing-helpers,代码行数:14,代码来源:ArchitectureDumpHelper.java

示例8: getStateColor

private Ansi.Color getStateColor(int state) {
    switch (state) {
        case ComponentInstance.VALID:
            return Ansi.Color.GREEN;
        case ComponentInstance.INVALID:
            return Ansi.Color.RED;
        case ComponentInstance.STOPPED:
            return Ansi.Color.YELLOW;
        case ComponentInstance.DISPOSED:
            return Ansi.Color.BLUE;
    }
    // Should not happen (no other known component instances states)
    return Ansi.Color.DEFAULT;
}
 
开发者ID:andyphillips404,项目名称:awplab-core,代码行数:14,代码来源:InstanceCommand.java

示例9: isInstanceValid

public boolean isInstanceValid(ComponentInstance ci) {
    return ci != null && ci.getState() == ComponentInstance.VALID;
}
 
开发者ID:ow2-chameleon,项目名称:osgi-testing-helpers,代码行数:3,代码来源:InstanceHelper.java


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