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;
|
||||
|
||||
|
||||
//creates the single RegistryResource used to raise notifications about profiles' changes
|
||||
FactoryContext.getContext().getWSHome().create(
|
||||
FactoryContext.getContext().makeKey(RegistryFactory.NOTIFICATOR_RESOURCE_KEY));
|
||||
logger.info("IS-Registry notification resource registered");
|
||||
|
||||
// create GeneralQueryManager
|
||||
try {
|
||||
|
@ -70,14 +72,14 @@ public class ServiceContext extends GCUBEServiceContext {
|
|||
queryRI = client.getQuery(GCUBERIsFromClassAndName.class);
|
||||
queryGHN = client.getQuery(GCUBEResourceXPathQuery.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Failed to create a QueryManger", e);
|
||||
}
|
||||
|
||||
try {
|
||||
RegistryRIProfile = ServiceContext.getContext().getInstance();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Unable to get the service instance profile", e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -85,37 +87,37 @@ public class ServiceContext extends GCUBEServiceContext {
|
|||
ROOT_SERVICES.ISNOTIFIER.getClazz(), ROOT_SERVICES.ISNOTIFIER.getName()).getInstance();
|
||||
isNotifierCodeployed = true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.warn("Unable to detect if the " + ROOT_SERVICES.ISNOTIFIER.getName() + " is co-deployed");
|
||||
}
|
||||
|
||||
try {
|
||||
GHNManagerProfile = GHNContext.getContext().getServiceContext(ROOT_SERVICES.GHNMANAGER.getClazz(), ROOT_SERVICES.GHNMANAGER.getName()).getInstance();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.warn("Unable to detect if the " + ROOT_SERVICES.GHNMANAGER.getName() + " is co-deployed");
|
||||
}
|
||||
|
||||
try {
|
||||
ISICRIProfile = GHNContext.getContext().getServiceContext( ROOT_SERVICES.ISIC.getClazz(), ROOT_SERVICES.ISIC.getName()).getInstance();
|
||||
isICCodeployed = true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.warn("Unable to detect if the " + ROOT_SERVICES.ISIC.getName() + " is co-deployed");
|
||||
}
|
||||
|
||||
try {
|
||||
ghnProfile = GHNContext.getContext().getGHN();
|
||||
ghnName = ghnProfile.getNodeDescription().getName();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Unable to get the GHN profile", e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(20000);
|
||||
} catch (InterruptedException e1) {
|
||||
|
||||
e1.printStackTrace();
|
||||
logger.error("Unable to get the servce instance profile", e1);
|
||||
}
|
||||
|
||||
// Check if the Registry profile is alerady registered
|
||||
// Check if the Registry profile is already registered
|
||||
|
||||
try {
|
||||
// registers the my profile
|
||||
|
@ -151,15 +153,14 @@ public class ServiceContext extends GCUBEServiceContext {
|
|||
registerProfile(ghnProfile, GCUBEHostingNode.TYPE);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Failed to register co-deployed services", e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInitialisation() throws Exception {
|
||||
|
||||
}
|
||||
protected void onInitialisation() throws Exception {}
|
||||
|
||||
/**
|
||||
* Register the Profile
|
||||
|
|
Loading…
Reference in New Issue