Beispiel #1
0
  private static void _invalidate(long companyId) {
    for (SPI spi : MPIHelperUtil.getSPIs()) {
      try {
        RegistrationReference registrationReference = spi.getRegistrationReference();

        IntrabandRPCUtil.execute(registrationReference, new InvalidateProcessCallable(companyId));
      } catch (Exception e) {
        _log.error("Unable to invalidate SPI " + spi + " for company " + companyId, e);
      }
    }
  }
  public static <K extends Serializable, V extends Serializable>
      PortalCacheManager<K, V> createSPIPortalCacheManager(
          PortalCacheManager<K, V> portalCacheManager) throws RemoteException {

    if (!SPIUtil.isSPI()) {
      return portalCacheManager;
    }

    SPI spi = SPIUtil.getSPI();

    return new IntrabandPortalCacheManager<K, V>(spi.getRegistrationReference());
  }
  private RegistrationReference _getRegistrationReference(String portletId) {
    SPI spi = SPIRegistryUtil.getPortletSPI(portletId);

    if (spi == null) {
      return null;
    }

    try {
      return spi.getRegistrationReference();
    } catch (RemoteException re) {
      throw new RuntimeException(re);
    }
  }