1 26 27 package org.objectweb.openccm.OpenCCM_DCI.cif; 28 29 import org.objectweb.openccm.OpenCCM_DCI.*; 30 import org.objectweb.openccm.corba.*; 31 32 41 public class NodeInformationSegImpl 42 extends org.objectweb.openccm 43 .OpenCCM_DCI.NodeManagerSessionComposition 44 .NodeInformationSeg 45 { 46 52 53 private org.objectweb.openccm.descriptor.node.beans.NodeBean nodeTree; 54 55 56 private org.ist.coach.DCI.DCIDescriptor[] descriptors; 57 58 59 private String prefix="NodeInformation >> "; 60 61 67 73 79 85 public void 86 setTree(String npdFilePath) 87 { 88 try 89 { 90 java.io.File nodeFile= new java.io.File (npdFilePath); 92 nodeTree= 94 org.objectweb.openccm 95 .descriptor.node.beans 96 .NodeBeanImpl.unmarshalBean(nodeFile); 97 if(System.getProperty("NodeName")!=null){ 100 System.err.println(prefix+ "Used NodeName java property"); 101 System.err.println(prefix+ "No user NPD define"); 102 ((org.objectweb.openccm.OpenCCM_DCI.NodeManagerCCM)get_context()) 103 .node_name(System.getProperty("NodeName")); 104 } 105 else 106 ((org.objectweb.openccm.OpenCCM_DCI.NodeManagerCCM)get_context()) 107 .node_name(nodeTree.getId()); 108 109 descriptors=new org.ist.coach.DCI.DCIDescriptor[1]; 111 descriptors[0]=new org.ist.coach.DCI.DCIDescriptor(); 112 descriptors[0].filename=npdFilePath; 113 descriptors[0].type=org.ist.coach.DCI.DCIDescriptorType.NPD; 114 115 java.io.BufferedReader br= 116 new java.io.BufferedReader (new java.io.FileReader (nodeFile)); 117 while(br.ready()) 119 descriptors[0].descriptor= 120 descriptors[0].descriptor+br.readLine()+"\n"; 121 122 124 if(System.getProperty("ComponentInstallationDir")!=null){ 125 System.err.println(prefix+ "Used ComponentInstallationDir java property"); 126 System.err.println(prefix+ "No user NPD define"); 127 ((ExtComponentInstallationImpl) 128 get_main_segment().obtain_executor("component_installation")) 129 .setComponentInstallationDir(System.getProperty("ComponentInstallationDir")); 130 } 131 else 132 ((ExtComponentInstallationImpl) 133 get_main_segment().obtain_executor("component_installation")) 134 .setComponentInstallationDir(nodeTree.getProperties() 135 .getProperty().getValue() 136 .getValue()); 137 } 138 catch(Exception e) 139 { 140 e.printStackTrace(); 141 } 142 } 143 144 149 public org.omg.CORBA.Any 150 get_property_value(String properties_name) 151 { 152 throw new org.omg.CORBA.NO_IMPLEMENT (); 154 } 155 156 160 public org.ist.coach.DCI.DCIDescriptor[] 161 get_node_properties() 162 { 163 if(descriptors!=null) 164 return descriptors; 165 166 return new org.ist.coach.DCI.DCIDescriptor[0]; 167 } 168 169 174 public boolean 175 is_property_defined(java.lang.String propertyName) 176 { 177 throw new org.omg.CORBA.NO_IMPLEMENT (); 179 } 180 } 181 | Popular Tags |