/**
   * Get the id of current activation group.
   *
   * @return the id of the current activation group or null if none exists.
   */
  public static ActivationGroupID currentGroupID() {
    try {
      if (currentGroupId == null) {
        // This will also assing the currentGroupId to the current
        // (default) group of the default system.
        setSystem(DefaultActivationSystem.get());
      }
    } catch (ActivationException e) {
      InternalError ierr = new InternalError("Unable to activate AS");
      ierr.initCause(e);
      throw ierr;
    }

    return currentGroupId;
  }
 /**
  * Get the current activation system. If the system is not set via {@link #setSystem} method, the
  * default system for this virtual machine is returned. The default system is first searched by
  * name "java.rmi.activation.ActivationSystem" on the activation registry port. The default value
  * of the activation registry port is {@link ActivationSystem#SYSTEM_PORT}, but it can be changed
  * by putting the system property java.rmi.activation.port. Both activation system and activation
  * registry are provided by the RMI daemon tool, RMID, if it is running on the local host. If the
  * RMID is not running, the internal transient activation system will be created and returned.
  * This internal system is highly limited in in capabilities and is not intended to be used
  * anywhere apart automated testing.
  *
  * @return the activation system for this virtual machine
  * @throws ActivationException
  */
 public static ActivationSystem getSystem() throws ActivationException {
   if (system == null) system = DefaultActivationSystem.get();
   return system;
 }