/** Initialization. */
  @PostConstruct
  public void init() throws ConfigException {
    if (getClassType() != null) {
      super.init();
    }

    Environment.addEnvironmentListener(new StartListener());
  }
Пример #2
0
  /** Check for correct type. */
  @Override
  public void setClass(Class<?> cl) {
    super.setClass(cl);

    if (!getBeanConfigClass().isAssignableFrom(cl))
      throw new ConfigException(
          L.l(
              "instance class '{0}' must implement '{1}'",
              cl.getName(), getBeanConfigClass().getName()));
  }
Пример #3
0
  /** Override init to handle value */
  @Override
  @PostConstruct
  public void init() {
    if (_valueName != null) {
      InjectManager webBeans = InjectManager.create();

      Set<Bean<?>> beans = webBeans.getBeans(_valueName);

      if (beans.size() > 0) {
        _bean = beans.iterator().next();
      }

      if (_bean == null) {
        _value = Jndi.lookup(_valueName);
      }

      if (_bean == null && _value == null)
        throw new ConfigException(L.l("'{0}' is an unknown bean", _valueName));
    } else if (getClassType() != null) super.init();
    else {
      // ioc/2130
    }
  }
Пример #4
0
 @Override
 public void deploy() {
   if (_isDeploy) super.deploy();
 }
Пример #5
0
  /** If the name is set, the bean will get deployed */
  @Override
  public void setJndiName(String name) {
    super.setJndiName(name);

    setDeploy(true);
  }