Package xcat.ports

Examples of xcat.ports.ProvidesPortInfo


       (String) providerKeys[i] +
       "</portName>");
     
      // copy over information from ProvidesPortInfo
      sInfoBuffer.append("<providesPortRecord>");
      ProvidesPortInfo pInfo = (ProvidesPortInfo) providesPortMap.get(providerKeys[i]);
      sInfoBuffer.append("<portName>" +
       pInfo.getPortName() +
       "</portName>");
      sInfoBuffer.append("<portType>" +
       pInfo.getPortType() +
       "</portType>");
      sInfoBuffer.append("<inUse>" +
       pInfo.getInUse() +
       "</inUse>");
      sInfoBuffer.append("<numConnections>" +
       pInfo.getNumConnections() +
       "</numConnections>");
      sInfoBuffer.append("<providesPortHandle>" +
       pInfo.getProvidesPortHandle() +
       "</providesPortHandle>");
      sInfoBuffer.append("<removed>" +
       pInfo.isRemoved() +
       "</removed>");
     
      // copy over the TypeMap object
      sInfoBuffer.append("<properties>");
      TypeMap tMap = pInfo.getProperties();
      String[] mapKeys = tMap.getAllKeys();
      for (int j = 0; j < mapKeys.length; j++) {
  sInfoBuffer.append("<propertiesEntry>");
  sInfoBuffer.append("<key>" +
         mapKeys[j] +
View Full Code Here


        removed = Boolean.valueOf((String) nextItem.readNextChild()).booleanValue();
      }
    }

    // create a ProvidesPortInfo entry
    ProvidesPortInfo pInfo = new ProvidesPortInfo(portName,
                    portType,
                    tMap,
                    providesPortHandle);
    pInfo.setInUse(inUse);
    pInfo.setNumConnections(numConnections);
    if (removed)
      pInfo.removePort();
   
    // export this port as a grid service
    String portImpl = tMap.getString("cca.portImpl", "None");
    if (portImpl.equals("None"))
      throw new UnexpectedException("Can't find FQN for provides port: " + portName);
    Class portClass = Class.forName(portImpl);
    // assumption here that a void constructor exists
    Object portInstance = portClass.newInstance();
    String intfClassName = tMap.getString("portClass", "None");
    UnicastRemoteObject.exportObject((XCATPort) portInstance,
             new Class[]{Class.forName(intfClassName)});
   
    // add a reference to the Handle Resolver
    String portGSH = pInfo.getProvidesPortHandle();
    ((XCATPort) portInstance).setGSH(portGSH);
    HandleResolver.addReference(portGSH, (XCATPort) portInstance);
   
    // add this provides port to the hashMap
    providesPortMap.put(portName, pInfo);
View Full Code Here

TOP

Related Classes of xcat.ports.ProvidesPortInfo

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.