Package xcat.exceptions

Examples of xcat.exceptions.NonstandardException


            int status)
    throws gov.cca.CCAException {
    logger.finest("called for component: " + componentName);

    if (!componentMap.containsKey(componentName))
      throw new NonstandardException("Unknown component: " + componentName);

    // add checkpoint information inside the checkpointMap
    CheckpointInfo cpInfo = new CheckpointInfo(storageServiceURL,
                 storageID);
    tempCheckpointMap.put(componentName, cpInfo);
View Full Code Here


      " with status: " + status +
      " for component: " + providesComponentName);

    if (!componentMap.containsKey(providesComponentName) ||
  !migrationMap.containsKey(providesComponentName))
      throw new NonstandardException("Unknown component: " + providesComponentName);

    MigrationInfo mInfo =
      (MigrationInfo) migrationMap.get(providesComponentName);
    synchronized(mInfo) {
     
View Full Code Here

      // invoke the setServices method on the component
      try {
  component.setServices(services);
      } catch (Exception e) {
  logger.severe("Can't invoke setServices on component", e);
  throw new NonstandardException("Can't invoke setServices on component", e);
      }
     
      // retrieve the ComponentID for this component
      if (!(services.getComponentID() instanceof XCATComponentIDServerImpl))
  throw new NonstandardException("ComponentID not an instance of XCATComponentIDServerImpl");
      XCATComponentIDServerImpl cid = (XCATComponentIDServerImpl) services.getComponentID();

      // set the GSH for this ComponentID
      cid.setGSH(instanceHandle);

      // Add a reference to this ComponentID into the Handle Resolver
      HandleResolver.addReference(instanceHandle, cid);

      // add some SDEs to the Component
      logger.finest("adding default Service Data Elements");
      ServiceDataManagerInterface sdm =
  cid.getServiceDataManager();
      ServiceDataElementFactory sdeFactory =
  ServiceDataElementFactory.getDefault();
     
      // an SDE for the name of the Component
      XmlQName serviceQName = XmlQName.Factory.newInstance();
      serviceQName.setQNameValue(new QName("http://www.extreme.indiana.edu/xcat/ccacore/componentID",
             instanceName));
      ServiceDataElement serviceNameSDE =
  sdeFactory.newServiceDataElement(new QName(OGSI.OGSI_NS,
               "instanceName"),
           serviceQName);
      sdm.addServiceData(serviceNameSDE);

      // add SDEs for GSH's of each of the ports
      String[] portNames = services.getProvidedPortNames();
      for (int i = 0; i < portNames.length; i++) {
  String portHandle = services.getPortHandle(portNames[i]);
  String handleXMLString =
    "<tns:providesPortHandle " +
    "xmlns:tns=\"http://www.extreme.indiana.edu/xcat/ccacore/componentID\" " +
    "name=\"" + portNames[i] + "\">" +
    portHandle +
    "</tns:providesPortHandle>";
  ServiceDataElement handleSDE =
    sdeFactory.newServiceDataElement(handleXMLString);
  sdm.addServiceData(handleSDE);
      }

      String handleXMLString =
  "<tns:componentHandle " +
  "xmlns:tns=\"http://www.extreme.indiana.edu/xcat/ccacore/componentID\" " +
  "name=\"" + instanceName + "\">" +
  instanceHandle +
  "</tns:componentHandle>";
      ServiceDataElement handleSDE =
  sdeFactory.newServiceDataElement(handleXMLString);
      sdm.addServiceData(handleSDE);

    } catch (ClassNotFoundException cnfe) {
      logger.severe("Can't find class " + className + " for component", cnfe);
      throw new NonstandardException("Can't find class " + className +
             " for component", cnfe);
    } catch(InstantiationException ie) {
      logger.severe("Can't instantiate class " + className, ie);
      throw new NonstandardException("Can't instantiate class " + className,
             ie);
    } catch (IllegalAccessException iae) {
      logger.severe("Can't instantiate class " + className, iae);
      throw new NonstandardException("Can't instantiate class " + className,
             iae);
    } catch (ServiceDataManagerException sdme) {
      logger.severe("Can't create ServiceDataManager for ComponentID", sdme);
      throw new NonstandardException("Can't create ServiceDataManager for ComponentID",
             sdme);
    } catch (ServiceDataElementException sdee) {
      logger.severe("Can't add service data to ComponentID", sdee);
      throw new NonstandardException("Can't add service data to ComponentID",
             sdee);
    }
  }
View Full Code Here

    if ((migrationStatus == COMPLETE) || (providesPortReference == null)) {
      migrationStatus = NONE;
     
      String intfClassName = properties.getString("portClass", "None");
      if (intfClassName.equals("None"))
  throw new NonstandardException("Unknown interface for uses port: " +
               portName);
      providesPortReference = HandleResolver.resolveHandle(connectionID.getProvidesPortHandle(),
                 intfClassName);
      return providesPortReference;
    }
   
    // can get here only if providesPortReference != null, and component is migrating
    throw new NonstandardException("Can't return a reference as component is migrating");
  }
