org.apache.felix.ipojo.Factory.getState()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.apache.felix.ipojo.Factory.getState()方法的一些代码示例,展示了Factory.getState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Factory.getState()方法的具体详情如下:
包路径:org.apache.felix.ipojo.Factory
类名称:Factory
方法名:getState

Factory.getState介绍

[英]Returns the state of the factory.
[中]返回工厂的状态。

代码示例

代码示例来源:origin: org.wisdom-framework/wisdom-monitor

/**
 * @return the string representation of the factory state.
 */
public String getState() {
  if (factory.getState() == Factory.INVALID) {
    return "INVALID";
  } else {
    return "VALID";
  }
}

代码示例来源:origin: apache/felix

public int getState() {
  return m_delegate.getState();
}

代码示例来源:origin: apache/felix

/**
 * Gets the number of valid factories.
 * @param factories the factory list
 * @return the number of valid factories.
 */
public static int getValidFactoriesCount(List<Factory> factories) {
  int i = 0;
  for (Factory a : factories) { // Cannot be null, an empty list is returned.
    if (a.getState() == Factory.VALID) {
      i ++;
    }
  }
  return i;
}

代码示例来源:origin: apache/felix

/**
 * Gets the number of invalid factories.
 * @param factories the factory list
 * @return the number of invalid factories.
 */
public static int getInvalidFactoriesCount(List<Factory> factories) {
  int i = 0;
  for (Factory a : factories) { // Cannot be null, an empty list is returned.
    if (a.getState() == Factory.INVALID) {
      i ++;
    }
  }
  return i;
}

代码示例来源:origin: apache/felix

/**
 * Gets the number of valid handlers.
 * @param handlers the handler factory list
 * @return the number of valid handlers.
 */
public static int getValidHandlersCount(List<HandlerFactory> handlers) {
  int i = 0;
  for (Factory a : handlers) { // Cannot be null, an empty list is returned.
    if (a.getState() == Factory.VALID) {
      i ++;
    }
  }
  return i;
}

代码示例来源:origin: apache/felix

/**
 * Gets the number of invalid handlers.
 * @param handlers the handler factory list
 * @return the number of invalid handlers.
 */
public static int getInvalidHandlersCount(List<HandlerFactory> handlers) {
  int i = 0;
  for (Factory a : handlers) { // Cannot be null, an empty list is returned.
    if (a.getState() == Factory.INVALID) {
      i ++;
    }
  }
  return i;
}

代码示例来源:origin: org.apache.felix/org.apache.felix.ipojo.composite

public int getState() {
  return m_delegate.getState();
}

代码示例来源:origin: org.apache.felix/org.apache.felix.ipojo.api

/**
 * Checks if the factory is already created.
 */
private void ensureFactory() {
  if (getFactory() == null) {
    throw new IllegalStateException("The factory associated with the component type is not created");
  } else {
    if (getFactory().getState() == Factory.INVALID) {
      throw new IllegalStateException("The factory associated with the component type is invalid (not started or missing handlers)");
    }
  }
}

代码示例来源:origin: apache/felix

String name = factory.getName();
String state = StateUtils.getFactoryState(factory.getState());
String bundle = factory.getBundleContext().getBundle().getSymbolicName()
  + " (" + factory.getBundleContext().getBundle().getBundleId() + ")";

代码示例来源:origin: apache/felix

pw.value(factory.getName());
pw.key("state");
pw.value(StateUtils.getFactoryState(factory.getState()));

相关文章