Package java.rmi.activation

Examples of java.rmi.activation.ActivationSystem


  /* Get the activation system */
  ProxyPreparer actSysPreparer = (ProxyPreparer) config.getEntry(
      "com.sun.jini.example.hello.Server", "activationSystemPreparer",
      ProxyPreparer.class, new BasicProxyPreparer());
  ActivationSystem actSys =
      (ActivationSystem) actSysPreparer.prepareProxy(
    ActivationGroup.getSystem());

  /* Create the activation group */
  ActivationGroupID gid = actSys.registerGroup(groupDesc);

  /* Create the activation descriptor */
  ActivationDesc actDesc =
      new ActivationDesc(
    gid, ActivatableServer.class.getName(),
    null /* location */, data, true /* restart */);

  /* Register the activation descriptor */
  ProxyPreparer actIdPreparer = (ProxyPreparer) config.getEntry(
      "com.sun.jini.example.hello.Server", "activationIdPreparer",
      ProxyPreparer.class, new BasicProxyPreparer());
  ActivationID aid = (ActivationID) actIdPreparer.prepareProxy(
      actSys.registerObject(actDesc));

  /* Activate the server */
  aid.activate(true);

  System.out.println("Activated server");
View Full Code Here


//TODO - expand and/or canonicalize classpath components

//TODO - check for shared log existence prior to group creation
   
  ActivationSystem sys =
      ServiceStarter.getActivationSystem(
          getActivationSystemHost(),
    getActivationSystemPort(),
    config);
   
  CommandEnvironment cmdToExecute
      = new CommandEnvironment(getServerCommand(),
                               getServerOptions());
  ActivationGroupID gid = null;
        try {
      gid = sys.registerGroup(
                new ActivationGroupDesc(getServerProperties(),
                            cmdToExecute));
       storeGroupID(getLog(), gid);
  } catch (Exception e) {
            try {
                if (gid != null) sys.unregisterGroup(gid);
            } catch (Exception ee) {
                // ignore - did the best we could
            }
            if (e instanceof IOException)
          throw (IOException)e;
View Full Code Here

    {
        logger.entering(DestroySharedGroup.class.getName(), "destroy",
      new Object[] {Arrays.asList(srvArray), config} );
  Created created = null;
        SharedActivatableServiceDescriptor desc = null;
  ActivationSystem activationSystem = null;
     
        for (int i=0; i < srvArray.length; i++) {
      if (srvArray[i] instanceof SharedActivatableServiceDescriptor) {
                desc = (SharedActivatableServiceDescriptor)srvArray[i];
    activationSystem =
        ServiceStarter.getActivationSystem(
            desc.getActivationSystemHost(),
      desc.getActivationSystemPort(),
      config);
    try {
                    created = (Created)desc.create(config);
              if (created != null &&
            created.proxy instanceof SharedGroup) {
      // service proxy from create() is already prepared
            SharedGroup sg = (SharedGroup)created.proxy;
      try {
          sg.destroyVM();
                try {
                    File log = new File(desc.getSharedGroupLog());
                                FileSystem.destroy(log, true);
                } catch (Exception e) {
                                logger.log(Level.WARNING,
            "destroy.group.deletion", e);
                }
            } catch (Exception e ) {
                            logger.log(Level.SEVERE,
              "destroy.group.exception", e);
//TODO - Add configurable retry logic or just unregister       
            }
        } else {
                        logger.log(Level.WARNING, "destroy.unexpected.proxy",
         (created==null)?null:created.proxy);
      if (created != null && created.aid != null) {
          try {
              activationSystem.unregisterObject(created.aid);
          } catch (Exception e) {
                                logger.log(Level.WARNING,
            "destroy.unregister.exception", e) ;
          }
      }
        }
          } catch (Exception ee) {
                    logger.log(Level.SEVERE, "destroy.creation.exception", ee);
        if (created != null && created.aid != null) {
      try {
          activationSystem.unregisterObject(created.aid);
      } catch (Exception e) {
                            logger.log(Level.WARNING,
        "destroy.unregister.exception", ee) ;
      }
        }
View Full Code Here

        if (config == null) {
           throw new NullPointerException(
               "Configuration argument cannot be null");
        }

        ActivationSystem sys = null;
  final String h = (host == null) ? "" : host;
  final int p = (port <= 0) ? getActivationSystemPort() : port;
  try {
      sys = (ActivationSystem)
    Naming.lookup("//" + h + ":" + p +
View Full Code Here

     * longer be valid and future attempts to contact the activation system will
     * fail (in this VM).
     */
    private void cleanupRunningActivationSystem() {
  int port;
  ActivationSystem currSystem = null;
  String actURL = null;
  try {
      port = Integer.getInteger("java.rmi.activation.port",
              ActivationSystem.SYSTEM_PORT).intValue();
      actURL = "//:" + port + "/java.rmi.activation.ActivationSystem";
      currSystem = (ActivationSystem) Naming.lookup(actURL);
      currSystem.shutdown();
  } catch (SecurityException e) {
      throw e; // configuration problem
  } catch (Exception e) {
      return; // assume not be running
  }
View Full Code Here

    /**
     * works same as getSystem() method of superclass, but send debug message
     * in log
     */
    public ActivationSystem getSystem() {
        ActivationSystem system = super.getSystem();
        logger.log(Level.FINEST, "system=" + system.toString());
  return system;
    }
View Full Code Here

TOP

Related Classes of java.rmi.activation.ActivationSystem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.