View Full Code Here

      // set the component for the services object
      services.setComponent(component);

      // retrieve the ComponentID for this component
      if (!(services.getComponentID() instanceof MobileComponentIDServerImpl))
  throw new NonstandardException("ComponentID not an instance of MobileComponentIDServerImpl");
      MobileComponentIDServerImpl cid =
  (MobileComponentIDServerImpl) services.getComponentID();

      // set the GSH for this ComponentID
      cid.setGSH(instanceHandle);

      // Add a reference to this ComponentID into the Handle Resolver
      HandleResolver.addReference(instanceHandle, cid);

      // if this component has been migrated, return here
      if (isMigrated) {
  logger.finest("Component is migrated, setServices will not be invoked");
  return;
      }

      // invoke the setServices method on the component
      try {
  component.setServices(services);
      } catch (Exception e) {
  logger.severe("Can't invoke setServices on component", e);
  throw new NonstandardException("Can't invoke setServices on component", e);
      }
     
      // add some SDEs to the Component
      logger.finest("adding default Service Data Elements");
      ServiceDataManagerInterface sdm =
  cid.getServiceDataManager();
      ServiceDataElementFactory sdeFactory =
  ServiceDataElementFactory.getDefault();
     
      // an SDE for the name of the Component
      XmlQName serviceQName = XmlQName.Factory.newInstance();
      serviceQName.setQNameValue(new QName("http://www.extreme.indiana.edu/xcat/ccacore/componentID",
             instanceName));
      ServiceDataElement serviceNameSDE =
  sdeFactory.newServiceDataElement(new QName(OGSI.OGSI_NS,
               "instanceName"),
           serviceQName);
      sdm.addServiceData(serviceNameSDE);

      // add SDEs for GSH's of each of the ports
      String[] portNames = services.getProvidedPortNames();
      for (int i = 0; i < portNames.length; i++) {
  String portHandle = services.getPortHandle(portNames[i]);
  String handleXMLString =
    "<tns:providesPortHandle " +
    "xmlns:tns=\"http://www.extreme.indiana.edu/xcat/ccacore/componentID\" " +
    "name=\"" + portNames[i] + "\">" +
    portHandle +
    "</tns:providesPortHandle>";
  ServiceDataElement handleSDE =
    sdeFactory.newServiceDataElement(handleXMLString);
  sdm.addServiceData(handleSDE);
      }

      String handleXMLString =
  "<tns:componentHandle " +
  "xmlns:tns=\"http://www.extreme.indiana.edu/xcat/ccacore/componentID\" " +
  "name=\"" + instanceName + "\">" +
  instanceHandle +
  "</tns:componentHandle>";
      ServiceDataElement handleSDE =
  sdeFactory.newServiceDataElement(handleXMLString);
      sdm.addServiceData(handleSDE);

    } catch (ClassNotFoundException cnfe) {
      logger.severe("Can't find class " + className + " for component", cnfe);
      throw new NonstandardException("Can't find class " + className +
             " for component", cnfe);
    } catch(InstantiationException ie) {
      logger.severe("Can't instantiate class " + className, ie);
      throw new NonstandardException("Can't instantiate class " + className,
             ie);
    } catch (IllegalAccessException iae) {
      logger.severe("Can't instantiate class " + className, iae);
      throw new NonstandardException("Can't instantiate class " + className,
             iae);
    } catch (ServiceDataManagerException sdme) {
      logger.severe("Can't create ServiceDataManager for ComponentID", sdme);
      throw new NonstandardException("Can't create ServiceDataManager for ComponentID",
             sdme);
    } catch (ServiceDataElementException sdee) {
      logger.severe("Can't add service data to ComponentID", sdee);
      throw new NonstandardException("Can't add service data to ComponentID",
             sdee);
    }
  }
View Full Code Here

      return;
    } else if (type.equals(Boolean.class.getName())) {
      boolean b = Boolean.valueOf(value).booleanValue();
      tMap.putBool(key, b);
    } else
      throw new NonstandardException("Can not handle type: " + type);
  }
View Full Code Here

  // add the entry to the typeMap
  put(tMap, key, value, type);
      }
    } catch (Exception e) {
      logger.severe("Exception while reading TypeMap from XML", e);
      throw new NonstandardException("Exception while reading TypeMap from XML",
             e);
    }
  }
View Full Code Here

   */
  public XCATPort getProvidesPortReference()
    throws gov.cca.CCAException {
    String intfClassName = properties.getString("portClass", "None");
    if (intfClassName.equals("None"))
      throw new NonstandardException("Unknown interface for provides port: " +
             portName);
    return HandleResolver.resolveHandle(providesPortHandle,
          intfClassName);
  }
View Full Code Here

      return wsReference;

    // if not, create a fresh reference and return it
    String intfClassName = properties.getString("portClass", "None");
    if (intfClassName.equals("None"))
      throw new NonstandardException("Unknown interface for WS port: " +
             portName);
    try {
      // TODO: When the WSDL will be used, all information can be inferred from it
      // Specifically, need to remove the hardcoded values for SoapStyle & SoapAction
      wsReference = soaprmi.soaprpc.SoapServices.getDefault().
  createStartpoint(endPointLocation,  // service location
       new Class[]{Class.forName(intfClassName)}, // remote service interface
       "", // endpoint name
       soaprmi.soap.SoapStyle.SOAP11,
       "" // SOAPAction
       );
      return wsReference;
    } catch (Exception e) {
      logger.severe("Can't create a remote reference for the Web service", e);
      throw new NonstandardException("Can't create a remote reference for the Web service",
             e);
    }
  }
View Full Code Here

   */
  public String getGSH()
    throws gov.cca.CCAException {
    logger.finest("called");
    if (portGSH == null)
      throw new NonstandardException("GSH for this port is not set");
    return portGSH;
  }
View Full Code Here

TOP

Related Classes of xcat.exceptions.NonstandardException

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.