git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Registry@296 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
cb8c9e3ae1
commit
e6b1a308a9
|
@ -60,9 +60,11 @@ public class ServiceContext extends GCUBEServiceContext {
|
||||||
|
|
||||||
ISClient client = null;
|
ISClient client = null;
|
||||||
|
|
||||||
|
|
||||||
//creates the single RegistryResource used to raise notifications about profiles' changes
|
//creates the single RegistryResource used to raise notifications about profiles' changes
|
||||||
FactoryContext.getContext().getWSHome().create(
|
FactoryContext.getContext().getWSHome().create(
|
||||||
FactoryContext.getContext().makeKey(RegistryFactory.NOTIFICATOR_RESOURCE_KEY));
|
FactoryContext.getContext().makeKey(RegistryFactory.NOTIFICATOR_RESOURCE_KEY));
|
||||||
|
logger.info("IS-Registry notification resource registered");
|
||||||
|
|
||||||
// create GeneralQueryManager
|
// create GeneralQueryManager
|
||||||
try {
|
try {
|
||||||
|
@ -70,14 +72,14 @@ public class ServiceContext extends GCUBEServiceContext {
|
||||||
queryRI = client.getQuery(GCUBERIsFromClassAndName.class);
|
queryRI = client.getQuery(GCUBERIsFromClassAndName.class);
|
||||||
queryGHN = client.getQuery(GCUBEResourceXPathQuery.class);
|
queryGHN = client.getQuery(GCUBEResourceXPathQuery.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
logger.error("Failed to create a QueryManger", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
RegistryRIProfile = ServiceContext.getContext().getInstance();
|
RegistryRIProfile = ServiceContext.getContext().getInstance();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
logger.error("Unable to get the service instance profile", e);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -85,37 +87,37 @@ public class ServiceContext extends GCUBEServiceContext {
|
||||||
ROOT_SERVICES.ISNOTIFIER.getClazz(), ROOT_SERVICES.ISNOTIFIER.getName()).getInstance();
|
ROOT_SERVICES.ISNOTIFIER.getClazz(), ROOT_SERVICES.ISNOTIFIER.getName()).getInstance();
|
||||||
isNotifierCodeployed = true;
|
isNotifierCodeployed = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
logger.warn("Unable to detect if the " + ROOT_SERVICES.ISNOTIFIER.getName() + " is co-deployed");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
GHNManagerProfile = GHNContext.getContext().getServiceContext(ROOT_SERVICES.GHNMANAGER.getClazz(), ROOT_SERVICES.GHNMANAGER.getName()).getInstance();
|
GHNManagerProfile = GHNContext.getContext().getServiceContext(ROOT_SERVICES.GHNMANAGER.getClazz(), ROOT_SERVICES.GHNMANAGER.getName()).getInstance();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
logger.warn("Unable to detect if the " + ROOT_SERVICES.GHNMANAGER.getName() + " is co-deployed");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ISICRIProfile = GHNContext.getContext().getServiceContext( ROOT_SERVICES.ISIC.getClazz(), ROOT_SERVICES.ISIC.getName()).getInstance();
|
ISICRIProfile = GHNContext.getContext().getServiceContext( ROOT_SERVICES.ISIC.getClazz(), ROOT_SERVICES.ISIC.getName()).getInstance();
|
||||||
isICCodeployed = true;
|
isICCodeployed = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
logger.warn("Unable to detect if the " + ROOT_SERVICES.ISIC.getName() + " is co-deployed");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ghnProfile = GHNContext.getContext().getGHN();
|
ghnProfile = GHNContext.getContext().getGHN();
|
||||||
ghnName = ghnProfile.getNodeDescription().getName();
|
ghnName = ghnProfile.getNodeDescription().getName();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
logger.error("Unable to get the GHN profile", e);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep(20000);
|
Thread.sleep(20000);
|
||||||
} catch (InterruptedException e1) {
|
} catch (InterruptedException e1) {
|
||||||
|
logger.error("Unable to get the servce instance profile", e1);
|
||||||
e1.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the Registry profile is alerady registered
|
// Check if the Registry profile is already registered
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// registers the my profile
|
// registers the my profile
|
||||||
|
@ -151,15 +153,14 @@ public class ServiceContext extends GCUBEServiceContext {
|
||||||
registerProfile(ghnProfile, GCUBEHostingNode.TYPE);
|
registerProfile(ghnProfile, GCUBEHostingNode.TYPE);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
logger.error("Failed to register co-deployed services", e);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onInitialisation() throws Exception {
|
protected void onInitialisation() throws Exception {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the Profile
|
* Register the Profile
|
||||||
|
|
Loading…
Reference in New Issue