Package xcat.types

Examples of xcat.types.TypeMapImpl


      logger.severe("Exception thrown while parsing Component XML", e);
      throw new NonstandardException("Exception while parsing Component XML", e);
    }

    // create a new TypeMap and fill in the values
    TypeMap componentEnv = new TypeMapImpl();
    componentEnv.putString("execHost", cInfo.getInstanceLocation());
    componentEnv.putString("creationProto", cInfo.getCreationProto());

    // check if a valid installation exists for this host/proto
    boolean found = false;
    for (int k = 0; k < executionEnvList.length; k++) {
      ExecutionEnv executionEnv = executionEnvList[k];
      String[] hostName = executionEnv.getHostName();
      String[] creationMech = executionEnv.getCreationProto();

      // check if there is a match for the hostName
      int h;
      for (h = 0; h < hostName.length; h++) {
  if (hostName[h].equals(cInfo.getInstanceLocation())) {
    break;
  }
      }

      // if h equals hostName.length, then skip
      if (h == hostName.length)
  continue;
     
      // check if there is a match for creationProto
      int m;
      for (m = 0; m < creationMech.length; m++) {
  if (creationMech[m].equals(cInfo.getCreationProto())) {
    break;
  }
      }

      // if h equals creationMech.length, then skip
      if (m == creationMech.length)
  continue;
     
      // if we get here, this is a valid installation for this
      // creationProto/execHost pair
      NameValuePair[] nameValuePairList =
  executionEnv.getNameValuePair();
      for (int l = 0; l < nameValuePairList.length; l++) {
  NameValuePair nameValuePair = nameValuePairList[l];
  String nameOfVariable = nameValuePair.getName();
  String value = nameValuePair.getValue();
  componentEnv.putString(nameOfVariable, value);
      }
     
      // found an installation, break here
      found = true;
      break;
    }
   
    // if no valid installation found, throw an Exception
    if (!found) {
      String message = new String ("No valid installation for : " +
           cInfo.getInstanceLocation() + " , " +
           cInfo.getCreationProto());
      logger.severe(message);
      throw new NonstandardException(message);
    }

    // get the name of the class for the component
    String className = componentEnv.getString("className",
               "None");
    if (className.equals("None"))
      throw new NonstandardException("Property className for component not defined");
   
    // notify that this is a migration
    componentEnv.putString("componentHandle", cInfo.getInstanceHandle());
    componentEnv.putBool("isMigrated", true);

    // invoke the Builder Service to create a new instance
    XCATBuilderService builderService = null;
    try {
      builderService = new XCATBuilderServiceImpl(false);
View Full Code Here

TOP

Related Classes of xcat.types.TypeMapImpl

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.