*/
URL url = this.getClass().getClassLoader().getResource(GRAM_PROPERTIES);
Properties properties = new Properties();
properties.load(url.openStream());
HostDescription host = new HostDescription();
host.getType().changeType(GlobusHostType.type);
host.getType().setHostName(properties.getProperty("gram.name"));
host.getType().setHostAddress(properties.getProperty("gram.host"));
((GlobusHostType) host.getType()).setGridFTPEndPointArray(new String[]{properties.getProperty("gridftp.endpoint")});
((GlobusHostType) host.getType()).setGlobusGateKeeperEndPointArray(new String[]{properties.getProperty("gram.endpoints")});
/*
* Application deployment description
*/
ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription(GramApplicationDeploymentType.type);
GramApplicationDeploymentType app = (GramApplicationDeploymentType) appDesc.getType();
app.setCpuCount(1);
app.setNodeCount(1);
ApplicationDeploymentDescriptionType.ApplicationName name = appDesc.getType().addNewApplicationName();
name.setStringValue("FileBreed");
app.setExecutableLocation("/bin/echo");
app.setScratchWorkingDirectory(properties.getProperty("scratch.working.directory"));
app.setCpuCount(1);
ProjectAccountType projectAccountType = ((GramApplicationDeploymentType) appDesc.getType()).addNewProjectAccount();
projectAccountType.setProjectAccountNumber(properties.getProperty("allocation.charge.number"));
QueueType queueType = app.addNewQueue();
queueType.setQueueName(properties.getProperty("defualt.queue"));
/*
* Application Service
*/
ServiceDescription serv = new ServiceDescription();
serv.getType().setName("FileBreedTest");
InputParameterType inputParameter = InputParameterType.Factory.newInstance();
inputParameter.setParameterName("Input_File");
inputParameter.setParameterDescription("File to Replicate");
ParameterType parameterType1 = inputParameter.addNewParameterType();
parameterType1.setType(DataType.Enum.forString("URI"));
inputParameter.setParameterType(URIParameterType.Factory.newInstance());
List<InputParameterType> inputList = new ArrayList<InputParameterType>();
inputList.add(inputParameter);
InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
.size()]);
OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
ParameterType outputParameterType = outputParameter.addNewParameterType();
outputParameterType.setName("replicated_file");
outputParameterType.setType(DataType.URI);
List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
outputList.add(outputParameter);
OutputParameterType[] outputParamList = outputList
.toArray(new OutputParameterType[outputList.size()]);
serv.getType().setInputParametersArray(inputParamList);
serv.getType().setOutputParametersArray(outputParamList);
/*
* Save deployment descriptions to registry
*/
jcrRegistry.addHostDescriptor(host);
jcrRegistry.addApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(), appDesc);
jcrRegistry.addServiceDescriptor(serv);
// jcrRegistry.deployServiceOnHost(serv.getType().getName(), host.getType().getHostName());
}