Package xcat.ccacore

Examples of xcat.ccacore.XCATServicesImpl


      Class componentClass = Class.forName(className);
      gov.cca.Component component =
  (gov.cca.Component) componentClass.newInstance();
     
      // create a new services object
      XCATServicesImpl services = new XCATServicesImpl(instanceName);
     
      // 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 +
View Full Code Here

TOP

Related Classes of xcat.ccacore.XCATServicesImpl

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.