This commit is contained in:
Lucio Lelii 2009-02-13 11:00:20 +00:00
parent 9db3293917
commit f70d0d974f
6 changed files with 34 additions and 28 deletions

View File

@ -399,6 +399,11 @@ etics.build: (optional) Set to 'true', it indicates that build structures a
</target>
<target name="jarService" depends="buildService" description="jars service implementation">
<copy todir="${build.class.dir}">
<fileset dir="${source.dir}">
<include name="org/**/*.xsl"/>
</fileset>
</copy>
<jar jarfile="${build.lib.dir}/${jarfile}" basedir="${build.class.dir}">
<include name="${package.dir}/**" />
</jar>

View File

@ -14,7 +14,7 @@
xmlns:agg="http://mds.globus.org/aggregator/types">
<agg:AggregatorConfig xsi:type="agg:AggregatorConfig">
<agg:GetMultipleResourcePropertiesPollType xmlns:xmlindexer="http://gcube-system.org/namespaces/metadatamanagement/xmlindexer/gcubedaix">
<agg:GetMultipleResourcePropertiesPollType xmlns:modeler="http://gcube-system.org/namespaces/vremanagement/vremodeler">
<!-- the polling time: how often the IS synchronizes its content with the RPD values -->
<agg:PollIntervalMillis>60000</agg:PollIntervalMillis>
<agg:ResourcePropertyNames>modeler:Id</agg:ResourcePropertyNames>

View File

@ -12,15 +12,15 @@ public class ModelerPersistenceDelegate extends GCUBEWSFilePersistenceDelegate<M
protected void onLoad(ModelerResource resource, ObjectInputStream ois) throws Exception {
super.onLoad(resource, ois);
resource.setId((String)ois.readObject());
resource.setReportFirstStep((String)ois.readObject());
resource.setReportSecondStep((String)ois.readObject());
resource.setFirstReport((String)ois.readObject());
resource.setSecondReport((String)ois.readObject());
}
protected void onStore(ModelerResource resource,ObjectOutputStream oos) throws Exception {
super.onStore(resource, oos);
oos.writeObject(resource.getId());
oos.writeObject(resource.getReportFirstStep());
oos.writeObject(resource.getReportSecondStep());
oos.writeObject(resource.getFirstReport());
oos.writeObject(resource.getSecondReport());
}
}

View File

