This commit is contained in:
Lucio Lelii 2008-09-16 12:24:16 +00:00
parent c31a9c0ca8
commit fe1843f6d9
2 changed files with 11 additions and 18 deletions

View File

@ -6,11 +6,11 @@
<Description>IS-Registry: validate, register and unregister GCUBE resources to/from the IS. It also publishes Topics for notifications about GCUBE resource events</Description>
<Class>InformationSystem</Class>
<Name>IS-Registry</Name>
<Version>1.0</Version>
<Version>1.0.0</Version>
<Packages>
<Main>
<Name>IS-Registry-service</Name>
<Version>1.0</Version>
<Version>1.0.0</Version>
<Mandatory level="VO"/>
<Shareable level="VO"/>
<GHNRequirements>
@ -23,7 +23,7 @@
<Name>IS-Registry</Name>
</Service>
<Package>IS-Registry-stubs</Package>
<Version>1.0</Version>
<Version>1.0.0</Version>
<Scope level="GHN"/>
<Optional>false</Optional>
</Dependency>
@ -42,7 +42,7 @@
</Main>
<Software>
<Name>IS-Registry-stubs</Name>
<Version>1.0</Version>
<Version>1.0.0</Version>
<MultiVersion value="true"/>
<Mandatory level="GHN"/>
<Shareable level="VO"/>

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.impl.SimpleTopic;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
@ -39,7 +40,7 @@ public class ProfileResource extends GCUBEWSResource {
private ISNotifier notifier= null;
ArrayList<QName> listQname = new ArrayList<QName>();
ArrayList<SimpleTopic> listQname = new ArrayList<SimpleTopic>();
protected static final String NotificationProfileRP="NotificationProfile";
@ -82,15 +83,7 @@ public class ProfileResource extends GCUBEWSResource {
throw new ResourceException(e1);
}
/*
StringWriter sw= new StringWriter();
try {
resource.store(sw);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
*/
this.setProfile(dom);
this.setNotificationProfile(dom);
this.setGCubeResource(resource);
@ -100,13 +93,13 @@ public class ProfileResource extends GCUBEWSResource {
if (hasToLive(resource)) {
//registration of Topic To IS-Notifier
listQname.add(this.generateQName());
listQname.add(new SimpleTopic(this.generateQName()));
synchronized(RegistryFactory.notificationMap) {
if (!(RegistryFactory.notificationMap.contains(this.getID()))) {
try {
publisher = GHNContext.getImplementation(ISPublisher.class);
notifier = GHNContext.getImplementation(ISNotifier.class);
//publisher.registerToISNotification(this.getEPR(), listQname, GHNContext.getContext().getDefaultScope(), ServiceContext.getContext());
notifier.registerISNotification(this.getEPR(), listQname, ServiceContext.getContext());
} catch (Exception e){
e.printStackTrace();
throw new ResourceException(e);
@ -187,7 +180,7 @@ public class ProfileResource extends GCUBEWSResource {
{
try {
notifier.unregisterFromISNotification(this.getEPR(),listQname,ServiceContext.getContext());
notifier.unregisterISNotification(this.getEPR(),listQname,ServiceContext.getContext());
} catch (ISPublisherException e) {
e.printStackTrace();
} catch (Exception e) {
@ -200,7 +193,7 @@ public class ProfileResource extends GCUBEWSResource {
}
try {
publisher.removeWSResource(this,GHNContext.getContext().getDefaultScope());
publisher.removeWSResource(this,ServiceContext.getContext().getScope());
} catch (ISPublisherException e) {
e.printStackTrace();
}