本文整理汇总了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();
}
示例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";
}
}
示例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;
}
示例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 "";
}
示例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;
}
示例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";
}
}
示例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";
}
}
示例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;
}
示例9: isInstanceValid
public boolean isInstanceValid(ComponentInstance ci) {
return ci != null && ci.getState() == ComponentInstance.VALID;
}