Java RMI

ActivatableImplementation.java

package examples.activation; 

import java.rmi.*;
import java.rmi.activation.*;

public class ActivatableImplementation extends Activatable 
  implements examples.activation.MyRemoteInterface {

  // The constructor for activation and export; this constructor is
  // called by the method ActivationInstantiator.newInstance during
  // activation, to construct the object.
  //
  public ActivatableImplementation(ActivationID id, MarshalledObject data) 
    throws RemoteException {

    // Register the object with the activation system
    // then export it on an anonymous port
    //
    super(id, 0);
  }
  
  // Implement the method declared in MyRemoteInterface
  //
  public Object callMeRemotely() throws RemoteException {

    return "Success";
  }
}

José M. Vidal .

17 of 22