コード例 #1
0
  /** {@inheritDoc} */
  @Override
  public void init(
      EjbBundleDescriptor ejbBundleDescriptor, EjbcContext ejbcContext, String bundlePathName)
      throws GeneratorException {
    logger.info(
        i18NHelper.msg(
            "MSG_JDOCodeGeneratorInit", // NOI18N
            JDOCodeGeneratorHelper.getModuleName(ejbBundleDescriptor)));

    this.ejbBundleDescriptor = ejbBundleDescriptor;
    if (ejbBundleDescriptor.containsCMPEntity()) {
      // do the pre EJB 3.0 related stuff here.
      super.init(ejbBundleDescriptor, ejbcContext, bundlePathName);
    }

    if (ejbBundleDescriptor.containsPersistenceEntity()) {
      // now do the EJB 3.0 specific task
      pjl = new PersistenceJarLoader();
      pjl.load(ejbBundleDescriptor);
    }
  }
コード例 #2
0
  /** {@inheritDoc} */
  @Override
  public Collection cleanup() throws GeneratorException {
    logger.info(
        i18NHelper.msg(
            "MSG_JDOCodeGeneratorCleanup", // NOI18N
            JDOCodeGeneratorHelper.getModuleName(ejbBundleDescriptor)));

    Collection result = null;
    if (ejbBundleDescriptor.containsCMPEntity()) {
      // do the pre EJB 3.0 related stuff here.
      result = super.cleanup();
    }
    if (ejbBundleDescriptor.containsPersistenceEntity()) {
      // now do the EJB 3.0 specific task
      pjl.unload();
    }
    // we have nothing to return for 3.0 beans until we integrate
    // enhancer with deployment. So as per the contract,
    // we return an empty collection and not a null collection if
    // we have only 3.0 beans.
    return result == null ? Collections.emptyList() : result;
  }