This commit is contained in:
Lucio Lelii 2008-09-18 18:11:28 +00:00
parent c516201fdd
commit 1cefab7d2e
3 changed files with 20 additions and 8 deletions

View File

@ -117,7 +117,7 @@ public class ServiceContext extends GCUBEServiceContext {
GCUBERunningInstance RegistryRIProfile = ServiceContext.getContext().getInstance();
GCUBERIQuery query = ServiceContext.getContext().client.getQuery(GCUBERIQuery.class);
query.addAtomicConditions(new AtomicCondition("//ServiceClass", ServiceContext.this.getServiceClass()),new AtomicCondition("//ServiceName", this.getName()));
if (ServiceContext.getContext().client.execute(query, GHNContext.getContext().getDefaultScope()).size() == 0)
if (ServiceContext.getContext().client.execute(query, ServiceContext.getContext().getScope()).size() == 0)
registerProfile(RegistryRIProfile, GCUBERunningInstance.TYPE);
ServiceContext.getContext().checkCodeployedServices();
@ -162,7 +162,7 @@ public class ServiceContext extends GCUBEServiceContext {
throws ISPublisherException, Exception {
if (GHNContext.getContext().getMode() == GHNContext.Mode.ROOT)
GHNContext.getImplementation(ISPublisher.class).registerGCUBEResource(
resource, GHNContext.getContext().getDefaultScope(),
resource, ServiceContext.getContext().getScope(),
ServiceContext.getContext());
}
@ -200,7 +200,7 @@ public class ServiceContext extends GCUBEServiceContext {
query.addAtomicConditions(new AtomicCondition(
"//Endpoint@EntryName","gcube/informationsystem/notifier/Notifier"),new AtomicCondition("//ServiceName", ROOT_SERVICES.ISNOTIFIER.getName()));
if (client.execute(query, GHNContext.getContext().getDefaultScope()).size() == 0)
if (client.execute(query, ServiceContext.getContext().getScope()).size() == 0)
registerProfile(NotifierRIProfile, GCUBERunningInstance.TYPE);
}
@ -210,7 +210,7 @@ public class ServiceContext extends GCUBEServiceContext {
query.addAtomicConditions(new AtomicCondition(
"//Endpoint@EntryName","gcube/informationsystem/isic/ISICFactoryService"),new AtomicCondition("//ServiceName", ROOT_SERVICES.ISIC.getName()));
if (client.execute(query, GHNContext.getContext().getDefaultScope()).size() == 0)
if (client.execute(query, ServiceContext.getContext().getScope()).size() == 0)
registerProfile(ISICRIProfile, GCUBERunningInstance.TYPE);
}
// registers the local GHNManager profile
@ -221,7 +221,7 @@ public class ServiceContext extends GCUBEServiceContext {
GCUBEGHNQuery node = client.getQuery(GCUBEGHNQuery.class);
node.addAtomicConditions(new AtomicCondition("/GHNDescription/Name", ghnProfile.getNodeDescription().getName()));
if (client.execute(node, GHNContext.getContext().getDefaultScope()).size() == 0)
if (client.execute(node, ServiceContext.getContext().getScope()).size() == 0)
registerProfile(ghnProfile, GCUBEHostingNode.TYPE);
}

View File

@ -23,6 +23,7 @@ import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.registry.impl.RegistryFactory;
import org.gcube.informationsystem.registry.impl.contexts.ServiceContext;
import org.globus.wsrf.ResourceException;
import org.globus.wsrf.Topic;
import org.globus.wsrf.impl.SimpleTopic;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
@ -97,9 +98,20 @@ public class ProfileResource extends GCUBEWSResource {
synchronized(RegistryFactory.notificationMap) {
if (!(RegistryFactory.notificationMap.contains(this.getID()))) {
try {
publisher = GHNContext.getImplementation(ISPublisher.class);
notifier = GHNContext.getImplementation(ISNotifier.class);
System.out.println("i'm here ---------------");
for (SimpleTopic s : listQname)
System.out.println(s);
System.out.println(listQname);
System.out.println(listQname.getClass());
try {
notifier.registerISNotification(this.getEPR(), listQname, ServiceContext.getContext());
} catch (ArrayStoreException e) {
System.out.println(e);
e.printStackTrace();
System.out.println("end stack trace");
}
System.out.println("i'm there xxx---------------");
} catch (Exception e){
e.printStackTrace();
throw new ResourceException(e);

View File

@ -23,7 +23,7 @@ public static void main (String[]args ) throws Exception {
GCUBESecurityManagerImpl managerSec = new GCUBESecurityManagerImpl() { public boolean isSecurityEnabled() {return true;}};
ExtendedGSSCredential cred =org.diligentproject.dvos.authentication.util.ProxyUtil.loadProxyCredentials(args[2]);
FileReader fis = new FileReader (args[1]);
GCUBEService resource =GHNContext.getImplementation(GCUBEService.class);
@ -40,7 +40,7 @@ public static void main (String[]args ) throws Exception {
}
UpdateResourceMessage message = new UpdateResourceMessage();
managerSec.useCredentials(cred);
registryFactoryPortType =GCUBERemotePortTypeContext.getProxy(registryFactoryPortType,GCUBEScope.getScope(args[3]),managerSec);
try {