Package intf.ccacore

Examples of intf.ccacore.XCATConnectionID


                 providingPortName,
                 usingPortName,
                 providesPortHandle);

    // return the connectionID for this connection
    XCATConnectionID connectionID = new XCATConnectionIDImpl(provider,
                   user,
                   providingPortName,
                   usingPortName,
                   providesPortHandle);
    return connectionID;
View Full Code Here


    throw new PortNotDefinedException("Uses port: " + usingPortName +
              " has been unregistered");
  if (uInfo.getConnectionID() != null)
    throw new NonstandardException("Uses Port : " + usingPortName +
           " is already connected");
  XCATConnectionID connectionID =
    new XCATConnectionIDImpl(provider,
           user,
           providingPortName,
           usingPortName,
           providesPortHandle);
View Full Code Here

    MobileComponentID providerID =
      new MobileComponentIDClientImpl(providesComponentName,
              providesComponentHandle);
   
    // create a ConnectionID for this connection
    XCATConnectionID connID =
      new XCATConnectionIDImpl(providerID,
             userID,
             providesPortName,
             usesPortName,
             providesComponentHandle);
View Full Code Here

    // create an entry into the migrationMap
    MigrationInfo mInfo = new MigrationInfo(numConns);
    migrationMap.put(componentName, mInfo);
   
    for (int i = 0; i < numConns; i++) {
      XCATConnectionID connID = (XCATConnectionID) connIDs.get(i);
      MobileComponentID userID = (MobileComponentID) connID.getUser();
     
      userID.requestMigration(componentName,
            connID.getUserPortName(),
            getGSH());
    }
   
    // Wait till all users are OK with migration
    synchronized(mInfo) {
      if (mInfo.getApprovedUsers() < numConns) {
  try {
    mInfo.wait();
  } catch (InterruptedException ie) {
    logger.severe("Exception when waiting for uses sides to approve migration",
      ie);
    throw new NonstandardException("Exception when waiting for migration approval",
           ie);
  }
      }
    }

    // check if the above call was successful
    if (mInfo.getMigrationStatus() == AppCoordinatorCallback.EXCEPTION)
      throw new NonstandardException("Remote side did not approve migration");

    // Confirm to all users that provider is migrating
    for (int i = 0; i < numConns; i++) {
      XCATConnectionID connID = (XCATConnectionID) connIDs.get(i);
      MobileComponentID userID = (MobileComponentID) connID.getUser();
      userID.confirmMigration(connID.getUserPortName());
    }
   
    // Freeze the execution of the component
    MobileComponentID cid =
      new MobileComponentIDClientImpl(cInfo.getInstanceName(),
              cInfo.getInstanceHandle());
    cid.freezeComponent(getGSH());
   
    // Wait till the component sends back a notification that it is frozen
    synchronized(mInfo) {
      if (!mInfo.getIsFrozen()) {
  try {
    mInfo.wait();
  } catch (InterruptedException ie) {
    logger.severe("Exception when waiting for migration to complete",
      ie);
    throw new NonstandardException("Exception when waiting for migration to complete",
           ie);
  }
      }
    }
   
    // decrement number of outstanding frozen components
    synchronized(this) {
      outstandingFrozenComps--;
    }

    // check if the above call was successful
    if (mInfo.getMigrationStatus() == AppCoordinatorCallback.EXCEPTION)
      throw new NonstandardException("Remote component threw exception while being frozen");

    // Store the individual component state into persistent storage
    MasterStorageService mss = (MasterStorageService)
      URLToReference.createReference(masterStorageServiceURL,
             MasterStorageService.class.getName());
    String individualStorageServiceURL = mss.getIndividualStorageServiceLocation();
    String storageID = cid.storeIndividualComponentState(individualStorageServiceURL);

    // destroy the remote component
    try {
      cid.destroy();
    } catch (Exception e) {
      logger.severe("Caught exception while trying to destroy component",
        e);
      throw new NonstandardException("Caught exception while trying to destroy component",
             e);
    }

    // create a new instance of the component at the specified location
    cInfo.setInstanceLocation(targetLocation);
    createComponentInstance(cInfo);

    // retrieve the state for the migrated component
    cid.loadComponentState(individualStorageServiceURL, storageID);

    // delete state from storage service
    IndividualStorageService iss = (IndividualStorageService)
      URLToReference.createReference(individualStorageServiceURL,
             IndividualStorageService.class.getName());
    iss.deleteState(storageID);

    // resume execution of the migrated component
    cid.resumeExecution();

    // set the isFrozen false to false
    mInfo.setIsFrozen(false);

    // send a notification that all connected components that migration is complete
    for (int i = 0; i < numConns; i++) {
      XCATConnectionID connID = (XCATConnectionID) connIDs.get(i);
      MobileComponentID userID = (MobileComponentID) connID.getUser();
      userID.migrationComplete(connID.getUserPortName());     
    }

    // get rid of the entry inside migrationMap
    migrationMap.remove(componentName);
  }
View Full Code Here

  sInfoBuffer.append("</propertiesEntry>");
      }
      sInfoBuffer.append("</properties>");
     
      // copy over information from the ConnectionID
      XCATConnectionID connID = uInfo.getConnectionID();
      if (connID != null) {
  sInfoBuffer.append("<connectionID>");
  sInfoBuffer.append("<providerIntfName>" +
         connID.getProviderIntfName() +
         "</providerIntfName>");
  sInfoBuffer.append("<userIntfName>" +
         connID.getUserIntfName() +
         "</userIntfName>");
 
  // fill in the state of the connection
  sInfoBuffer.append("<connectionIDInfo>");
  XCATConnectionInfo xconnInfo = connID.getConnectionInfo();
  sInfoBuffer.append("<providerIDHandle>" +
         xconnInfo.getProviderIDHandle() +
         "</providerIDHandle>");
  sInfoBuffer.append("<userIDHandle>" +
         xconnInfo.getUserIDHandle() +
View Full Code Here

        // initialize values
        String portName = null;
        String portType = null;
        TypeMap tMap = createTypeMap();
        boolean inUse = false;
        XCATConnectionID connID = null;
        boolean unregistered = false;
        int migrationStatus = 0;

        if (entryChild.getLocalName().equals("portName")) {
    // get the portName
View Full Code Here

  MobileComponentIDClientImpl provider =
    new MobileComponentIDClientImpl(providerName, providerIDHandle);
  MobileComponentIDClientImpl user =
    new MobileComponentIDClientImpl(userName, userIDHandle);
  XCATConnectionID connID =
    new XCATConnectionIDImpl(provider,
           user,
           providerPortName,
           userPortName,
           providesPortHandle);
View Full Code Here

TOP

Related Classes of intf.ccacore.XCATConnectionID

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.