git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Registry@41 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5d5418a940
commit
e2374c479e
|
@ -12,6 +12,7 @@ import org.gcube.common.core.contexts.GHNContext;
|
|||
import org.gcube.common.core.resources.GCUBEHostingNode;
|
||||
import org.gcube.common.core.resources.GCUBEResource;
|
||||
import org.gcube.common.core.resources.GCUBERunningInstance;
|
||||
import org.gcube.common.core.resources.GCUBEService;
|
||||
import org.gcube.common.core.state.GCUBEWSResource;
|
||||
import org.gcube.common.core.utils.logging.GCUBELog;
|
||||
import org.globus.wsrf.ResourceException;
|
||||
|
@ -55,8 +56,6 @@ public class ProfileResource extends GCUBEWSResource {
|
|||
public void initialise(Object... params) throws ResourceException {
|
||||
GCUBEResource resource = (GCUBEResource) params[0];
|
||||
|
||||
//Setting the key
|
||||
this.setID(ProfileContext.getContext().makeKey(resource.getID()));
|
||||
StringWriter writer =new StringWriter();
|
||||
try {
|
||||
resource.store(writer);
|
||||
|
@ -127,7 +126,9 @@ public class ProfileResource extends GCUBEWSResource {
|
|||
* return true/false
|
||||
*/
|
||||
private boolean hasToLive(GCUBEResource resource) {
|
||||
if (resource.getType().compareTo(GCUBERunningInstance.TYPE)==0 || resource.getType().compareTo(GCUBEHostingNode.TYPE)==0) return true;
|
||||
if (resource.getType().compareTo(GCUBERunningInstance.TYPE)==0 ||
|
||||
resource.getType().compareTo(GCUBEHostingNode.TYPE)==0 ||
|
||||
resource.getType().compareTo(GCUBEService.TYPE)==0) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ public class RegistryFactory extends GCUBEStartupPortType{
|
|||
|
||||
//try to create resource
|
||||
try {
|
||||
ProfileContext.getContext().getWSHome().create(resource);
|
||||
ProfileContext.getContext().getWSHome().create(ProfileContext.getContext().makeKey(resource.getID()),resource);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
String msg = "Error creating Resource";
|
||||
|
@ -384,7 +384,7 @@ public class RegistryFactory extends GCUBEStartupPortType{
|
|||
protected synchronized ProfileResource getProfileResource(String id ){
|
||||
ProfileResource resource = null;
|
||||
|
||||
ResourceKey key = new SimpleResourceKey(ProfileContext.getContext().getWSHome().getKeyTypeName(), id);
|
||||
ResourceKey key = ProfileContext.getContext().makeKey( id);
|
||||
|
||||
try {
|
||||
resource = (ProfileResource) ProfileContext.getContext().getWSHome().find(key);
|
||||
|
|
Loading…
Reference in New Issue