@ -6,17 +6,18 @@ import org.globus.wsrf.ResourceException;
public class ModelerResource extends GCUBEWSResource {
protected static final String RP_ID = "Id";
protected static final String RP_FIRSTSTEP = "firstReport";
protected static final String RP_SECONDSTEP = "secondReport";
protected static final String RP_FIRSTREPORT= "firstReport";
protected static final String RP_SECONDREPORT = "secondReport";
protected static String[] RPNames = { RP_ID, RP_FIRSTSTEP, RP_SECONDSTEP};
protected static String[] RPNames = { RP_ID, RP_FIRSTREPORT, RP_SECONDREPORT};
@Override
protected void initialise(Object... args) throws ResourceException {
if (args.length!=1) throw new ResourceException();
this.setId((String) args[0]);
this.setReportFirstStep("");
this.setReportSecondStep("");
this.setFirstReport("");
this.setSecondReport("");
this.store();
}
@ -52,8 +53,8 @@ public class ModelerResource extends GCUBEWSResource {
* @return
* @throws ResourceException
*/
public String getReportSecondStep() throws ResourceException {
return (String) this.getResourcePropertySet().get(RP_SECONDSTEP).get(0);
public String getSecondReport() throws ResourceException {
return (String) this.getResourcePropertySet().get(RP_SECONDREPORT).get(0);
}
/**
@ -61,10 +62,9 @@ public class ModelerResource extends GCUBEWSResource {
* @param reportSecondStep
* @throws ResourceException
*/
public synchronized void setReportSecondStep(String reportSecondStep) throws ResourceException {
this.getResourcePropertySet().get(RP_SECONDSTEP).clear();
this.getResourcePropertySet().get(RP_SECONDSTEP).add(reportSecondStep);
this.store();
public synchronized void setSecondReport(String reportSecondStep) throws ResourceException {
this.getResourcePropertySet().get(RP_SECONDREPORT).clear();
this.getResourcePropertySet().get(RP_SECONDREPORT).add(reportSecondStep);
}
/**
@ -72,8 +72,8 @@ public class ModelerResource extends GCUBEWSResource {
* @return
* @throws ResourceException
*/
public String getReportFirstStep() throws ResourceException {
return (String) this.getResourcePropertySet().get(RP_FIRSTSTEP).get(0);
public String getFirstReport() throws ResourceException {
return (String) this.getResourcePropertySet().get(RP_FIRSTREPORT).get(0);
}
/**
@ -81,10 +81,9 @@ public class ModelerResource extends GCUBEWSResource {
* @param reportFirstStep
* @throws ResourceException
*/
public synchronized void setReportFirstStep(String reportFirstStep) throws ResourceException {
this.getResourcePropertySet().get(RP_FIRSTSTEP).clear();
this.getResourcePropertySet().get(RP_FIRSTSTEP).add(reportFirstStep);
this.store();
public synchronized void setFirstReport(String reportFirstStep) throws ResourceException {
this.getResourcePropertySet().get(RP_FIRSTREPORT).clear();
this.getResourcePropertySet().get(RP_FIRSTREPORT).add(reportFirstStep);
}
}

View File

@ -15,7 +15,6 @@ import org.gcube.common.core.types.VOID;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.vremanagement.vremodeler.db.DBInterface;
import org.gcube.vremanagement.vremodeler.impl.thread.DeployVRE;
import org.gcube.vremanagement.vremodeler.impl.util.GCUBECollection;
import org.gcube.vremanagement.vremodeler.impl.util.MetadataFormat;
import org.gcube.vremanagement.vremodeler.impl.util.ModelerCollection;
import org.gcube.vremanagement.vremodeler.impl.util.XMLUtil;
@ -541,7 +540,7 @@ public class ModelerService {
public CheckStatusResponse checkStatus(VOID var) throws Exception{
CheckStatusResponse res= new CheckStatusResponse();
res.setReports(new String[]{getResource().getReportFirstStep(), getResource().getReportSecondStep()});
res.setReports(new String[]{getResource().getFirstReport(), getResource().getSecondReport()});
return res;
}

View File

@ -90,10 +90,12 @@ public class DeployVRE extends Thread{
throw new Exception("Error Deployng the VRE failed on second step");
}
}else{
getResource().setReportSecondStep("FAILED");
getResource().setSecondReport("FAILED");
getResource().store();
logger.info("Deploying of the VRE with id "+this.resourceId+" FAILED on first step");
throw new Exception("Error Deployng the VRE filed on first step");
}
}catch(Exception e){
try {
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='"+ModelerService.FAILED+"' WHERE VRE.id='"+this.resourceId+"';");
@ -147,7 +149,8 @@ public class DeployVRE extends Thread{
Thread.currentThread().sleep(20000);
report=mbportType.getReport(reportId);
attempt++;
getResource().setReportFirstStep(report);
getResource().setFirstReport(report);
getResource().store();
}while (!isDeploymentStatusFinished(report) && attempt<10);
}catch(Exception e){e.printStackTrace(); throw e;}
logger.trace("report step 1: "+report);
@ -325,8 +328,8 @@ public class DeployVRE extends Thread{
Thread.currentThread().sleep(20000);
report=vreManPortType.getReport(reportId);
attempt++;
getResource().setReportSecondStep(report);
getResource().setSecondReport(report);
getResource().store();
}while (!isDeploymentStatusFinished(report) && attempt<20);
logger.info("is something failed in the second step?"+isSomethingFailed(report));
logger.trace("report step 2: "+report);